PHP
- 1 ответ
- 0 вопросов
0
Вклад в тег
CREATE OR REPLACE FUNCTION el_encrypt
(
value text
)
RETURNS bytea
AS $BODY$
BEGIN
RETURN pgp_pub_encrypt(value, dearmor(pg_read_file('pgpkeys/pgp-pg-el-public.key')));
END;
$BODY$ LANGUAGE plpgsql
SECURITY DEFINER;
CREATE OR REPLACE FUNCTION el_decrypt
(
value bytea
) RETURNS text AS
$BODY$
BEGIN
RETURN pgp_pub_decrypt(value, dearmor(pg_read_file('pgpkeys/pgp-pg-el-private.key')));
END;
$BODY$
LANGUAGE plpgsql
SECURITY DEFINER;