forked from crtsh/libx509pq
-
Notifications
You must be signed in to change notification settings - Fork 1
/
libx509pq--1.0.sql
133 lines (91 loc) · 5.14 KB
/
libx509pq--1.0.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION libx509pq" to load this file. \quit
CREATE OR REPLACE FUNCTION x509_issuerName(bytea,integer DEFAULT NULL) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_keyAlgorithm(bytea) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_keySize(bytea) RETURNS integer
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_notAfter(bytea) RETURNS timestamp
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_notBefore(bytea) RETURNS timestamp
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_publicKeyMD5(bytea) RETURNS bytea
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_publicKey(bytea) RETURNS bytea
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_rsaModulus(bytea) RETURNS bytea
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_serialNumber(bytea) RETURNS bytea
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_signatureHashAlgorithm(bytea) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_signatureKeyAlgorithm(bytea) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_subjectName(bytea,integer DEFAULT NULL) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_name(bytea,boolean DEFAULT TRUE) RETURNS bytea
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_name_print(bytea,integer DEFAULT NULL) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_commonName(bytea) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_subjectKeyIdentifier(bytea) RETURNS bytea
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_authorityKeyId(bytea) RETURNS bytea
AS '$libdir/libx509pq.so' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_extKeyUsages(bytea,boolean DEFAULT TRUE) RETURNS SETOF text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_isEKUPermitted(bytea,text) RETURNS boolean
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_certPolicies(bytea) RETURNS SETOF text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_isPolicyPermitted(bytea,text) RETURNS boolean
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_canIssueCerts(bytea) RETURNS boolean
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_getPathLenConstraint(bytea) RETURNS integer
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_nameAttributes(bytea,text,boolean,boolean DEFAULT TRUE) RETURNS SETOF text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE TYPE name_raw_type AS (
ATTRIBUTE_OID text,
RAW_VALUE bytea
);
CREATE OR REPLACE FUNCTION x509_nameAttributes_raw(bytea,boolean DEFAULT TRUE) RETURNS SETOF name_raw_type
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_altNames(bytea,integer DEFAULT NULL,boolean DEFAULT TRUE,boolean DEFAULT TRUE) RETURNS SETOF text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE TYPE altname_raw_type AS (
TYPE_NUM integer,
RAW_VALUE bytea,
OTHER_NAME_OID text
);
CREATE OR REPLACE FUNCTION x509_altNames_raw(bytea,boolean DEFAULT TRUE) RETURNS SETOF altname_raw_type
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_cRLDistributionPoints(bytea) RETURNS SETOF text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_authorityInfoAccess(bytea,integer DEFAULT NULL) RETURNS SETOF text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_print(bytea,integer DEFAULT NULL,integer DEFAULT NULL) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_verify(bytea,bytea) RETURNS boolean
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_anyNamesWithNULs(bytea) RETURNS boolean
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_extensions(bytea,boolean DEFAULT TRUE) RETURNS SETOF text
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_hasExtension(bytea,text,boolean DEFAULT NULL) RETURNS boolean
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_tbscert_strip_ct_ext(bytea) RETURNS bytea
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_hasROCAFingerprint(bytea) RETURNS boolean
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION x509_hasClosePrimes(bytea,smallint DEFAULT 100) RETURNS boolean
AS 'MODULE_PATHNAME' LANGUAGE c IMMUTABLE;
CREATE OR REPLACE FUNCTION urlEncode(text) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION urlDecode(text) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION x509pq_opensslVersion() RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;