This package seems to be very good, it includes all kind of asymetric encryption/decryption functions, and data types to store keys into postgresql tables.
It still unfinished, but maybe it already incorporates the functionality your looking for.
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.