Repository navigation
Expand file tree
/
Copy pathsslutils--1.3--1.4.sql
More file actions
34 lines (31 loc) · 1.64 KB
/
Copy pathsslutils--1.3--1.4.sql
File metadata and controls
34 lines (31 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
DROP FUNCTION openssl_csr_to_crt(text, text, text);
DROP FUNCTION openssl_rsa_generate_crl(text, text);
DROP FUNCTION openssl_revoke_certificate(text, text);
CREATE OR REPLACE FUNCTION openssl_csr_to_crt(text, text, text, integer DEFAULT NULL)
RETURNS text
AS '$libdir/sslutils', 'openssl_csr_to_crt'
LANGUAGE C IMMUTABLE;
COMMENT ON FUNCTION openssl_csr_to_crt(text, text, text, integer) IS 'Generates the CA/self signed certificate.
-- Parameters:
-- param1 : csr or certificate signing request
-- param2 : Path to CA certificate OR NULL If CA self signed certificate is required.
-- param3 : Path to CA private key OR Path to self private key, If param2 is NULL.
-- param4 : The validity (in days) for the generated certificate.';
CREATE OR REPLACE FUNCTION openssl_rsa_generate_crl(text, text, integer DEFAULT NULL)
RETURNS text
AS '$libdir/sslutils', 'openssl_rsa_generate_crl'
LANGUAGE C IMMUTABLE;
COMMENT ON FUNCTION openssl_rsa_generate_crl(text, text, integer) IS 'Generates the Certificate Revocation List (CRL).
-- Parameters:
-- param1 : Path to CA certificate.
-- param2 : Path to CA private key.
-- param3 : The validity (in days) for the generated CRL.';
CREATE OR REPLACE FUNCTION openssl_revoke_certificate(text, text, integer DEFAULT NULL)
RETURNS text
AS '$libdir/sslutils', 'openssl_revoke_certificate'
LANGUAGE C IMMUTABLE;
COMMENT ON FUNCTION openssl_revoke_certificate(text, text, integer) IS 'Revoke Certificate and add to Certificate Revocation List (CRL).
-- Parameters:
-- param1 : Path to client certificate to be revoked.
-- param2 : CRL file name specified in postgres config file.
-- param3 : The validity (in days) for the revoked certificate.';