-
Notifications
You must be signed in to change notification settings - Fork 3
/
sslutils--1.1.sql
47 lines (42 loc) · 1.81 KB
/
sslutils--1.1.sql
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
35
36
37
38
39
40
41
42
43
44
45
46
CREATE OR REPLACE FUNCTION sslutils_version()
RETURNS text
AS 'MODULE_PATHNAME', 'sslutils_version'
LANGUAGE C IMMUTABLE;
COMMENT ON FUNCTION sslutils_version() IS 'Returns the current version of sslutils';
CREATE OR REPLACE FUNCTION openssl_rsa_generate_key(integer)
RETURNS text
AS 'MODULE_PATHNAME', 'openssl_rsa_generate_key'
LANGUAGE C IMMUTABLE STRICT;
COMMENT ON FUNCTION openssl_rsa_generate_key(integer) IS 'Generates the RSA Private Key.
-- Parameter:
-- param1 : Number of bits.';
CREATE OR REPLACE FUNCTION openssl_rsa_key_to_csr(text, text, text, text, text, text, text)
RETURNS text
AS 'MODULE_PATHNAME', 'openssl_rsa_key_to_csr'
LANGUAGE C IMMUTABLE STRICT;
COMMENT ON FUNCTION openssl_rsa_key_to_csr(text, text, text, text, text, text, text) IS 'Generates the Certificate Signing Request (CSR).
-- Parameters:
-- param1 : rsa key
-- param2 : CN or common name e.g. agentN
-- param3 : C or Country
-- param4 : ST or State
-- param5 : L or Location (City)
-- param6 : OU or Organization Unit
-- param7 : email.';
CREATE OR REPLACE FUNCTION openssl_csr_to_crt(text, text, text)
RETURNS text
AS 'MODULE_PATHNAME', 'openssl_csr_to_crt'
LANGUAGE C IMMUTABLE;
COMMENT ON FUNCTION openssl_csr_to_crt(text, text, text) 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.';
CREATE OR REPLACE FUNCTION openssl_rsa_generate_crl(text, text)
RETURNS text
AS 'MODULE_PATHNAME', 'openssl_rsa_generate_crl'
LANGUAGE C IMMUTABLE;
COMMENT ON FUNCTION openssl_rsa_generate_crl(text, text) IS 'Generates the Certificate Revocation List (CRL).
-- Parameters:
-- param1 : Path to CA certificate.
-- param2 : Path to CA private key.';