1 module bindbc.gnutls.abstract_;
2 
3 import bindbc.gnutls.config;
4 import bindbc.gnutls.gnutls;
5 import bindbc.gnutls.openpgp;
6 import bindbc.gnutls.pkcs11;
7 import bindbc.gnutls.tpm;
8 import bindbc.gnutls.x509;
9 
10 enum GNUTLS_PUBKEY_VERIFY_FLAG_TLS_RSA = GNUTLS_PUBKEY_VERIFY_FLAG_TLS1_RSA;
11 
12 enum gnutls_pubkey_flags
13 {
14     GNUTLS_PUBKEY_DISABLE_CALLBACKS = 1 << 2,
15     GNUTLS_PUBKEY_GET_OPENPGP_FINGERPRINT = 1 << 3
16 }
17 
18 alias gnutls_pubkey_flags_t = gnutls_pubkey_flags;
19 
20 static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
21 {
22     enum gnutls_abstract_export_flags
23     {
24         GNUTLS_EXPORT_FLAG_NO_LZ = 1
25     }
26     alias gnutls_abstract_export_flags_t = gnutls_abstract_export_flags;
27 }
28 
29 enum GNUTLS_PUBKEY_VERIFY_FLAG_TLS1_RSA = gnutls_certificate_verify_flags.GNUTLS_VERIFY_USE_TLS1_RSA;
30 
31 enum GNUTLS_PRIVKEY_INFO_PK_ALGO = 1;
32 enum GNUTLS_PRIVKEY_INFO_SIGN_ALGO = 1 << 1;
33 enum GNUTLS_PRIVKEY_INFO_HAVE_SIGN_ALGO = 1 << 2;
34 
35 static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
36     enum GNUTLS_PRIVKEY_INFO_PK_ALGO_BITS = 1 << 3;
37 
38 enum gnutls_privkey_flags
39 {
40     GNUTLS_PRIVKEY_IMPORT_AUTO_RELEASE = 1,
41     GNUTLS_PRIVKEY_IMPORT_COPY = 1 << 1,
42     GNUTLS_PRIVKEY_DISABLE_CALLBACKS = 1 << 2,
43     GNUTLS_PRIVKEY_SIGN_FLAG_TLS1_RSA = 1 << 4,
44     GNUTLS_PRIVKEY_FLAG_PROVABLE = 1 << 5,
45     GNUTLS_PRIVKEY_FLAG_EXPORT_COMPAT = 1 << 6,
46     GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS = 1 << 7,
47     GNUTLS_PRIVKEY_FLAG_REPRODUCIBLE = 1 << 8,
48     GNUTLS_PRIVKEY_FLAG_CA = 1 << 9
49 }
50 
51 alias gnutls_privkey_flags_t = gnutls_privkey_flags;
52 
53 struct gnutls_pcert_st
54 {
55     gnutls_pubkey_t pubkey;
56     gnutls_datum_t cert;
57     gnutls_certificate_type_t type;
58 }
59 
60 static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_6)
61 {
62     deprecated("This flag is unused/ignored, deprecated from GnuTLS 3.6.6; do not use")
63     enum GNUTLS_PCERT_NO_CERT = 1;
64 }
65 else enum GNUTLS_PCERT_NO_CERT = 1;
66 
67 struct gnutls_cert_retr_st
68 {
69     uint version_;
70     gnutls_certificate_credentials_t cred;
71     const(gnutls_datum_t)* req_ca_rdn;
72     uint nreqs;
73     const(gnutls_pk_algorithm_t)* pk_algos;
74     uint pk_algos_length;
75 
76     ubyte[64] padding;
77 }
78 
79 enum GNUTLS_CERT_RETR_DEINIT_ALL = 1;
80 
81 extern(C) nothrow @nogc
82 {
83     alias gnutls_privkey_sign_func = int function (gnutls_privkey_t key, void* userdata, const(gnutls_datum_t)* raw_data, gnutls_datum_t* signature);
84     alias gnutls_privkey_decrypt_func = int function (gnutls_privkey_t key, void* userdata, const(gnutls_datum_t)* ciphertext, gnutls_datum_t* plaintext);
85     alias gnutls_privkey_decrypt_func2 = int function (gnutls_privkey_t key, void* userdata, const(gnutls_datum_t)* ciphertext, ubyte* plaintext, size_t plaintext_size);
86     alias gnutls_privkey_sign_hash_func = int function (gnutls_privkey_t key, gnutls_sign_algorithm_t algo, void* userdata, uint flags, const(gnutls_datum_t)* hash, gnutls_datum_t* signature);
87     alias gnutls_privkey_sign_data_func = int function (gnutls_privkey_t key, gnutls_sign_algorithm_t algo, void* userdata, uint flags, const(gnutls_datum_t)* data, gnutls_datum_t* signature);
88     alias gnutls_privkey_deinit_func = void function (gnutls_privkey_t key, void* userdata);
89     alias gnutls_privkey_info_func = int function (gnutls_privkey_t key, uint flags, void* userdata);
90     alias gnutls_certificate_retrieve_function2 = int function (gnutls_session_t, const(gnutls_datum_t)* req_ca_rdn, int nreqs, const(gnutls_pk_algorithm_t)* pk_algos, int pk_algos_length, gnutls_pcert_st**, uint* pcert_length, gnutls_privkey_t* privkey);
91     alias gnutls_certificate_retrieve_function3 = int function (gnutls_session_t, const(gnutls_cert_retr_st)* info, gnutls_pcert_st** certs, uint* pcert_length, gnutls_ocsp_data_st** ocsp, uint* ocsp_length, gnutls_privkey_t* privkey, uint* flags);
92 }
93 
94 extern (D) nothrow @nogc
95 {
96     uint GNUTLS_SIGN_ALGO_TO_FLAGS(uint sig) @safe pure
97     {
98         return cast(uint) sig << 20;
99     }
100 
101     uint GNUTLS_FLAGS_TO_SIGN_ALGO(uint flags) @safe pure
102     {
103         return cast(uint) flags >> 20;
104     }
105 
106     uint GNUTLS_SUBGROUP_TO_BITS(uint group, uint subgroup) @safe pure
107     {
108         return cast(uint) (subgroup << 16) | group;
109     }
110 
111     uint GNUTLS_BITS_TO_SUBGROUP(uint bits) @safe pure
112     {
113         return (bits >> 16) & 0xFFFF;
114     }
115 
116     uint GNUTLS_BITS_TO_GROUP(uint bits) @safe pure
117     {
118         return bits & 0xFFFF;
119     }
120 
121     uint GNUTLS_BITS_HAVE_SUBGROUP(uint bits) @safe pure
122     {
123         return bits & 0xFFFF0000;
124     }
125 
126     int gnutls_privkey_import_pkcs11_url(gnutls_privkey_t key, const(char)* url)
127     {
128         return gnutls_privkey_import_url(key, url, 0);
129     }
130 
131     int gnutls_privkey_sign_raw_data(gnutls_privkey_t key, uint flags, const(gnutls_datum_t)* data, gnutls_datum_t* sig)
132     {
133         return gnutls_privkey_sign_hash(key, gnutls_digest_algorithm_t.GNUTLS_DIG_UNKNOWN, gnutls_privkey_flags_t.GNUTLS_PRIVKEY_SIGN_FLAG_TLS1_RSA, data, sig);
134     }
135 }
136 
137 alias gnutls_pubkey_get_pk_rsa_raw = gnutls_pubkey_export_rsa_raw;
138 alias gnutls_pubkey_get_pk_dsa_raw = gnutls_pubkey_export_dsa_raw;
139 alias gnutls_pubkey_get_pk_ecc_raw = gnutls_pubkey_export_ecc_raw;
140 alias gnutls_pubkey_get_pk_ecc_x962 = gnutls_pubkey_export_ecc_x962;
141 alias gnutls_pubkey_import_pkcs11_url = gnutls_pubkey_import_url;
142 
143 version (BindGnuTLS_Static)
144 {
145     extern (System) @nogc nothrow @system:
146 
147     int gnutls_pubkey_init (gnutls_pubkey_t* key);
148     void gnutls_pubkey_deinit (gnutls_pubkey_t key);
149     int gnutls_pubkey_verify_params (gnutls_pubkey_t key);
150     void gnutls_pubkey_set_pin_function (gnutls_pubkey_t key, gnutls_pin_callback_t fn, void* userdata);
151     int gnutls_pubkey_get_pk_algorithm (gnutls_pubkey_t key, uint* bits);
152 
153     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
154     {
155         int gnutls_pubkey_set_spki (gnutls_pubkey_t key, const gnutls_x509_spki_t spki, uint flags);
156         int gnutls_pubkey_get_spki (gnutls_pubkey_t key, const gnutls_x509_spki_t spki, uint flags);
157     }
158 
159     int gnutls_pubkey_import_x509 (gnutls_pubkey_t key, gnutls_x509_crt_t crt, uint flags);
160     int gnutls_pubkey_import_x509_crq (gnutls_pubkey_t key, gnutls_x509_crq_t crq, uint flags);
161     int gnutls_pubkey_import_pkcs11 (gnutls_pubkey_t key, gnutls_pkcs11_obj_t obj, uint flags);
162     int gnutls_pubkey_import_openpgp (gnutls_pubkey_t key, gnutls_openpgp_crt_t crt, uint flags);
163     int gnutls_pubkey_import_openpgp_raw (gnutls_pubkey_t pkey, const(gnutls_datum_t)* data, gnutls_openpgp_crt_fmt_t format, const gnutls_openpgp_keyid_t keyid, uint flags);
164     int gnutls_pubkey_import_x509_raw (gnutls_pubkey_t pkey, const(gnutls_datum_t)* data, gnutls_x509_crt_fmt_t format, uint flags);
165     int gnutls_pubkey_import_privkey (gnutls_pubkey_t key, gnutls_privkey_t pkey, uint usage, uint flags);
166     int gnutls_pubkey_import_tpm_url (gnutls_pubkey_t pkey, const(char)* url, const(char)* srk_password, uint flags);
167     int gnutls_pubkey_import_url (gnutls_pubkey_t key, const(char)* url, uint flags);
168     int gnutls_pubkey_import_tpm_raw (gnutls_pubkey_t pkey, const(gnutls_datum_t)* fdata, gnutls_tpmkey_fmt_t format, const(char)* srk_password, uint flags);
169     int gnutls_pubkey_get_preferred_hash_algorithm (gnutls_pubkey_t key, gnutls_digest_algorithm_t* hash, uint* mand);
170     int gnutls_pubkey_export_rsa_raw (gnutls_pubkey_t key, gnutls_datum_t* m, gnutls_datum_t* e);
171     int gnutls_pubkey_export_dsa_raw (gnutls_pubkey_t key, gnutls_datum_t* p, gnutls_datum_t* q, gnutls_datum_t* g, gnutls_datum_t* y);
172 
173     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
174     {
175         int gnutls_pubkey_export_rsa_raw2 (gnutls_pubkey_t key, gnutls_datum_t* m, gnutls_datum_t* e, uint flags);
176         int gnutls_pubkey_export_dsa_raw2 (gnutls_pubkey_t key, gnutls_datum_t* p, gnutls_datum_t* q, gnutls_datum_t* g, gnutls_datum_t* y, uint flags);
177         int gnutls_pubkey_export_ecc_raw2 (gnutls_pubkey_t key, gnutls_ecc_curve_t* curve, gnutls_datum_t* x, gnutls_datum_t* y, uint flags);
178     }
179 
180     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
181         int gnutls_pubkey_export_gost_raw2 (gnutls_pubkey_t key, gnutls_ecc_curve_t* curve, gnutls_digest_algorithm_t* digest, gnutls_gost_paramset_t* paramset, gnutls_datum_t* x, gnutls_datum_t* y, uint flags);
182 
183     int gnutls_pubkey_export_ecc_raw (gnutls_pubkey_t key, gnutls_ecc_curve_t* curve, gnutls_datum_t* x, gnutls_datum_t* y);
184     int gnutls_pubkey_export_ecc_x962 (gnutls_pubkey_t key, gnutls_datum_t* parameters, gnutls_datum_t* ecpoint);
185     int gnutls_pubkey_export (gnutls_pubkey_t key, gnutls_x509_crt_fmt_t format, void* output_data, size_t* output_data_size);
186     int gnutls_pubkey_export2 (gnutls_pubkey_t key, gnutls_x509_crt_fmt_t format, gnutls_datum_t* out_);
187     int gnutls_pubkey_get_key_id (gnutls_pubkey_t key, uint flags, ubyte* output_data, size_t* output_data_size);
188     int gnutls_pubkey_get_openpgp_key_id (gnutls_pubkey_t key, uint flags, ubyte* output_data, size_t* output_data_size, uint* subkey);
189     int gnutls_pubkey_get_key_usage (gnutls_pubkey_t key, uint* usage);
190     int gnutls_pubkey_set_key_usage (gnutls_pubkey_t key, uint usage);
191     int gnutls_pubkey_import (gnutls_pubkey_t key, const(gnutls_datum_t)* data, gnutls_x509_crt_fmt_t format);
192     int gnutls_pubkey_import_dsa_raw (gnutls_pubkey_t key, const(gnutls_datum_t)* p, const(gnutls_datum_t)* q, const(gnutls_datum_t)* g, const(gnutls_datum_t)* y);
193     int gnutls_pubkey_import_rsa_raw (gnutls_pubkey_t key, const(gnutls_datum_t)* m, const(gnutls_datum_t)* e);
194     int gnutls_pubkey_import_ecc_x962 (gnutls_pubkey_t key, const(gnutls_datum_t)* parameters, const(gnutls_datum_t)* ecpoint);
195     int gnutls_pubkey_import_ecc_raw (gnutls_pubkey_t key, gnutls_ecc_curve_t curve, const(gnutls_datum_t)* x, const(gnutls_datum_t)* y);
196 
197     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
198         int gnutls_pubkey_import_gost_raw (gnutls_pubkey_t key, gnutls_ecc_curve_t curve, gnutls_digest_algorithm_t digest, gnutls_gost_paramset_t paramset, const(gnutls_datum_t)* x, const(gnutls_datum_t)* y);
199 
200     int gnutls_pubkey_encrypt_data (gnutls_pubkey_t key, uint flags, const(gnutls_datum_t)* plaintext, gnutls_datum_t* ciphertext);
201     int gnutls_x509_crt_set_pubkey (gnutls_x509_crt_t crt, gnutls_pubkey_t key);
202     int gnutls_x509_crq_set_pubkey (gnutls_x509_crq_t crq, gnutls_pubkey_t key);
203     int gnutls_pubkey_verify_hash2 (gnutls_pubkey_t key, gnutls_sign_algorithm_t algo, uint flags, const(gnutls_datum_t)* hash, const(gnutls_datum_t)* signature);
204     int gnutls_pubkey_verify_data2 (gnutls_pubkey_t pubkey, gnutls_sign_algorithm_t algo, uint flags, const(gnutls_datum_t)* data, const(gnutls_datum_t)* signature);
205     int gnutls_privkey_init (gnutls_privkey_t* key);
206     void gnutls_privkey_deinit (gnutls_privkey_t key);
207     int gnutls_privkey_generate (gnutls_privkey_t key, gnutls_pk_algorithm_t algo, uint bits, uint flags);
208     int gnutls_privkey_generate2 (gnutls_privkey_t pkey, gnutls_pk_algorithm_t algo, uint bits, uint flags, const(gnutls_keygen_data_st)* data, uint data_size);
209 
210     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
211     {
212         int gnutls_privkey_set_spki (gnutls_privkey_t key, const gnutls_x509_spki_t spki, uint flags);
213         int gnutls_privkey_get_spki (gnutls_privkey_t key, const gnutls_x509_spki_t spki, uint flags);
214     }
215 
216     int gnutls_privkey_verify_seed (gnutls_privkey_t key, gnutls_digest_algorithm_t, const(void)* seed, size_t seed_size);
217     int gnutls_privkey_get_seed (gnutls_privkey_t key, gnutls_digest_algorithm_t*, void* seed, size_t* seed_size);
218     int gnutls_privkey_verify_params (gnutls_privkey_t key);
219     void gnutls_privkey_set_flags (gnutls_privkey_t key, uint flags);
220     void gnutls_privkey_set_pin_function (gnutls_privkey_t key, gnutls_pin_callback_t fn, void* userdata);
221     int gnutls_privkey_get_pk_algorithm (gnutls_privkey_t key, uint* bits);
222     gnutls_privkey_type_t gnutls_privkey_get_type (gnutls_privkey_t key);
223     int gnutls_privkey_status (gnutls_privkey_t key);
224     int gnutls_privkey_import_pkcs11 (gnutls_privkey_t pkey, gnutls_pkcs11_privkey_t key, uint flags);
225     int gnutls_privkey_import_x509 (gnutls_privkey_t pkey, gnutls_x509_privkey_t key, uint flags);
226     int gnutls_privkey_import_openpgp (gnutls_privkey_t pkey, gnutls_openpgp_privkey_t key, uint flags);
227     int gnutls_privkey_export_x509 (gnutls_privkey_t pkey, gnutls_x509_privkey_t* key);
228     int gnutls_privkey_export_openpgp (gnutls_privkey_t pkey, gnutls_openpgp_privkey_t* key);
229     int gnutls_privkey_export_pkcs11 (gnutls_privkey_t pkey, gnutls_pkcs11_privkey_t* key);
230     int gnutls_privkey_import_openpgp_raw (gnutls_privkey_t pkey, const(gnutls_datum_t)* data, gnutls_openpgp_crt_fmt_t format, const gnutls_openpgp_keyid_t keyid, const(char)* password);
231     int gnutls_privkey_import_x509_raw (gnutls_privkey_t pkey, const(gnutls_datum_t)* data, gnutls_x509_crt_fmt_t format, const(char)* password, uint flags);
232     int gnutls_privkey_import_tpm_raw (gnutls_privkey_t pkey, const(gnutls_datum_t)* fdata, gnutls_tpmkey_fmt_t format, const(char)* srk_password, const(char)* key_password, uint flags);
233     int gnutls_privkey_import_tpm_url (gnutls_privkey_t pkey, const(char)* url, const(char)* srk_password, const(char)* key_password, uint flags);
234     int gnutls_privkey_import_url (gnutls_privkey_t key, const(char)* url, uint flags);
235     int gnutls_privkey_import_ext (gnutls_privkey_t pkey, gnutls_pk_algorithm_t pk, void* userdata, gnutls_privkey_sign_func sign_func, gnutls_privkey_decrypt_func decrypt_func, uint flags);
236     int gnutls_privkey_import_ext2 (gnutls_privkey_t pkey, gnutls_pk_algorithm_t pk, void* userdata, gnutls_privkey_sign_func sign_func, gnutls_privkey_decrypt_func decrypt_func, gnutls_privkey_deinit_func deinit_func, uint flags);
237     int gnutls_privkey_import_ext3 (gnutls_privkey_t pkey, void* userdata, gnutls_privkey_sign_func sign_func, gnutls_privkey_decrypt_func decrypt_func, gnutls_privkey_deinit_func deinit_func, gnutls_privkey_info_func info_func, uint flags);
238 
239     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
240         int gnutls_privkey_import_ext4 (gnutls_privkey_t pkey, void* userdata, gnutls_privkey_sign_data_func sign_data_func, gnutls_privkey_sign_hash_func sign_hash_func, gnutls_privkey_decrypt_func decrypt_func, gnutls_privkey_deinit_func deinit_func, gnutls_privkey_info_func info_func, uint flags);
241 
242     int gnutls_privkey_import_dsa_raw (gnutls_privkey_t key, const(gnutls_datum_t)* p, const(gnutls_datum_t)* q, const(gnutls_datum_t)* g, const(gnutls_datum_t)* y, const(gnutls_datum_t)* x);
243     int gnutls_privkey_import_rsa_raw (gnutls_privkey_t key, const(gnutls_datum_t)* m, const(gnutls_datum_t)* e, const(gnutls_datum_t)* d, const(gnutls_datum_t)* p, const(gnutls_datum_t)* q, const(gnutls_datum_t)* u, const(gnutls_datum_t)* e1, const(gnutls_datum_t)* e2);
244     int gnutls_privkey_import_ecc_raw (gnutls_privkey_t key, gnutls_ecc_curve_t curve, const(gnutls_datum_t)* x, const(gnutls_datum_t)* y, const(gnutls_datum_t)* k);
245 
246     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
247         int gnutls_privkey_import_gost_raw (gnutls_privkey_t key, gnutls_ecc_curve_t curve, gnutls_digest_algorithm_t digest, gnutls_gost_paramset_t paramset, const(gnutls_datum_t)* x, const(gnutls_datum_t)* y, const(gnutls_datum_t)* k);
248 
249     int gnutls_privkey_sign_data (gnutls_privkey_t signer, gnutls_digest_algorithm_t hash, uint flags, const(gnutls_datum_t)* data, gnutls_datum_t* signature);
250     int gnutls_privkey_sign_data2 (gnutls_privkey_t signer, gnutls_sign_algorithm_t algo, uint flags, const(gnutls_datum_t)* data, gnutls_datum_t* signature);
251     int gnutls_privkey_sign_hash (gnutls_privkey_t signer, gnutls_digest_algorithm_t hash_algo, uint flags, const(gnutls_datum_t)* hash_data, gnutls_datum_t* signature);
252     int gnutls_privkey_sign_hash2 (gnutls_privkey_t signer, gnutls_sign_algorithm_t algo, uint flags, const(gnutls_datum_t)* hash_data, gnutls_datum_t* signature);
253     int gnutls_privkey_decrypt_data (gnutls_privkey_t key, uint flags, const(gnutls_datum_t)* ciphertext, gnutls_datum_t* plaintext);
254 
255     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_5)
256         int gnutls_privkey_decrypt_data2 (gnutls_privkey_t key, uint flags, const(gnutls_datum_t)* ciphertext, ubyte* plaintext, size_t plaintext_size);
257 
258     int gnutls_privkey_export_rsa_raw (gnutls_privkey_t key, gnutls_datum_t* m, gnutls_datum_t* e, gnutls_datum_t* d, gnutls_datum_t* p, gnutls_datum_t* q, gnutls_datum_t* u, gnutls_datum_t* e1, gnutls_datum_t* e2);
259     int gnutls_privkey_export_dsa_raw (gnutls_privkey_t key, gnutls_datum_t* p, gnutls_datum_t* q, gnutls_datum_t* g, gnutls_datum_t* y, gnutls_datum_t* x);
260     int gnutls_privkey_export_ecc_raw (gnutls_privkey_t key, gnutls_ecc_curve_t* curve, gnutls_datum_t* x, gnutls_datum_t* y, gnutls_datum_t* k);
261 
262     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
263     {
264         int gnutls_privkey_export_rsa_raw2 (gnutls_privkey_t key, gnutls_datum_t* m, gnutls_datum_t* e, gnutls_datum_t* d, gnutls_datum_t* p, gnutls_datum_t* q, gnutls_datum_t* u, gnutls_datum_t* e1, gnutls_datum_t* e2, uint flags);
265         int gnutls_privkey_export_dsa_raw2 (gnutls_privkey_t key, gnutls_datum_t* p, gnutls_datum_t* q, gnutls_datum_t* g, gnutls_datum_t* y, gnutls_datum_t* x, uint flags);
266         int gnutls_privkey_export_ecc_raw2 (gnutls_privkey_t key, gnutls_ecc_curve_t* curve, gnutls_datum_t* x, gnutls_datum_t* y, gnutls_datum_t* k, uint flags);
267     }
268 
269     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
270         int gnutls_privkey_export_gost_raw2 (gnutls_privkey_t key, gnutls_ecc_curve_t* curve, gnutls_digest_algorithm_t* digest, gnutls_gost_paramset_t* paramset, gnutls_datum_t* x, gnutls_datum_t* y, gnutls_datum_t* k, uint flags);
271 
272     int gnutls_x509_crt_privkey_sign (gnutls_x509_crt_t crt, gnutls_x509_crt_t issuer, gnutls_privkey_t issuer_key, gnutls_digest_algorithm_t dig, uint flags);
273     int gnutls_x509_crl_privkey_sign (gnutls_x509_crl_t crl, gnutls_x509_crt_t issuer, gnutls_privkey_t issuer_key, gnutls_digest_algorithm_t dig, uint flags);
274     int gnutls_x509_crq_privkey_sign (gnutls_x509_crq_t crq, gnutls_privkey_t key, gnutls_digest_algorithm_t dig, uint flags);
275     int gnutls_pcert_import_x509 (gnutls_pcert_st* pcert, gnutls_x509_crt_t crt, uint flags);
276     int gnutls_pcert_import_x509_list (gnutls_pcert_st* pcert, gnutls_x509_crt_t* crt, uint* ncrt, uint flags);
277     int gnutls_pcert_export_x509 (gnutls_pcert_st* pcert, gnutls_x509_crt_t* crt);
278     int gnutls_pcert_list_import_x509_raw (gnutls_pcert_st* pcerts, uint* pcert_max, const(gnutls_datum_t)* data, gnutls_x509_crt_fmt_t format, uint flags);
279 
280     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
281         int gnutls_pcert_list_import_x509_file (gnutls_pcert_st* pcert_list, uint* pcert_list_size, const(char)* file, gnutls_x509_crt_fmt_t format, gnutls_pin_callback_t pin_fn, void* pin_fn_userdata, uint flags);
282 
283     int gnutls_pcert_import_x509_raw (gnutls_pcert_st* pcert, const(gnutls_datum_t)* cert, gnutls_x509_crt_fmt_t format, uint flags);
284     int gnutls_pcert_import_openpgp_raw (gnutls_pcert_st* pcert, const(gnutls_datum_t)* cert, gnutls_openpgp_crt_fmt_t format, gnutls_openpgp_keyid_t keyid, uint flags);
285     int gnutls_pcert_import_openpgp (gnutls_pcert_st* pcert, gnutls_openpgp_crt_t crt, uint flags);
286     int gnutls_pcert_export_openpgp (gnutls_pcert_st* pcert, gnutls_openpgp_crt_t* crt);
287     void gnutls_pcert_deinit (gnutls_pcert_st* pcert);
288     int gnutls_pcert_import_rawpk (gnutls_pcert_st* pcert, gnutls_pubkey_t key, uint flags);
289     int gnutls_pcert_import_rawpk_raw (gnutls_pcert_st* pcert, const(gnutls_datum_t)* rawpubkey, gnutls_x509_crt_fmt_t format, uint key_usage, uint flags);
290     void gnutls_certificate_set_retrieve_function2 (gnutls_certificate_credentials_t cred, int function () func);
291 
292     static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
293         void gnutls_certificate_set_retrieve_function3 (gnutls_certificate_credentials_t cred, int function () func);
294 
295     int gnutls_certificate_set_key (gnutls_certificate_credentials_t res, const(char*)* names, int names_size, gnutls_pcert_st* pcert_list, int pcert_list_size, gnutls_privkey_t key);
296     int gnutls_pubkey_print (gnutls_pubkey_t pubkey, gnutls_certificate_print_formats_t format, gnutls_datum_t* out_);
297 }
298 else
299 {
300     extern (System) @nogc nothrow @system
301     {
302         alias pgnutls_pubkey_init = int function (gnutls_pubkey_t* key);
303         alias pgnutls_pubkey_deinit = void function (gnutls_pubkey_t key);
304         alias pgnutls_pubkey_verify_params = int function (gnutls_pubkey_t key);
305         alias pgnutls_pubkey_set_pin_function = void function (gnutls_pubkey_t key, gnutls_pin_callback_t fn, void* userdata);
306         alias pgnutls_pubkey_get_pk_algorithm = int function (gnutls_pubkey_t key, uint* bits);
307 
308         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
309         {
310             alias pgnutls_pubkey_set_spki = int function (gnutls_pubkey_t key, const gnutls_x509_spki_t spki, uint flags);
311             alias pgnutls_pubkey_get_spki = int function (gnutls_pubkey_t key, const gnutls_x509_spki_t spki, uint flags);
312         }
313 
314         alias pgnutls_pubkey_import_x509 = int function (gnutls_pubkey_t key, gnutls_x509_crt_t crt, uint flags);
315         alias pgnutls_pubkey_import_x509_crq = int function (gnutls_pubkey_t key, gnutls_x509_crq_t crq, uint flags);
316         alias pgnutls_pubkey_import_pkcs11 = int function (gnutls_pubkey_t key, gnutls_pkcs11_obj_t obj, uint flags);
317         alias pgnutls_pubkey_import_openpgp = int function (gnutls_pubkey_t key, gnutls_openpgp_crt_t crt, uint flags);
318         alias pgnutls_pubkey_import_openpgp_raw = int function (gnutls_pubkey_t pkey, const(gnutls_datum_t)* data, gnutls_openpgp_crt_fmt_t format, const gnutls_openpgp_keyid_t keyid, uint flags);
319         alias pgnutls_pubkey_import_x509_raw = int function (gnutls_pubkey_t pkey, const(gnutls_datum_t)* data, gnutls_x509_crt_fmt_t format, uint flags);
320         alias pgnutls_pubkey_import_privkey = int function (gnutls_pubkey_t key, gnutls_privkey_t pkey, uint usage, uint flags);
321         alias pgnutls_pubkey_import_tpm_url = int function (gnutls_pubkey_t pkey, const(char)* url, const(char)* srk_password, uint flags);
322         alias pgnutls_pubkey_import_url = int function (gnutls_pubkey_t key, const(char)* url, uint flags);
323         alias pgnutls_pubkey_import_tpm_raw = int function (gnutls_pubkey_t pkey, const(gnutls_datum_t)* fdata, gnutls_tpmkey_fmt_t format, const(char)* srk_password, uint flags);
324         alias pgnutls_pubkey_get_preferred_hash_algorithm = int function (gnutls_pubkey_t key, gnutls_digest_algorithm_t* hash, uint* mand);
325         alias pgnutls_pubkey_export_rsa_raw = int function (gnutls_pubkey_t key, gnutls_datum_t* m, gnutls_datum_t* e);
326         alias pgnutls_pubkey_export_dsa_raw = int function (gnutls_pubkey_t key, gnutls_datum_t* p, gnutls_datum_t* q, gnutls_datum_t* g, gnutls_datum_t* y);
327 
328         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
329         {
330             alias pgnutls_pubkey_export_rsa_raw2 = int function (gnutls_pubkey_t key, gnutls_datum_t* m, gnutls_datum_t* e, uint flags);
331             alias pgnutls_pubkey_export_dsa_raw2 = int function (gnutls_pubkey_t key, gnutls_datum_t* p, gnutls_datum_t* q, gnutls_datum_t* g, gnutls_datum_t* y, uint flags);
332             alias pgnutls_pubkey_export_ecc_raw2 = int function (gnutls_pubkey_t key, gnutls_ecc_curve_t* curve, gnutls_datum_t* x, gnutls_datum_t* y, uint flags);
333         }
334 
335         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
336             alias pgnutls_pubkey_export_gost_raw2 = int function (gnutls_pubkey_t key, gnutls_ecc_curve_t* curve, gnutls_digest_algorithm_t* digest, gnutls_gost_paramset_t* paramset, gnutls_datum_t* x, gnutls_datum_t* y, uint flags);
337 
338         alias pgnutls_pubkey_export_ecc_raw = int function (gnutls_pubkey_t key, gnutls_ecc_curve_t* curve, gnutls_datum_t* x, gnutls_datum_t* y);
339         alias pgnutls_pubkey_export_ecc_x962 = int function (gnutls_pubkey_t key, gnutls_datum_t* parameters, gnutls_datum_t* ecpoint);
340         alias pgnutls_pubkey_export = int function (gnutls_pubkey_t key, gnutls_x509_crt_fmt_t format, void* output_data, size_t* output_data_size);
341         alias pgnutls_pubkey_export2 = int function (gnutls_pubkey_t key, gnutls_x509_crt_fmt_t format, gnutls_datum_t* out_);
342         alias pgnutls_pubkey_get_key_id = int function (gnutls_pubkey_t key, uint flags, ubyte* output_data, size_t* output_data_size);
343         alias pgnutls_pubkey_get_openpgp_key_id = int function (gnutls_pubkey_t key, uint flags, ubyte* output_data, size_t* output_data_size, uint* subkey);
344         alias pgnutls_pubkey_get_key_usage = int function (gnutls_pubkey_t key, uint* usage);
345         alias pgnutls_pubkey_set_key_usage = int function (gnutls_pubkey_t key, uint usage);
346         alias pgnutls_pubkey_import = int function (gnutls_pubkey_t key, const(gnutls_datum_t)* data, gnutls_x509_crt_fmt_t format);
347         alias pgnutls_pubkey_import_dsa_raw = int function (gnutls_pubkey_t key, const(gnutls_datum_t)* p, const(gnutls_datum_t)* q, const(gnutls_datum_t)* g, const(gnutls_datum_t)* y);
348         alias pgnutls_pubkey_import_rsa_raw = int function (gnutls_pubkey_t key, const(gnutls_datum_t)* m, const(gnutls_datum_t)* e);
349         alias pgnutls_pubkey_import_ecc_x962 = int function (gnutls_pubkey_t key, const(gnutls_datum_t)* parameters, const(gnutls_datum_t)* ecpoint);
350         alias pgnutls_pubkey_import_ecc_raw = int function (gnutls_pubkey_t key, gnutls_ecc_curve_t curve, const(gnutls_datum_t)* x, const(gnutls_datum_t)* y);
351 
352         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
353             alias pgnutls_pubkey_import_gost_raw = int function (gnutls_pubkey_t key, gnutls_ecc_curve_t curve, gnutls_digest_algorithm_t digest, gnutls_gost_paramset_t paramset, const(gnutls_datum_t)* x, const(gnutls_datum_t)* y);
354 
355         alias pgnutls_pubkey_encrypt_data = int function (gnutls_pubkey_t key, uint flags, const(gnutls_datum_t)* plaintext, gnutls_datum_t* ciphertext);
356         alias pgnutls_x509_crt_set_pubkey = int function (gnutls_x509_crt_t crt, gnutls_pubkey_t key);
357         alias pgnutls_x509_crq_set_pubkey = int function (gnutls_x509_crq_t crq, gnutls_pubkey_t key);
358         alias pgnutls_pubkey_verify_hash2 = int function (gnutls_pubkey_t key, gnutls_sign_algorithm_t algo, uint flags, const(gnutls_datum_t)* hash, const(gnutls_datum_t)* signature);
359         alias pgnutls_pubkey_verify_data2 = int function (gnutls_pubkey_t pubkey, gnutls_sign_algorithm_t algo, uint flags, const(gnutls_datum_t)* data, const(gnutls_datum_t)* signature);
360         alias pgnutls_privkey_init = int function (gnutls_privkey_t* key);
361         alias pgnutls_privkey_deinit = void function (gnutls_privkey_t key);
362         alias pgnutls_privkey_generate = int function (gnutls_privkey_t key, gnutls_pk_algorithm_t algo, uint bits, uint flags);
363         alias pgnutls_privkey_generate2 = int function (gnutls_privkey_t pkey, gnutls_pk_algorithm_t algo, uint bits, uint flags, const(gnutls_keygen_data_st)* data, uint data_size);
364 
365         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
366         {
367             alias pgnutls_privkey_set_spki = int function (gnutls_privkey_t key, const gnutls_x509_spki_t spki, uint flags);
368             alias pgnutls_privkey_get_spki = int function (gnutls_privkey_t key, const gnutls_x509_spki_t spki, uint flags);
369         }
370 
371         alias pgnutls_privkey_verify_seed = int function (gnutls_privkey_t key, gnutls_digest_algorithm_t, const(void)* seed, size_t seed_size);
372         alias pgnutls_privkey_get_seed = int function (gnutls_privkey_t key, gnutls_digest_algorithm_t*, void* seed, size_t* seed_size);
373         alias pgnutls_privkey_verify_params = int function (gnutls_privkey_t key);
374         alias pgnutls_privkey_set_flags = void function (gnutls_privkey_t key, uint flags);
375         alias pgnutls_privkey_set_pin_function = void function (gnutls_privkey_t key, gnutls_pin_callback_t fn, void* userdata);
376         alias pgnutls_privkey_get_pk_algorithm = int function (gnutls_privkey_t key, uint* bits);
377         alias pgnutls_privkey_get_type = gnutls_privkey_type_t function (gnutls_privkey_t key);
378         alias pgnutls_privkey_status = int function (gnutls_privkey_t key);
379         alias pgnutls_privkey_import_pkcs11 = int function (gnutls_privkey_t pkey, gnutls_pkcs11_privkey_t key, uint flags);
380         alias pgnutls_privkey_import_x509 = int function (gnutls_privkey_t pkey, gnutls_x509_privkey_t key, uint flags);
381         alias pgnutls_privkey_import_openpgp = int function (gnutls_privkey_t pkey, gnutls_openpgp_privkey_t key, uint flags);
382         alias pgnutls_privkey_export_x509 = int function (gnutls_privkey_t pkey, gnutls_x509_privkey_t* key);
383         alias pgnutls_privkey_export_openpgp = int function (gnutls_privkey_t pkey, gnutls_openpgp_privkey_t* key);
384         alias pgnutls_privkey_export_pkcs11 = int function (gnutls_privkey_t pkey, gnutls_pkcs11_privkey_t* key);
385         alias pgnutls_privkey_import_openpgp_raw = int function (gnutls_privkey_t pkey, const(gnutls_datum_t)* data, gnutls_openpgp_crt_fmt_t format, const gnutls_openpgp_keyid_t keyid, const(char)* password);
386         alias pgnutls_privkey_import_x509_raw = int function (gnutls_privkey_t pkey, const(gnutls_datum_t)* data, gnutls_x509_crt_fmt_t format, const(char)* password, uint flags);
387         alias pgnutls_privkey_import_tpm_raw = int function (gnutls_privkey_t pkey, const(gnutls_datum_t)* fdata, gnutls_tpmkey_fmt_t format, const(char)* srk_password, const(char)* key_password, uint flags);
388         alias pgnutls_privkey_import_tpm_url = int function (gnutls_privkey_t pkey, const(char)* url, const(char)* srk_password, const(char)* key_password, uint flags);
389         alias pgnutls_privkey_import_url = int function (gnutls_privkey_t key, const(char)* url, uint flags);
390         alias pgnutls_privkey_import_ext = int function (gnutls_privkey_t pkey, gnutls_pk_algorithm_t pk, void* userdata, gnutls_privkey_sign_func sign_func, gnutls_privkey_decrypt_func decrypt_func, uint flags);
391         alias pgnutls_privkey_import_ext2 = int function (gnutls_privkey_t pkey, gnutls_pk_algorithm_t pk, void* userdata, gnutls_privkey_sign_func sign_func, gnutls_privkey_decrypt_func decrypt_func, gnutls_privkey_deinit_func deinit_func, uint flags);
392         alias pgnutls_privkey_import_ext3 = int function (gnutls_privkey_t pkey, void* userdata, gnutls_privkey_sign_func sign_func, gnutls_privkey_decrypt_func decrypt_func, gnutls_privkey_deinit_func deinit_func, gnutls_privkey_info_func info_func, uint flags);
393 
394         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
395             alias pgnutls_privkey_import_ext4 = int function (gnutls_privkey_t pkey, void* userdata, gnutls_privkey_sign_data_func sign_data_func, gnutls_privkey_sign_hash_func sign_hash_func, gnutls_privkey_decrypt_func decrypt_func, gnutls_privkey_deinit_func deinit_func, gnutls_privkey_info_func info_func, uint flags);
396 
397         alias pgnutls_privkey_import_dsa_raw = int function (gnutls_privkey_t key, const(gnutls_datum_t)* p, const(gnutls_datum_t)* q, const(gnutls_datum_t)* g, const(gnutls_datum_t)* y, const(gnutls_datum_t)* x);
398         alias pgnutls_privkey_import_rsa_raw = int function (gnutls_privkey_t key, const(gnutls_datum_t)* m, const(gnutls_datum_t)* e, const(gnutls_datum_t)* d, const(gnutls_datum_t)* p, const(gnutls_datum_t)* q, const(gnutls_datum_t)* u, const(gnutls_datum_t)* e1, const(gnutls_datum_t)* e2);
399         alias pgnutls_privkey_import_ecc_raw = int function (gnutls_privkey_t key, gnutls_ecc_curve_t curve, const(gnutls_datum_t)* x, const(gnutls_datum_t)* y, const(gnutls_datum_t)* k);
400 
401         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
402             alias pgnutls_privkey_import_gost_raw = int function (gnutls_privkey_t key, gnutls_ecc_curve_t curve, gnutls_digest_algorithm_t digest, gnutls_gost_paramset_t paramset, const(gnutls_datum_t)* x, const(gnutls_datum_t)* y, const(gnutls_datum_t)* k);
403 
404         alias pgnutls_privkey_sign_data = int function (gnutls_privkey_t signer, gnutls_digest_algorithm_t hash, uint flags, const(gnutls_datum_t)* data, gnutls_datum_t* signature);
405         alias pgnutls_privkey_sign_data2 = int function (gnutls_privkey_t signer, gnutls_sign_algorithm_t algo, uint flags, const(gnutls_datum_t)* data, gnutls_datum_t* signature);
406         alias pgnutls_privkey_sign_hash = int function (gnutls_privkey_t signer, gnutls_digest_algorithm_t hash_algo, uint flags, const(gnutls_datum_t)* hash_data, gnutls_datum_t* signature);
407         alias pgnutls_privkey_sign_hash2 = int function (gnutls_privkey_t signer, gnutls_sign_algorithm_t algo, uint flags, const(gnutls_datum_t)* hash_data, gnutls_datum_t* signature);
408         alias pgnutls_privkey_decrypt_data = int function (gnutls_privkey_t key, uint flags, const(gnutls_datum_t)* ciphertext, gnutls_datum_t* plaintext);
409 
410         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_5)
411             alias pgnutls_privkey_decrypt_data2 = int function (gnutls_privkey_t key, uint flags, const(gnutls_datum_t)* ciphertext, ubyte* plaintext, size_t plaintext_size);
412 
413         alias pgnutls_privkey_export_rsa_raw = int function (gnutls_privkey_t key, gnutls_datum_t* m, gnutls_datum_t* e, gnutls_datum_t* d, gnutls_datum_t* p, gnutls_datum_t* q, gnutls_datum_t* u, gnutls_datum_t* e1, gnutls_datum_t* e2);
414         alias pgnutls_privkey_export_dsa_raw = int function (gnutls_privkey_t key, gnutls_datum_t* p, gnutls_datum_t* q, gnutls_datum_t* g, gnutls_datum_t* y, gnutls_datum_t* x);
415         alias pgnutls_privkey_export_ecc_raw = int function (gnutls_privkey_t key, gnutls_ecc_curve_t* curve, gnutls_datum_t* x, gnutls_datum_t* y, gnutls_datum_t* k);
416 
417         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
418         {
419             alias pgnutls_privkey_export_rsa_raw2 = int function (gnutls_privkey_t key, gnutls_datum_t* m, gnutls_datum_t* e, gnutls_datum_t* d, gnutls_datum_t* p, gnutls_datum_t* q, gnutls_datum_t* u, gnutls_datum_t* e1, gnutls_datum_t* e2, uint flags);
420             alias pgnutls_privkey_export_dsa_raw2 = int function (gnutls_privkey_t key, gnutls_datum_t* p, gnutls_datum_t* q, gnutls_datum_t* g, gnutls_datum_t* y, gnutls_datum_t* x, uint flags);
421             alias pgnutls_privkey_export_ecc_raw2 = int function (gnutls_privkey_t key, gnutls_ecc_curve_t* curve, gnutls_datum_t* x, gnutls_datum_t* y, gnutls_datum_t* k, uint flags);
422         }
423 
424         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
425             alias pgnutls_privkey_export_gost_raw2 = int function (gnutls_privkey_t key, gnutls_ecc_curve_t* curve, gnutls_digest_algorithm_t* digest, gnutls_gost_paramset_t* paramset, gnutls_datum_t* x, gnutls_datum_t* y, gnutls_datum_t* k, uint flags);
426 
427         alias pgnutls_x509_crt_privkey_sign = int function (gnutls_x509_crt_t crt, gnutls_x509_crt_t issuer, gnutls_privkey_t issuer_key, gnutls_digest_algorithm_t dig, uint flags);
428         alias pgnutls_x509_crl_privkey_sign = int function (gnutls_x509_crl_t crl, gnutls_x509_crt_t issuer, gnutls_privkey_t issuer_key, gnutls_digest_algorithm_t dig, uint flags);
429         alias pgnutls_x509_crq_privkey_sign = int function (gnutls_x509_crq_t crq, gnutls_privkey_t key, gnutls_digest_algorithm_t dig, uint flags);
430         alias pgnutls_pcert_import_x509 = int function (gnutls_pcert_st* pcert, gnutls_x509_crt_t crt, uint flags);
431         alias pgnutls_pcert_import_x509_list = int function (gnutls_pcert_st* pcert, gnutls_x509_crt_t* crt, uint* ncrt, uint flags);
432         alias pgnutls_pcert_export_x509 = int function (gnutls_pcert_st* pcert, gnutls_x509_crt_t* crt);
433         alias pgnutls_pcert_list_import_x509_raw = int function (gnutls_pcert_st* pcerts, uint* pcert_max, const(gnutls_datum_t)* data, gnutls_x509_crt_fmt_t format, uint flags);
434 
435         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
436             alias pgnutls_pcert_list_import_x509_file = int function (gnutls_pcert_st* pcert_list, uint* pcert_list_size, const(char)* file, gnutls_x509_crt_fmt_t format, gnutls_pin_callback_t pin_fn, void* pin_fn_userdata, uint flags);
437 
438         alias pgnutls_pcert_import_x509_raw = int function (gnutls_pcert_st* pcert, const(gnutls_datum_t)* cert, gnutls_x509_crt_fmt_t format, uint flags);
439         alias pgnutls_pcert_import_openpgp_raw = int function (gnutls_pcert_st* pcert, const(gnutls_datum_t)* cert, gnutls_openpgp_crt_fmt_t format, gnutls_openpgp_keyid_t keyid, uint flags);
440         alias pgnutls_pcert_import_openpgp = int function (gnutls_pcert_st* pcert, gnutls_openpgp_crt_t crt, uint flags);
441         alias pgnutls_pcert_export_openpgp = int function (gnutls_pcert_st* pcert, gnutls_openpgp_crt_t* crt);
442         alias pgnutls_pcert_deinit = void function (gnutls_pcert_st* pcert);
443         alias pgnutls_pcert_import_rawpk = int function (gnutls_pcert_st* pcert, gnutls_pubkey_t key, uint flags);
444         alias pgnutls_pcert_import_rawpk_raw = int function (gnutls_pcert_st* pcert, const(gnutls_datum_t)* rawpubkey, gnutls_x509_crt_fmt_t format, uint key_usage, uint flags);
445         alias pgnutls_certificate_set_retrieve_function2 = void function (gnutls_certificate_credentials_t cred, int function () func);
446 
447         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
448             alias pgnutls_certificate_set_retrieve_function3 = void function (gnutls_certificate_credentials_t cred, int function () func);
449 
450         alias pgnutls_certificate_set_key = int function (gnutls_certificate_credentials_t res, const(char*)* names, int names_size, gnutls_pcert_st* pcert_list, int pcert_list_size, gnutls_privkey_t key);
451         alias pgnutls_pubkey_print = int function (gnutls_pubkey_t pubkey, gnutls_certificate_print_formats_t format, gnutls_datum_t* out_);
452     }
453 
454     __gshared
455     {
456         pgnutls_pubkey_init gnutls_pubkey_init;
457         pgnutls_pubkey_deinit gnutls_pubkey_deinit;
458         pgnutls_pubkey_verify_params gnutls_pubkey_verify_params;
459         pgnutls_pubkey_set_pin_function gnutls_pubkey_set_pin_function;
460         pgnutls_pubkey_get_pk_algorithm gnutls_pubkey_get_pk_algorithm;
461 
462         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
463         {
464             pgnutls_pubkey_set_spki gnutls_pubkey_set_spki;
465             pgnutls_pubkey_get_spki gnutls_pubkey_get_spki;
466         }
467 
468         pgnutls_pubkey_import_x509 gnutls_pubkey_import_x509;
469         pgnutls_pubkey_import_x509_crq gnutls_pubkey_import_x509_crq;
470         pgnutls_pubkey_import_pkcs11 gnutls_pubkey_import_pkcs11;
471         pgnutls_pubkey_import_openpgp gnutls_pubkey_import_openpgp;
472         pgnutls_pubkey_import_openpgp_raw gnutls_pubkey_import_openpgp_raw;
473         pgnutls_pubkey_import_x509_raw gnutls_pubkey_import_x509_raw;
474         pgnutls_pubkey_import_privkey gnutls_pubkey_import_privkey;
475         pgnutls_pubkey_import_tpm_url gnutls_pubkey_import_tpm_url;
476         pgnutls_pubkey_import_url gnutls_pubkey_import_url;
477         pgnutls_pubkey_import_tpm_raw gnutls_pubkey_import_tpm_raw;
478         pgnutls_pubkey_get_preferred_hash_algorithm gnutls_pubkey_get_preferred_hash_algorithm;
479         pgnutls_pubkey_export_rsa_raw gnutls_pubkey_export_rsa_raw;
480         pgnutls_pubkey_export_dsa_raw gnutls_pubkey_export_dsa_raw;
481 
482         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
483         {
484             pgnutls_pubkey_export_rsa_raw2 gnutls_pubkey_export_rsa_raw2;
485             pgnutls_pubkey_export_dsa_raw2 gnutls_pubkey_export_dsa_raw2;
486             pgnutls_pubkey_export_ecc_raw2 gnutls_pubkey_export_ecc_raw2;
487         }
488 
489         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
490             pgnutls_pubkey_export_gost_raw2 gnutls_pubkey_export_gost_raw2;
491 
492         pgnutls_pubkey_export_ecc_raw gnutls_pubkey_export_ecc_raw;
493         pgnutls_pubkey_export_ecc_x962 gnutls_pubkey_export_ecc_x962;
494         pgnutls_pubkey_export gnutls_pubkey_export;
495         pgnutls_pubkey_export2 gnutls_pubkey_export2;
496         pgnutls_pubkey_get_key_id gnutls_pubkey_get_key_id;
497         pgnutls_pubkey_get_openpgp_key_id gnutls_pubkey_get_openpgp_key_id;
498         pgnutls_pubkey_get_key_usage gnutls_pubkey_get_key_usage;
499         pgnutls_pubkey_set_key_usage gnutls_pubkey_set_key_usage;
500         pgnutls_pubkey_import gnutls_pubkey_import;
501         pgnutls_pubkey_import_dsa_raw gnutls_pubkey_import_dsa_raw;
502         pgnutls_pubkey_import_rsa_raw gnutls_pubkey_import_rsa_raw;
503         pgnutls_pubkey_import_ecc_x962 gnutls_pubkey_import_ecc_x962;
504         pgnutls_pubkey_import_ecc_raw gnutls_pubkey_import_ecc_raw;
505 
506         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
507             pgnutls_pubkey_import_gost_raw gnutls_pubkey_import_gost_raw;
508 
509         pgnutls_pubkey_encrypt_data gnutls_pubkey_encrypt_data;
510         pgnutls_x509_crt_set_pubkey gnutls_x509_crt_set_pubkey;
511         pgnutls_x509_crq_set_pubkey gnutls_x509_crq_set_pubkey;
512         pgnutls_pubkey_verify_hash2 gnutls_pubkey_verify_hash2;
513         pgnutls_pubkey_verify_data2 gnutls_pubkey_verify_data2;
514         pgnutls_privkey_init gnutls_privkey_init;
515         pgnutls_privkey_deinit gnutls_privkey_deinit;
516         pgnutls_privkey_generate gnutls_privkey_generate;
517         pgnutls_privkey_generate2 gnutls_privkey_generate2;
518 
519         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
520         {
521             pgnutls_privkey_set_spki gnutls_privkey_set_spki;
522             pgnutls_privkey_get_spki gnutls_privkey_get_spki;
523         }
524 
525         pgnutls_privkey_verify_seed gnutls_privkey_verify_seed;
526         pgnutls_privkey_get_seed gnutls_privkey_get_seed;
527         pgnutls_privkey_verify_params gnutls_privkey_verify_params;
528         pgnutls_privkey_set_flags gnutls_privkey_set_flags;
529         pgnutls_privkey_set_pin_function gnutls_privkey_set_pin_function;
530         pgnutls_privkey_get_pk_algorithm gnutls_privkey_get_pk_algorithm;
531         pgnutls_privkey_get_type gnutls_privkey_get_type;
532         pgnutls_privkey_status gnutls_privkey_status;
533         pgnutls_privkey_import_pkcs11 gnutls_privkey_import_pkcs11;
534         pgnutls_privkey_import_x509 gnutls_privkey_import_x509;
535         pgnutls_privkey_import_openpgp gnutls_privkey_import_openpgp;
536         pgnutls_privkey_export_x509 gnutls_privkey_export_x509;
537         pgnutls_privkey_export_openpgp gnutls_privkey_export_openpgp;
538         pgnutls_privkey_export_pkcs11 gnutls_privkey_export_pkcs11;
539         pgnutls_privkey_import_openpgp_raw gnutls_privkey_import_openpgp_raw;
540         pgnutls_privkey_import_x509_raw gnutls_privkey_import_x509_raw;
541         pgnutls_privkey_import_tpm_raw gnutls_privkey_import_tpm_raw;
542         pgnutls_privkey_import_tpm_url gnutls_privkey_import_tpm_url;
543         pgnutls_privkey_import_url gnutls_privkey_import_url;
544         pgnutls_privkey_import_ext gnutls_privkey_import_ext;
545         pgnutls_privkey_import_ext2 gnutls_privkey_import_ext2;
546         pgnutls_privkey_import_ext3 gnutls_privkey_import_ext3;
547 
548         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
549             pgnutls_privkey_import_ext4 gnutls_privkey_import_ext4;
550 
551         pgnutls_privkey_import_dsa_raw gnutls_privkey_import_dsa_raw;
552         pgnutls_privkey_import_rsa_raw gnutls_privkey_import_rsa_raw;
553         pgnutls_privkey_import_ecc_raw gnutls_privkey_import_ecc_raw;
554 
555         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
556             pgnutls_privkey_import_gost_raw gnutls_privkey_import_gost_raw;
557 
558         pgnutls_privkey_sign_data gnutls_privkey_sign_data;
559         pgnutls_privkey_sign_data2 gnutls_privkey_sign_data2;
560         pgnutls_privkey_sign_hash gnutls_privkey_sign_hash;
561         pgnutls_privkey_sign_hash2 gnutls_privkey_sign_hash2;
562         pgnutls_privkey_decrypt_data gnutls_privkey_decrypt_data;
563 
564         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_5)
565             pgnutls_privkey_decrypt_data2 gnutls_privkey_decrypt_data2;
566 
567         pgnutls_privkey_export_rsa_raw gnutls_privkey_export_rsa_raw;
568         pgnutls_privkey_export_dsa_raw gnutls_privkey_export_dsa_raw;
569         pgnutls_privkey_export_ecc_raw gnutls_privkey_export_ecc_raw;
570 
571         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
572         {
573             pgnutls_privkey_export_rsa_raw2 gnutls_privkey_export_rsa_raw2;
574             pgnutls_privkey_export_dsa_raw2 gnutls_privkey_export_dsa_raw2;
575             pgnutls_privkey_export_ecc_raw2 gnutls_privkey_export_ecc_raw2;
576         }
577 
578         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
579             pgnutls_privkey_export_gost_raw2 gnutls_privkey_export_gost_raw2;
580 
581         pgnutls_x509_crt_privkey_sign gnutls_x509_crt_privkey_sign;
582         pgnutls_x509_crl_privkey_sign gnutls_x509_crl_privkey_sign;
583         pgnutls_x509_crq_privkey_sign gnutls_x509_crq_privkey_sign;
584         pgnutls_pcert_import_x509 gnutls_pcert_import_x509;
585         pgnutls_pcert_import_x509_list gnutls_pcert_import_x509_list;
586         pgnutls_pcert_export_x509 gnutls_pcert_export_x509;
587         pgnutls_pcert_list_import_x509_raw gnutls_pcert_list_import_x509_raw;
588 
589         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
590             pgnutls_pcert_list_import_x509_file gnutls_pcert_list_import_x509_file;
591 
592         pgnutls_pcert_import_x509_raw gnutls_pcert_import_x509_raw;
593         pgnutls_pcert_import_openpgp_raw gnutls_pcert_import_openpgp_raw;
594         pgnutls_pcert_import_openpgp gnutls_pcert_import_openpgp;
595         pgnutls_pcert_export_openpgp gnutls_pcert_export_openpgp;
596         pgnutls_pcert_deinit gnutls_pcert_deinit;
597         pgnutls_pcert_import_rawpk gnutls_pcert_import_rawpk;
598         pgnutls_pcert_import_rawpk_raw gnutls_pcert_import_rawpk_raw;
599         pgnutls_certificate_set_retrieve_function2 gnutls_certificate_set_retrieve_function2;
600 
601         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
602             pgnutls_certificate_set_retrieve_function3 gnutls_certificate_set_retrieve_function3;
603 
604         pgnutls_certificate_set_key gnutls_certificate_set_key;
605         pgnutls_pubkey_print gnutls_pubkey_print;
606     }
607 
608     import bindbc.loader : SharedLib, bindSymbol_stdcall;
609     void bindAbstract(SharedLib lib)
610     {
611         lib.bindSymbol_stdcall(gnutls_pubkey_init, "gnutls_pubkey_init");
612         lib.bindSymbol_stdcall(gnutls_pubkey_deinit, "gnutls_pubkey_deinit");
613         lib.bindSymbol_stdcall(gnutls_pubkey_verify_params, "gnutls_pubkey_verify_params");
614         lib.bindSymbol_stdcall(gnutls_pubkey_set_pin_function, "gnutls_pubkey_set_pin_function");
615         lib.bindSymbol_stdcall(gnutls_pubkey_get_pk_algorithm, "gnutls_pubkey_get_pk_algorithm");
616 
617         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
618         {
619             lib.bindSymbol_stdcall(gnutls_pubkey_set_spki, "gnutls_pubkey_set_spki");
620             lib.bindSymbol_stdcall(gnutls_pubkey_get_spki, "gnutls_pubkey_get_spki");
621         }
622 
623         lib.bindSymbol_stdcall(gnutls_pubkey_import_x509, "gnutls_pubkey_import_x509");
624         lib.bindSymbol_stdcall(gnutls_pubkey_import_x509_crq, "gnutls_pubkey_import_x509_crq");
625         lib.bindSymbol_stdcall(gnutls_pubkey_import_pkcs11, "gnutls_pubkey_import_pkcs11");
626         lib.bindSymbol_stdcall(gnutls_pubkey_import_openpgp, "gnutls_pubkey_import_openpgp");
627         lib.bindSymbol_stdcall(gnutls_pubkey_import_openpgp_raw, "gnutls_pubkey_import_openpgp_raw");
628         lib.bindSymbol_stdcall(gnutls_pubkey_import_x509_raw, "gnutls_pubkey_import_x509_raw");
629         lib.bindSymbol_stdcall(gnutls_pubkey_import_privkey, "gnutls_pubkey_import_privkey");
630         lib.bindSymbol_stdcall(gnutls_pubkey_import_tpm_url, "gnutls_pubkey_import_tpm_url");
631         lib.bindSymbol_stdcall(gnutls_pubkey_import_url, "gnutls_pubkey_import_url");
632         lib.bindSymbol_stdcall(gnutls_pubkey_import_tpm_raw, "gnutls_pubkey_import_tpm_raw");
633         lib.bindSymbol_stdcall(gnutls_pubkey_get_preferred_hash_algorithm, "gnutls_pubkey_get_preferred_hash_algorithm");
634         lib.bindSymbol_stdcall(gnutls_pubkey_export_rsa_raw, "gnutls_pubkey_export_rsa_raw");
635         lib.bindSymbol_stdcall(gnutls_pubkey_export_dsa_raw, "gnutls_pubkey_export_dsa_raw");
636 
637         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
638         {
639             lib.bindSymbol_stdcall(gnutls_pubkey_export_rsa_raw2, "gnutls_pubkey_export_rsa_raw2");
640             lib.bindSymbol_stdcall(gnutls_pubkey_export_dsa_raw2, "gnutls_pubkey_export_dsa_raw2");
641             lib.bindSymbol_stdcall(gnutls_pubkey_export_ecc_raw2, "gnutls_pubkey_export_ecc_raw2");
642         }
643 
644         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
645             lib.bindSymbol_stdcall(gnutls_pubkey_export_gost_raw2, "gnutls_pubkey_export_gost_raw2");
646 
647         lib.bindSymbol_stdcall(gnutls_pubkey_export_ecc_raw, "gnutls_pubkey_export_ecc_raw");
648         lib.bindSymbol_stdcall(gnutls_pubkey_export_ecc_x962, "gnutls_pubkey_export_ecc_x962");
649         lib.bindSymbol_stdcall(gnutls_pubkey_export, "gnutls_pubkey_export");
650         lib.bindSymbol_stdcall(gnutls_pubkey_export2, "gnutls_pubkey_export2");
651         lib.bindSymbol_stdcall(gnutls_pubkey_get_key_id, "gnutls_pubkey_get_key_id");
652         lib.bindSymbol_stdcall(gnutls_pubkey_get_openpgp_key_id, "gnutls_pubkey_get_openpgp_key_id");
653         lib.bindSymbol_stdcall(gnutls_pubkey_get_key_usage, "gnutls_pubkey_get_key_usage");
654         lib.bindSymbol_stdcall(gnutls_pubkey_set_key_usage, "gnutls_pubkey_set_key_usage");
655         lib.bindSymbol_stdcall(gnutls_pubkey_import, "gnutls_pubkey_import");
656         lib.bindSymbol_stdcall(gnutls_pubkey_import_dsa_raw, "gnutls_pubkey_import_dsa_raw");
657         lib.bindSymbol_stdcall(gnutls_pubkey_import_rsa_raw, "gnutls_pubkey_import_rsa_raw");
658         lib.bindSymbol_stdcall(gnutls_pubkey_import_ecc_x962, "gnutls_pubkey_import_ecc_x962");
659         lib.bindSymbol_stdcall(gnutls_pubkey_import_ecc_raw, "gnutls_pubkey_import_ecc_raw");
660 
661         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
662             lib.bindSymbol_stdcall(gnutls_pubkey_import_gost_raw, "gnutls_pubkey_import_gost_raw");
663 
664         lib.bindSymbol_stdcall(gnutls_pubkey_encrypt_data, "gnutls_pubkey_encrypt_data");
665         lib.bindSymbol_stdcall(gnutls_x509_crt_set_pubkey, "gnutls_x509_crt_set_pubkey");
666         lib.bindSymbol_stdcall(gnutls_x509_crq_set_pubkey, "gnutls_x509_crq_set_pubkey");
667         lib.bindSymbol_stdcall(gnutls_pubkey_verify_hash2, "gnutls_pubkey_verify_hash2");
668         lib.bindSymbol_stdcall(gnutls_pubkey_verify_data2, "gnutls_pubkey_verify_data2");
669         lib.bindSymbol_stdcall(gnutls_privkey_init, "gnutls_privkey_init");
670         lib.bindSymbol_stdcall(gnutls_privkey_deinit, "gnutls_privkey_deinit");
671         lib.bindSymbol_stdcall(gnutls_privkey_generate, "gnutls_privkey_generate");
672         lib.bindSymbol_stdcall(gnutls_privkey_generate2, "gnutls_privkey_generate2");
673 
674         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
675         {
676             lib.bindSymbol_stdcall(gnutls_privkey_set_spki, "gnutls_privkey_set_spki");
677             lib.bindSymbol_stdcall(gnutls_privkey_get_spki, "gnutls_privkey_get_spki");
678         }
679 
680         lib.bindSymbol_stdcall(gnutls_privkey_verify_seed, "gnutls_privkey_verify_seed");
681         lib.bindSymbol_stdcall(gnutls_privkey_get_seed, "gnutls_privkey_get_seed");
682         lib.bindSymbol_stdcall(gnutls_privkey_verify_params, "gnutls_privkey_verify_params");
683         lib.bindSymbol_stdcall(gnutls_privkey_set_flags, "gnutls_privkey_set_flags");
684         lib.bindSymbol_stdcall(gnutls_privkey_set_pin_function, "gnutls_privkey_set_pin_function");
685         lib.bindSymbol_stdcall(gnutls_privkey_get_pk_algorithm, "gnutls_privkey_get_pk_algorithm");
686         lib.bindSymbol_stdcall(gnutls_privkey_get_type, "gnutls_privkey_get_type");
687         lib.bindSymbol_stdcall(gnutls_privkey_status, "gnutls_privkey_status");
688         lib.bindSymbol_stdcall(gnutls_privkey_import_pkcs11, "gnutls_privkey_import_pkcs11");
689         lib.bindSymbol_stdcall(gnutls_privkey_import_x509, "gnutls_privkey_import_x509");
690         lib.bindSymbol_stdcall(gnutls_privkey_import_openpgp, "gnutls_privkey_import_openpgp");
691         lib.bindSymbol_stdcall(gnutls_privkey_export_x509, "gnutls_privkey_export_x509");
692         lib.bindSymbol_stdcall(gnutls_privkey_export_openpgp, "gnutls_privkey_export_openpgp");
693         lib.bindSymbol_stdcall(gnutls_privkey_export_pkcs11, "gnutls_privkey_export_pkcs11");
694         lib.bindSymbol_stdcall(gnutls_privkey_import_openpgp_raw, "gnutls_privkey_import_openpgp_raw");
695         lib.bindSymbol_stdcall(gnutls_privkey_import_x509_raw, "gnutls_privkey_import_x509_raw");
696         lib.bindSymbol_stdcall(gnutls_privkey_import_tpm_raw, "gnutls_privkey_import_tpm_raw");
697         lib.bindSymbol_stdcall(gnutls_privkey_import_tpm_url, "gnutls_privkey_import_tpm_url");
698         lib.bindSymbol_stdcall(gnutls_privkey_import_url, "gnutls_privkey_import_url");
699         lib.bindSymbol_stdcall(gnutls_privkey_import_ext, "gnutls_privkey_import_ext");
700         lib.bindSymbol_stdcall(gnutls_privkey_import_ext2, "gnutls_privkey_import_ext2");
701         lib.bindSymbol_stdcall(gnutls_privkey_import_ext3, "gnutls_privkey_import_ext3");
702 
703         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
704             lib.bindSymbol_stdcall(gnutls_privkey_import_ext4, "gnutls_privkey_import_ext4");
705 
706         lib.bindSymbol_stdcall(gnutls_privkey_import_dsa_raw, "gnutls_privkey_import_dsa_raw");
707         lib.bindSymbol_stdcall(gnutls_privkey_import_rsa_raw, "gnutls_privkey_import_rsa_raw");
708         lib.bindSymbol_stdcall(gnutls_privkey_import_ecc_raw, "gnutls_privkey_import_ecc_raw");
709 
710         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
711             lib.bindSymbol_stdcall(gnutls_privkey_import_gost_raw, "gnutls_privkey_import_gost_raw");
712 
713         lib.bindSymbol_stdcall(gnutls_privkey_sign_data, "gnutls_privkey_sign_data");
714         lib.bindSymbol_stdcall(gnutls_privkey_sign_data2, "gnutls_privkey_sign_data2");
715         lib.bindSymbol_stdcall(gnutls_privkey_sign_hash, "gnutls_privkey_sign_hash");
716         lib.bindSymbol_stdcall(gnutls_privkey_sign_hash2, "gnutls_privkey_sign_hash2");
717         lib.bindSymbol_stdcall(gnutls_privkey_decrypt_data, "gnutls_privkey_decrypt_data");
718 
719         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_5)
720             lib.bindSymbol_stdcall(gnutls_privkey_decrypt_data2, "gnutls_privkey_decrypt_data2");
721 
722         lib.bindSymbol_stdcall(gnutls_privkey_export_rsa_raw, "gnutls_privkey_export_rsa_raw");
723         lib.bindSymbol_stdcall(gnutls_privkey_export_dsa_raw, "gnutls_privkey_export_dsa_raw");
724         lib.bindSymbol_stdcall(gnutls_privkey_export_ecc_raw, "gnutls_privkey_export_ecc_raw");
725 
726         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_0)
727         {
728             lib.bindSymbol_stdcall(gnutls_privkey_export_rsa_raw2, "gnutls_privkey_export_rsa_raw2");
729             lib.bindSymbol_stdcall(gnutls_privkey_export_dsa_raw2, "gnutls_privkey_export_dsa_raw2");
730             lib.bindSymbol_stdcall(gnutls_privkey_export_ecc_raw2, "gnutls_privkey_export_ecc_raw2");
731         }
732 
733         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
734             lib.bindSymbol_stdcall(gnutls_privkey_export_gost_raw2, "gnutls_privkey_export_gost_raw2");
735 
736         lib.bindSymbol_stdcall(gnutls_x509_crt_privkey_sign, "gnutls_x509_crt_privkey_sign");
737         lib.bindSymbol_stdcall(gnutls_x509_crl_privkey_sign, "gnutls_x509_crl_privkey_sign");
738         lib.bindSymbol_stdcall(gnutls_x509_crq_privkey_sign, "gnutls_x509_crq_privkey_sign");
739         lib.bindSymbol_stdcall(gnutls_pcert_import_x509, "gnutls_pcert_import_x509");
740         lib.bindSymbol_stdcall(gnutls_pcert_import_x509_list, "gnutls_pcert_import_x509_list");
741         lib.bindSymbol_stdcall(gnutls_pcert_export_x509, "gnutls_pcert_export_x509");
742         lib.bindSymbol_stdcall(gnutls_pcert_list_import_x509_raw, "gnutls_pcert_list_import_x509_raw");
743 
744         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
745             lib.bindSymbol_stdcall(gnutls_pcert_list_import_x509_file, "gnutls_pcert_list_import_x509_file");
746 
747         lib.bindSymbol_stdcall(gnutls_pcert_import_x509_raw, "gnutls_pcert_import_x509_raw");
748         lib.bindSymbol_stdcall(gnutls_pcert_import_openpgp_raw, "gnutls_pcert_import_openpgp_raw");
749         lib.bindSymbol_stdcall(gnutls_pcert_import_openpgp, "gnutls_pcert_import_openpgp");
750         lib.bindSymbol_stdcall(gnutls_pcert_export_openpgp, "gnutls_pcert_export_openpgp");
751         lib.bindSymbol_stdcall(gnutls_pcert_deinit, "gnutls_pcert_deinit");
752         lib.bindSymbol_stdcall(gnutls_pcert_import_rawpk, "gnutls_pcert_import_rawpk");
753         lib.bindSymbol_stdcall(gnutls_pcert_import_rawpk_raw, "gnutls_pcert_import_rawpk_raw");
754         lib.bindSymbol_stdcall(gnutls_certificate_set_retrieve_function2, "gnutls_certificate_set_retrieve_function2");
755 
756         static if (gnuTLSSupport >= GnuTLSSupport.gnutls_3_6_3)
757             lib.bindSymbol_stdcall(gnutls_certificate_set_retrieve_function3, "gnutls_certificate_set_retrieve_function3");
758 
759         lib.bindSymbol_stdcall(gnutls_certificate_set_key, "gnutls_certificate_set_key");
760         lib.bindSymbol_stdcall(gnutls_pubkey_print, "gnutls_pubkey_print");
761     }
762 }