1 /* contrib/pgcrypto/pgcrypto--1.3.sql */
3 -- complain if script is sourced in psql, rather than via CREATE EXTENSION
4 \echo Use "CREATE EXTENSION pgcrypto" to load this file. \quit
6 CREATE FUNCTION digest(text, text)
8 AS 'MODULE_PATHNAME', 'pg_digest'
9 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
11 CREATE FUNCTION digest(bytea, text)
13 AS 'MODULE_PATHNAME', 'pg_digest'
14 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
16 CREATE FUNCTION hmac(text, text, text)
18 AS 'MODULE_PATHNAME', 'pg_hmac'
19 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
21 CREATE FUNCTION hmac(bytea, bytea, text)
23 AS 'MODULE_PATHNAME', 'pg_hmac'
24 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
26 CREATE FUNCTION crypt(text, text)
28 AS 'MODULE_PATHNAME', 'pg_crypt'
29 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
31 CREATE FUNCTION gen_salt(text)
33 AS 'MODULE_PATHNAME', 'pg_gen_salt'
34 LANGUAGE C VOLATILE STRICT PARALLEL SAFE;
36 CREATE FUNCTION gen_salt(text, int4)
38 AS 'MODULE_PATHNAME', 'pg_gen_salt_rounds'
39 LANGUAGE C VOLATILE STRICT PARALLEL SAFE;
41 CREATE FUNCTION encrypt(bytea, bytea, text)
43 AS 'MODULE_PATHNAME', 'pg_encrypt'
44 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
46 CREATE FUNCTION decrypt(bytea, bytea, text)
48 AS 'MODULE_PATHNAME', 'pg_decrypt'
49 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
51 CREATE FUNCTION encrypt_iv(bytea, bytea, bytea, text)
53 AS 'MODULE_PATHNAME', 'pg_encrypt_iv'
54 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
56 CREATE FUNCTION decrypt_iv(bytea, bytea, bytea, text)
58 AS 'MODULE_PATHNAME', 'pg_decrypt_iv'
59 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
61 CREATE FUNCTION gen_random_bytes(int4)
63 AS 'MODULE_PATHNAME', 'pg_random_bytes'
64 LANGUAGE C VOLATILE STRICT PARALLEL SAFE;
66 CREATE FUNCTION gen_random_uuid()
68 AS 'MODULE_PATHNAME', 'pg_random_uuid'
69 LANGUAGE C VOLATILE PARALLEL SAFE;
72 -- pgp_sym_encrypt(data, key)
74 CREATE FUNCTION pgp_sym_encrypt(text, text)
76 AS 'MODULE_PATHNAME', 'pgp_sym_encrypt_text'
77 LANGUAGE C STRICT PARALLEL SAFE;
79 CREATE FUNCTION pgp_sym_encrypt_bytea(bytea, text)
81 AS 'MODULE_PATHNAME', 'pgp_sym_encrypt_bytea'
82 LANGUAGE C STRICT PARALLEL SAFE;
85 -- pgp_sym_encrypt(data, key, args)
87 CREATE FUNCTION pgp_sym_encrypt(text, text, text)
89 AS 'MODULE_PATHNAME', 'pgp_sym_encrypt_text'
90 LANGUAGE C STRICT PARALLEL SAFE;
92 CREATE FUNCTION pgp_sym_encrypt_bytea(bytea, text, text)
94 AS 'MODULE_PATHNAME', 'pgp_sym_encrypt_bytea'
95 LANGUAGE C STRICT PARALLEL SAFE;
98 -- pgp_sym_decrypt(data, key)
100 CREATE FUNCTION pgp_sym_decrypt(bytea, text)
102 AS 'MODULE_PATHNAME', 'pgp_sym_decrypt_text'
103 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
105 CREATE FUNCTION pgp_sym_decrypt_bytea(bytea, text)
107 AS 'MODULE_PATHNAME', 'pgp_sym_decrypt_bytea'
108 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
111 -- pgp_sym_decrypt(data, key, args)
113 CREATE FUNCTION pgp_sym_decrypt(bytea, text, text)
115 AS 'MODULE_PATHNAME', 'pgp_sym_decrypt_text'
116 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
118 CREATE FUNCTION pgp_sym_decrypt_bytea(bytea, text, text)
120 AS 'MODULE_PATHNAME', 'pgp_sym_decrypt_bytea'
121 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
124 -- pgp_pub_encrypt(data, key)
126 CREATE FUNCTION pgp_pub_encrypt(text, bytea)
128 AS 'MODULE_PATHNAME', 'pgp_pub_encrypt_text'
129 LANGUAGE C STRICT PARALLEL SAFE;
131 CREATE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea)
133 AS 'MODULE_PATHNAME', 'pgp_pub_encrypt_bytea'
134 LANGUAGE C STRICT PARALLEL SAFE;
137 -- pgp_pub_encrypt(data, key, args)
139 CREATE FUNCTION pgp_pub_encrypt(text, bytea, text)
141 AS 'MODULE_PATHNAME', 'pgp_pub_encrypt_text'
142 LANGUAGE C STRICT PARALLEL SAFE;
144 CREATE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text)
146 AS 'MODULE_PATHNAME', 'pgp_pub_encrypt_bytea'
147 LANGUAGE C STRICT PARALLEL SAFE;
150 -- pgp_pub_decrypt(data, key)
152 CREATE FUNCTION pgp_pub_decrypt(bytea, bytea)
154 AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_text'
155 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
157 CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea)
159 AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_bytea'
160 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
163 -- pgp_pub_decrypt(data, key, psw)
165 CREATE FUNCTION pgp_pub_decrypt(bytea, bytea, text)
167 AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_text'
168 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
170 CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text)
172 AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_bytea'
173 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
176 -- pgp_pub_decrypt(data, key, psw, arg)
178 CREATE FUNCTION pgp_pub_decrypt(bytea, bytea, text, text)
180 AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_text'
181 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
183 CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text)
185 AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_bytea'
186 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
191 CREATE FUNCTION pgp_key_id(bytea)
193 AS 'MODULE_PATHNAME', 'pgp_key_id_w'
194 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
199 CREATE FUNCTION armor(bytea)
201 AS 'MODULE_PATHNAME', 'pg_armor'
202 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
204 CREATE FUNCTION armor(bytea, text[], text[])
206 AS 'MODULE_PATHNAME', 'pg_armor'
207 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
209 CREATE FUNCTION dearmor(text)
211 AS 'MODULE_PATHNAME', 'pg_dearmor'
212 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
214 CREATE FUNCTION pgp_armor_headers(text, key OUT text, value OUT text)
216 AS 'MODULE_PATHNAME', 'pgp_armor_headers'
217 LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;