1 module bindbc.gnutls.ocsp;
2 
3 import bindbc.gnutls.config;
4 import bindbc.gnutls.gnutls;
5 import bindbc.gnutls.x509;
6 import core.sys.posix.sys.select;
7 
8 enum GNUTLS_OCSP_NONCE = "1.3.6.1.5.5.7.48.1.2";
9 
10 enum gnutls_ocsp_print_formats_t
11 {
12     GNUTLS_OCSP_PRINT_FULL = 0,
13     GNUTLS_OCSP_PRINT_COMPACT = 1
14 }
15 
16 enum gnutls_ocsp_resp_status_t
17 {
18     GNUTLS_OCSP_RESP_SUCCESSFUL = 0,
19     GNUTLS_OCSP_RESP_MALFORMEDREQUEST = 1,
20     GNUTLS_OCSP_RESP_INTERNALERROR = 2,
21     GNUTLS_OCSP_RESP_TRYLATER = 3,
22     GNUTLS_OCSP_RESP_SIGREQUIRED = 5,
23     GNUTLS_OCSP_RESP_UNAUTHORIZED = 6
24 }
25 
26 enum gnutls_ocsp_cert_status_t
27 {
28     GNUTLS_OCSP_CERT_GOOD = 0,
29     GNUTLS_OCSP_CERT_REVOKED = 1,
30     GNUTLS_OCSP_CERT_UNKNOWN = 2
31 }
32 
33 enum gnutls_x509_crl_reason_t
34 {
35     GNUTLS_X509_CRLREASON_UNSPECIFIED = 0,
36     GNUTLS_X509_CRLREASON_KEYCOMPROMISE = 1,
37     GNUTLS_X509_CRLREASON_CACOMPROMISE = 2,
38     GNUTLS_X509_CRLREASON_AFFILIATIONCHANGED = 3,
39     GNUTLS_X509_CRLREASON_SUPERSEDED = 4,
40     GNUTLS_X509_CRLREASON_CESSATIONOFOPERATION = 5,
41     GNUTLS_X509_CRLREASON_CERTIFICATEHOLD = 6,
42     GNUTLS_X509_CRLREASON_REMOVEFROMCRL = 8,
43     GNUTLS_X509_CRLREASON_PRIVILEGEWITHDRAWN = 9,
44     GNUTLS_X509_CRLREASON_AACOMPROMISE = 10
45 }
46 
47 enum gnutls_ocsp_verify_reason_t
48 {
49     GNUTLS_OCSP_VERIFY_SIGNER_NOT_FOUND = 1,
50     GNUTLS_OCSP_VERIFY_SIGNER_KEYUSAGE_ERROR = 2,
51     GNUTLS_OCSP_VERIFY_UNTRUSTED_SIGNER = 4,
52     GNUTLS_OCSP_VERIFY_INSECURE_ALGORITHM = 8,
53     GNUTLS_OCSP_VERIFY_SIGNATURE_FAILURE = 16,
54     GNUTLS_OCSP_VERIFY_CERT_NOT_ACTIVATED = 32,
55     GNUTLS_OCSP_VERIFY_CERT_EXPIRED = 64
56 }
57 
58 struct gnutls_ocsp_req_int;
59 alias gnutls_ocsp_req_t = gnutls_ocsp_req_int*;
60 
61 static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_12)
62     alias gnutls_ocsp_req_const_t = const(gnutls_ocsp_req_int)*;
63 else
64     alias gnutls_ocsp_req_const_t = gnutls_ocsp_req_t; // functions weren't using const before
65 
66 struct gnutls_ocsp_resp_int;
67 alias gnutls_ocsp_resp_t = gnutls_ocsp_resp_int*;
68 alias gnutls_ocsp_resp_const_t = const(gnutls_ocsp_resp_int)*;
69 
70 enum GNUTLS_OCSP_RESP_ID_KEY = 1;
71 enum GNUTLS_OCSP_RESP_ID_DN = 2;
72 
73 version (BindGnuTLS_Static)
74 {
75     extern (System) @nogc nothrow @system:
76 
77     int gnutls_ocsp_req_init (gnutls_ocsp_req_t* req);
78     void gnutls_ocsp_req_deinit (gnutls_ocsp_req_t req);
79     int gnutls_ocsp_req_import (gnutls_ocsp_req_t req, const(gnutls_datum_t)* data);
80     int gnutls_ocsp_req_export (gnutls_ocsp_req_const_t req, gnutls_datum_t* data);
81     int gnutls_ocsp_req_print (gnutls_ocsp_req_const_t req, gnutls_ocsp_print_formats_t format, gnutls_datum_t* out_);
82     int gnutls_ocsp_req_get_version (gnutls_ocsp_req_const_t req);
83     int gnutls_ocsp_req_get_cert_id (gnutls_ocsp_req_const_t req, uint indx, gnutls_digest_algorithm_t* digest, gnutls_datum_t* issuer_name_hash, gnutls_datum_t* issuer_key_hash, gnutls_datum_t* serial_number);
84     int gnutls_ocsp_req_add_cert_id (gnutls_ocsp_req_t req, gnutls_digest_algorithm_t digest, const(gnutls_datum_t)* issuer_name_hash, const(gnutls_datum_t)* issuer_key_hash, const(gnutls_datum_t)* serial_number);
85     int gnutls_ocsp_req_add_cert (gnutls_ocsp_req_t req, gnutls_digest_algorithm_t digest, gnutls_x509_crt_t issuer, gnutls_x509_crt_t cert);
86     int gnutls_ocsp_req_get_extension (gnutls_ocsp_req_const_t req, uint indx, gnutls_datum_t* oid, uint* critical, gnutls_datum_t* data);
87     int gnutls_ocsp_req_set_extension (gnutls_ocsp_req_t req, const(char)* oid, uint critical, const(gnutls_datum_t)* data);
88     int gnutls_ocsp_req_get_nonce (gnutls_ocsp_req_const_t req, uint* critical, gnutls_datum_t* nonce);
89     int gnutls_ocsp_req_set_nonce (gnutls_ocsp_req_t req, uint critical, const(gnutls_datum_t)* nonce);
90     int gnutls_ocsp_req_randomize_nonce (gnutls_ocsp_req_t req);
91     int gnutls_ocsp_resp_init (gnutls_ocsp_resp_t* resp);
92     void gnutls_ocsp_resp_deinit (gnutls_ocsp_resp_t resp);
93     int gnutls_ocsp_resp_import (gnutls_ocsp_resp_t resp, const(gnutls_datum_t)* data);
94     int gnutls_ocsp_resp_export (gnutls_ocsp_resp_const_t resp, gnutls_datum_t* data);
95 
96     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
97     {
98         int gnutls_ocsp_resp_import2 (gnutls_ocsp_resp_t resp, const(gnutls_datum_t)* data, gnutls_x509_crt_fmt_t fmt);
99         int gnutls_ocsp_resp_export2 (gnutls_ocsp_resp_const_t resp, gnutls_datum_t* data, gnutls_x509_crt_fmt_t fmt);
100     }
101 
102     int gnutls_ocsp_resp_print (gnutls_ocsp_resp_const_t resp, gnutls_ocsp_print_formats_t format, gnutls_datum_t* out_);
103     int gnutls_ocsp_resp_get_status (gnutls_ocsp_resp_const_t resp);
104     int gnutls_ocsp_resp_get_response (gnutls_ocsp_resp_const_t resp, gnutls_datum_t* response_type_oid, gnutls_datum_t* response);
105     int gnutls_ocsp_resp_get_version (gnutls_ocsp_resp_const_t resp);
106     int gnutls_ocsp_resp_get_responder (gnutls_ocsp_resp_const_t resp, gnutls_datum_t* dn);
107 
108     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_5_7)
109         int gnutls_ocsp_resp_get_responder2 (gnutls_ocsp_resp_const_t resp, gnutls_datum_t* dn, uint flags);
110 
111     int gnutls_ocsp_resp_get_responder_raw_id (gnutls_ocsp_resp_const_t resp, uint type, gnutls_datum_t* raw);
112     time_t gnutls_ocsp_resp_get_produced (gnutls_ocsp_resp_const_t resp);
113     int gnutls_ocsp_resp_get_single (gnutls_ocsp_resp_const_t resp, uint indx, gnutls_digest_algorithm_t* digest, gnutls_datum_t* issuer_name_hash, gnutls_datum_t* issuer_key_hash, gnutls_datum_t* serial_number, uint* cert_status, time_t* this_update, time_t* next_update, time_t* revocation_time, uint* revocation_reason);
114     int gnutls_ocsp_resp_get_extension (gnutls_ocsp_resp_const_t resp, uint indx, gnutls_datum_t* oid, uint* critical, gnutls_datum_t* data);
115     int gnutls_ocsp_resp_get_nonce (gnutls_ocsp_resp_const_t resp, uint* critical, gnutls_datum_t* nonce);
116     int gnutls_ocsp_resp_get_signature_algorithm (gnutls_ocsp_resp_const_t resp);
117     int gnutls_ocsp_resp_get_signature (gnutls_ocsp_resp_const_t resp, gnutls_datum_t* sig);
118     int gnutls_ocsp_resp_get_certs (gnutls_ocsp_resp_const_t resp, gnutls_x509_crt_t** certs, size_t* ncerts);
119     int gnutls_ocsp_resp_verify_direct (gnutls_ocsp_resp_const_t resp, gnutls_x509_crt_t issuer, uint* verify, uint flags);
120     int gnutls_ocsp_resp_verify (gnutls_ocsp_resp_const_t resp, gnutls_x509_trust_list_t trustlist, uint* verify, uint flags);
121     int gnutls_ocsp_resp_check_crt (gnutls_ocsp_resp_const_t resp, uint indx, gnutls_x509_crt_t crt);
122 
123     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
124         int gnutls_ocsp_resp_list_import2 (gnutls_ocsp_resp_t** ocsps, uint* size, const(gnutls_datum_t)* resp_data, gnutls_x509_crt_fmt_t format, uint flags);
125 }
126 else
127 {
128     extern (System) @nogc nothrow @system
129     {
130         alias pgnutls_ocsp_req_init = int function (gnutls_ocsp_req_t* req);
131         alias pgnutls_ocsp_req_deinit = void function (gnutls_ocsp_req_t req);
132         alias pgnutls_ocsp_req_import = int function (gnutls_ocsp_req_t req, const(gnutls_datum_t)* data);
133         alias pgnutls_ocsp_req_export = int function (gnutls_ocsp_req_const_t req, gnutls_datum_t* data);
134         alias pgnutls_ocsp_req_print = int function (gnutls_ocsp_req_const_t req, gnutls_ocsp_print_formats_t format, gnutls_datum_t* out_);
135         alias pgnutls_ocsp_req_get_version = int function (gnutls_ocsp_req_const_t req);
136         alias pgnutls_ocsp_req_get_cert_id = int function (gnutls_ocsp_req_const_t req, uint indx, gnutls_digest_algorithm_t* digest, gnutls_datum_t* issuer_name_hash, gnutls_datum_t* issuer_key_hash, gnutls_datum_t* serial_number);
137         alias pgnutls_ocsp_req_add_cert_id = int function (gnutls_ocsp_req_t req, gnutls_digest_algorithm_t digest, const(gnutls_datum_t)* issuer_name_hash, const(gnutls_datum_t)* issuer_key_hash, const(gnutls_datum_t)* serial_number);
138         alias pgnutls_ocsp_req_add_cert = int function (gnutls_ocsp_req_t req, gnutls_digest_algorithm_t digest, gnutls_x509_crt_t issuer, gnutls_x509_crt_t cert);
139         alias pgnutls_ocsp_req_get_extension = int function (gnutls_ocsp_req_const_t req, uint indx, gnutls_datum_t* oid, uint* critical, gnutls_datum_t* data);
140         alias pgnutls_ocsp_req_set_extension = int function (gnutls_ocsp_req_t req, const(char)* oid, uint critical, const(gnutls_datum_t)* data);
141         alias pgnutls_ocsp_req_get_nonce = int function (gnutls_ocsp_req_const_t req, uint* critical, gnutls_datum_t* nonce);
142         alias pgnutls_ocsp_req_set_nonce = int function (gnutls_ocsp_req_t req, uint critical, const(gnutls_datum_t)* nonce);
143         alias pgnutls_ocsp_req_randomize_nonce = int function (gnutls_ocsp_req_t req);
144         alias pgnutls_ocsp_resp_init = int function (gnutls_ocsp_resp_t* resp);
145         alias pgnutls_ocsp_resp_deinit = void function (gnutls_ocsp_resp_t resp);
146         alias pgnutls_ocsp_resp_import = int function (gnutls_ocsp_resp_t resp, const(gnutls_datum_t)* data);
147         alias pgnutls_ocsp_resp_export = int function (gnutls_ocsp_resp_const_t resp, gnutls_datum_t* data);
148 
149         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
150         {
151             alias pgnutls_ocsp_resp_import2 = int function (gnutls_ocsp_resp_t resp, const(gnutls_datum_t)* data, gnutls_x509_crt_fmt_t fmt);
152             alias pgnutls_ocsp_resp_export2 = int function (gnutls_ocsp_resp_const_t resp, gnutls_datum_t* data, gnutls_x509_crt_fmt_t fmt);
153         }
154 
155         alias pgnutls_ocsp_resp_print = int function (gnutls_ocsp_resp_const_t resp, gnutls_ocsp_print_formats_t format, gnutls_datum_t* out_);
156         alias pgnutls_ocsp_resp_get_status = int function (gnutls_ocsp_resp_const_t resp);
157         alias pgnutls_ocsp_resp_get_response = int function (gnutls_ocsp_resp_const_t resp, gnutls_datum_t* response_type_oid, gnutls_datum_t* response);
158         alias pgnutls_ocsp_resp_get_version = int function (gnutls_ocsp_resp_const_t resp);
159         alias pgnutls_ocsp_resp_get_responder = int function (gnutls_ocsp_resp_const_t resp, gnutls_datum_t* dn);
160 
161         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_5_7)
162             alias pgnutls_ocsp_resp_get_responder2 = int function (gnutls_ocsp_resp_const_t resp, gnutls_datum_t* dn, uint flags);
163 
164         alias pgnutls_ocsp_resp_get_responder_raw_id = int function (gnutls_ocsp_resp_const_t resp, uint type, gnutls_datum_t* raw);
165         alias pgnutls_ocsp_resp_get_produced = time_t function (gnutls_ocsp_resp_const_t resp);
166         alias pgnutls_ocsp_resp_get_single = int function (gnutls_ocsp_resp_const_t resp, uint indx, gnutls_digest_algorithm_t* digest, gnutls_datum_t* issuer_name_hash, gnutls_datum_t* issuer_key_hash, gnutls_datum_t* serial_number, uint* cert_status, time_t* this_update, time_t* next_update, time_t* revocation_time, uint* revocation_reason);
167         alias pgnutls_ocsp_resp_get_extension = int function (gnutls_ocsp_resp_const_t resp, uint indx, gnutls_datum_t* oid, uint* critical, gnutls_datum_t* data);
168         alias pgnutls_ocsp_resp_get_nonce = int function (gnutls_ocsp_resp_const_t resp, uint* critical, gnutls_datum_t* nonce);
169         alias pgnutls_ocsp_resp_get_signature_algorithm = int function (gnutls_ocsp_resp_const_t resp);
170         alias pgnutls_ocsp_resp_get_signature = int function (gnutls_ocsp_resp_const_t resp, gnutls_datum_t* sig);
171         alias pgnutls_ocsp_resp_get_certs = int function (gnutls_ocsp_resp_const_t resp, gnutls_x509_crt_t** certs, size_t* ncerts);
172         alias pgnutls_ocsp_resp_verify_direct = int function (gnutls_ocsp_resp_const_t resp, gnutls_x509_crt_t issuer, uint* verify, uint flags);
173         alias pgnutls_ocsp_resp_verify = int function (gnutls_ocsp_resp_const_t resp, gnutls_x509_trust_list_t trustlist, uint* verify, uint flags);
174         alias pgnutls_ocsp_resp_check_crt = int function (gnutls_ocsp_resp_const_t resp, uint indx, gnutls_x509_crt_t crt);
175 
176         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
177             alias pgnutls_ocsp_resp_list_import2 = int function (gnutls_ocsp_resp_t** ocsps, uint* size, const(gnutls_datum_t)* resp_data, gnutls_x509_crt_fmt_t format, uint flags);
178     }
179 
180     __gshared
181     {
182         pgnutls_ocsp_req_init gnutls_ocsp_req_init;
183         pgnutls_ocsp_req_deinit gnutls_ocsp_req_deinit;
184         pgnutls_ocsp_req_import gnutls_ocsp_req_import;
185         pgnutls_ocsp_req_export gnutls_ocsp_req_export;
186         pgnutls_ocsp_req_print gnutls_ocsp_req_print;
187         pgnutls_ocsp_req_get_version gnutls_ocsp_req_get_version;
188         pgnutls_ocsp_req_get_cert_id gnutls_ocsp_req_get_cert_id;
189         pgnutls_ocsp_req_add_cert_id gnutls_ocsp_req_add_cert_id;
190         pgnutls_ocsp_req_add_cert gnutls_ocsp_req_add_cert;
191         pgnutls_ocsp_req_get_extension gnutls_ocsp_req_get_extension;
192         pgnutls_ocsp_req_set_extension gnutls_ocsp_req_set_extension;
193         pgnutls_ocsp_req_get_nonce gnutls_ocsp_req_get_nonce;
194         pgnutls_ocsp_req_set_nonce gnutls_ocsp_req_set_nonce;
195         pgnutls_ocsp_req_randomize_nonce gnutls_ocsp_req_randomize_nonce;
196         pgnutls_ocsp_resp_init gnutls_ocsp_resp_init;
197         pgnutls_ocsp_resp_deinit gnutls_ocsp_resp_deinit;
198         pgnutls_ocsp_resp_import gnutls_ocsp_resp_import;
199         pgnutls_ocsp_resp_export gnutls_ocsp_resp_export;
200 
201         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
202         {
203             pgnutls_ocsp_resp_import2 gnutls_ocsp_resp_import2;
204             pgnutls_ocsp_resp_export2 gnutls_ocsp_resp_export2;
205         }
206 
207         pgnutls_ocsp_resp_print gnutls_ocsp_resp_print;
208         pgnutls_ocsp_resp_get_status gnutls_ocsp_resp_get_status;
209         pgnutls_ocsp_resp_get_response gnutls_ocsp_resp_get_response;
210         pgnutls_ocsp_resp_get_version gnutls_ocsp_resp_get_version;
211         pgnutls_ocsp_resp_get_responder gnutls_ocsp_resp_get_responder;
212 
213         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_5_7)
214             pgnutls_ocsp_resp_get_responder2 gnutls_ocsp_resp_get_responder2;
215 
216         pgnutls_ocsp_resp_get_responder_raw_id gnutls_ocsp_resp_get_responder_raw_id;
217         pgnutls_ocsp_resp_get_produced gnutls_ocsp_resp_get_produced;
218         pgnutls_ocsp_resp_get_single gnutls_ocsp_resp_get_single;
219         pgnutls_ocsp_resp_get_extension gnutls_ocsp_resp_get_extension;
220         pgnutls_ocsp_resp_get_nonce gnutls_ocsp_resp_get_nonce;
221         pgnutls_ocsp_resp_get_signature_algorithm gnutls_ocsp_resp_get_signature_algorithm;
222         pgnutls_ocsp_resp_get_signature gnutls_ocsp_resp_get_signature;
223         pgnutls_ocsp_resp_get_certs gnutls_ocsp_resp_get_certs;
224         pgnutls_ocsp_resp_verify_direct gnutls_ocsp_resp_verify_direct;
225         pgnutls_ocsp_resp_verify gnutls_ocsp_resp_verify;
226         pgnutls_ocsp_resp_check_crt gnutls_ocsp_resp_check_crt;
227 
228         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
229             pgnutls_ocsp_resp_list_import2 gnutls_ocsp_resp_list_import2;
230     }
231 
232     import bindbc.loader : SharedLib, bindSymbol_stdcall;
233     void bindOcsp(SharedLib lib)
234     {
235         lib.bindSymbol_stdcall(gnutls_ocsp_req_init, "gnutls_ocsp_req_init");
236         lib.bindSymbol_stdcall(gnutls_ocsp_req_deinit, "gnutls_ocsp_req_deinit");
237         lib.bindSymbol_stdcall(gnutls_ocsp_req_import, "gnutls_ocsp_req_import");
238         lib.bindSymbol_stdcall(gnutls_ocsp_req_export, "gnutls_ocsp_req_export");
239         lib.bindSymbol_stdcall(gnutls_ocsp_req_print, "gnutls_ocsp_req_print");
240         lib.bindSymbol_stdcall(gnutls_ocsp_req_get_version, "gnutls_ocsp_req_get_version");
241         lib.bindSymbol_stdcall(gnutls_ocsp_req_get_cert_id, "gnutls_ocsp_req_get_cert_id");
242         lib.bindSymbol_stdcall(gnutls_ocsp_req_add_cert_id, "gnutls_ocsp_req_add_cert_id");
243         lib.bindSymbol_stdcall(gnutls_ocsp_req_add_cert, "gnutls_ocsp_req_add_cert");
244         lib.bindSymbol_stdcall(gnutls_ocsp_req_get_extension, "gnutls_ocsp_req_get_extension");
245         lib.bindSymbol_stdcall(gnutls_ocsp_req_set_extension, "gnutls_ocsp_req_set_extension");
246         lib.bindSymbol_stdcall(gnutls_ocsp_req_get_nonce, "gnutls_ocsp_req_get_nonce");
247         lib.bindSymbol_stdcall(gnutls_ocsp_req_set_nonce, "gnutls_ocsp_req_set_nonce");
248         lib.bindSymbol_stdcall(gnutls_ocsp_req_randomize_nonce, "gnutls_ocsp_req_randomize_nonce");
249         lib.bindSymbol_stdcall(gnutls_ocsp_resp_init, "gnutls_ocsp_resp_init");
250         lib.bindSymbol_stdcall(gnutls_ocsp_resp_deinit, "gnutls_ocsp_resp_deinit");
251         lib.bindSymbol_stdcall(gnutls_ocsp_resp_import, "gnutls_ocsp_resp_import");
252         lib.bindSymbol_stdcall(gnutls_ocsp_resp_export, "gnutls_ocsp_resp_export");
253 
254         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
255         {
256             lib.bindSymbol_stdcall(gnutls_ocsp_resp_import2, "gnutls_ocsp_resp_import2");
257             lib.bindSymbol_stdcall(gnutls_ocsp_resp_export2, "gnutls_ocsp_resp_export2");
258         }
259 
260         lib.bindSymbol_stdcall(gnutls_ocsp_resp_print, "gnutls_ocsp_resp_print");
261         lib.bindSymbol_stdcall(gnutls_ocsp_resp_get_status, "gnutls_ocsp_resp_get_status");
262         lib.bindSymbol_stdcall(gnutls_ocsp_resp_get_response, "gnutls_ocsp_resp_get_response");
263         lib.bindSymbol_stdcall(gnutls_ocsp_resp_get_version, "gnutls_ocsp_resp_get_version");
264         lib.bindSymbol_stdcall(gnutls_ocsp_resp_get_responder, "gnutls_ocsp_resp_get_responder");
265 
266         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_5_7)
267             lib.bindSymbol_stdcall(gnutls_ocsp_resp_get_responder2, "gnutls_ocsp_resp_get_responder2");
268 
269         lib.bindSymbol_stdcall(gnutls_ocsp_resp_get_responder_raw_id, "gnutls_ocsp_resp_get_responder_raw_id");
270         lib.bindSymbol_stdcall(gnutls_ocsp_resp_get_produced, "gnutls_ocsp_resp_get_produced");
271         lib.bindSymbol_stdcall(gnutls_ocsp_resp_get_single, "gnutls_ocsp_resp_get_single");
272         lib.bindSymbol_stdcall(gnutls_ocsp_resp_get_extension, "gnutls_ocsp_resp_get_extension");
273         lib.bindSymbol_stdcall(gnutls_ocsp_resp_get_nonce, "gnutls_ocsp_resp_get_nonce");
274         lib.bindSymbol_stdcall(gnutls_ocsp_resp_get_signature_algorithm, "gnutls_ocsp_resp_get_signature_algorithm");
275         lib.bindSymbol_stdcall(gnutls_ocsp_resp_get_signature, "gnutls_ocsp_resp_get_signature");
276         lib.bindSymbol_stdcall(gnutls_ocsp_resp_get_certs, "gnutls_ocsp_resp_get_certs");
277         lib.bindSymbol_stdcall(gnutls_ocsp_resp_verify_direct, "gnutls_ocsp_resp_verify_direct");
278         lib.bindSymbol_stdcall(gnutls_ocsp_resp_verify, "gnutls_ocsp_resp_verify");
279         lib.bindSymbol_stdcall(gnutls_ocsp_resp_check_crt, "gnutls_ocsp_resp_check_crt");
280 
281         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
282             lib.bindSymbol_stdcall(gnutls_ocsp_resp_list_import2, "gnutls_ocsp_resp_list_import2");
283     }
284 }