1 /* crypto/objects/objects.h */
2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59 module deimos.openssl.objects;
60
61 import deimos.openssl._d_util;
62
63 version = USE_OBJ_MAC;
64
65 version (USE_OBJ_MAC) {
66 public import deimos.openssl.obj_mac;
67 } else {
68 /+
69 enum SN_undef = "UNDEF";
70 enum LN_undef = "undefined";
71 enum NID_undef = 0;
72 enum OBJ_undef = "0L";
73
74 enum SN_Algorithm = "Algorithm";
75 enum LN_algorithm = "algorithm";
76 enum NID_algorithm = 38;
77 enum OBJ_algorithm = "1L,3L,14L,3L,2L";
78
79 enum LN_rsadsi = "rsadsi";
80 enum NID_rsadsi = 1;
81 enum OBJ_rsadsi = "1L,2L,840L,113549L";
82
83 enum LN_pkcs = "pkcs";
84 enum NID_pkcs = 2;
85 enum OBJ_pkcs = "OBJ_rsadsi,1L";
86
87 enum SN_md2 = "MD2";
88 enum LN_md2 = "md2";
89 enum NID_md2 = 3;
90 enum OBJ_md2 = "OBJ_rsadsi,2L,2L";
91
92 enum SN_md5 = "MD5";
93 enum LN_md5 = "md5";
94 enum NID_md5 = 4;
95 enum OBJ_md5 = "OBJ_rsadsi,2L,5L";
96
97 enum SN_rc4 = "RC4";
98 enum LN_rc4 = "rc4";
99 enum NID_rc4 = 5;
100 enum OBJ_rc4 = "OBJ_rsadsi,3L,4L";
101
102 enum LN_rsaEncryption = "rsaEncryption";
103 enum NID_rsaEncryption = 6;
104 enum OBJ_rsaEncryption = "OBJ_pkcs,1L,1L";
105
106 enum SN_md2WithRSAEncryption = "RSA-MD2";
107 enum LN_md2WithRSAEncryption = "md2WithRSAEncryption";
108 enum NID_md2WithRSAEncryption = 7;
109 enum OBJ_md2WithRSAEncryption = "OBJ_pkcs,1L,2L";
110
111 enum SN_md5WithRSAEncryption = "RSA-MD5";
112 enum LN_md5WithRSAEncryption = "md5WithRSAEncryption";
113 enum NID_md5WithRSAEncryption = 8;
114 enum OBJ_md5WithRSAEncryption = "OBJ_pkcs,1L,4L";
115
116 enum SN_pbeWithMD2AndDES_CBC = "PBE-MD2-DES";
117 enum LN_pbeWithMD2AndDES_CBC = "pbeWithMD2AndDES-CBC";
118 enum NID_pbeWithMD2AndDES_CBC = 9;
119 enum OBJ_pbeWithMD2AndDES_CBC = "OBJ_pkcs,5L,1L";
120
121 enum SN_pbeWithMD5AndDES_CBC = "PBE-MD5-DES";
122 enum LN_pbeWithMD5AndDES_CBC = "pbeWithMD5AndDES-CBC";
123 enum NID_pbeWithMD5AndDES_CBC = 10;
124 enum OBJ_pbeWithMD5AndDES_CBC = "OBJ_pkcs,5L,3L";
125
126 enum LN_X500 = "X500";
127 enum NID_X500 = 11;
128 enum OBJ_X500 = "2L,5L";
129
130 enum LN_X509 = "X509";
131 enum NID_X509 = 12;
132 enum OBJ_X509 = "OBJ_X500,4L";
133
134 enum SN_commonName = "CN";
135 enum LN_commonName = "commonName";
136 enum NID_commonName = 13;
137 enum OBJ_commonName = "OBJ_X509,3L";
138
139 enum SN_countryName = "C";
140 enum LN_countryName = "countryName";
141 enum NID_countryName = 14;
142 enum OBJ_countryName = "OBJ_X509,6L";
143
144 enum SN_localityName = "L";
145 enum LN_localityName = "localityName";
146 enum NID_localityName = 15;
147 enum OBJ_localityName = "OBJ_X509,7L";
148
149 /* Postal Address? PA */
150
151 /* should be "ST" (rfc1327) but MS uses 'S' */
152 enum SN_stateOrProvinceName = "ST";
153 enum LN_stateOrProvinceName = "stateOrProvinceName";
154 enum NID_stateOrProvinceName = 16;
155 enum OBJ_stateOrProvinceName = "OBJ_X509,8L";
156
157 enum SN_organizationName = "O";
158 enum LN_organizationName = "organizationName";
159 enum NID_organizationName = 17;
160 enum OBJ_organizationName = "OBJ_X509,10L";
161
162 enum SN_organizationalUnitName = "OU";
163 enum LN_organizationalUnitName = "organizationalUnitName";
164 enum NID_organizationalUnitName = 18;
165 enum OBJ_organizationalUnitName = "OBJ_X509,11L";
166
167 enum SN_rsa = "RSA";
168 enum LN_rsa = "rsa";
169 enum NID_rsa = 19;
170 enum OBJ_rsa = "OBJ_X500,8L,1L,1L";
171
172 enum LN_pkcs7 = "pkcs7";
173 enum NID_pkcs7 = 20;
174 enum OBJ_pkcs7 = "OBJ_pkcs,7L";
175
176 enum LN_pkcs7_data = "pkcs7-data";
177 enum NID_pkcs7_data = 21;
178 enum OBJ_pkcs7_data = "OBJ_pkcs7,1L";
179
180 enum LN_pkcs7_signed = "pkcs7-signedData";
181 enum NID_pkcs7_signed = 22;
182 enum OBJ_pkcs7_signed = "OBJ_pkcs7,2L";
183
184 enum LN_pkcs7_enveloped = "pkcs7-envelopedData";
185 enum NID_pkcs7_enveloped = 23;
186 enum OBJ_pkcs7_enveloped = "OBJ_pkcs7,3L";
187
188 enum LN_pkcs7_signedAndEnveloped = "pkcs7-signedAndEnvelopedData";
189 enum NID_pkcs7_signedAndEnveloped = 24;
190 enum OBJ_pkcs7_signedAndEnveloped = "OBJ_pkcs7,4L";
191
192 enum LN_pkcs7_digest = "pkcs7-digestData";
193 enum NID_pkcs7_digest = 25;
194 enum OBJ_pkcs7_digest = "OBJ_pkcs7,5L";
195
196 enum LN_pkcs7_encrypted = "pkcs7-encryptedData";
197 enum NID_pkcs7_encrypted = 26;
198 enum OBJ_pkcs7_encrypted = "OBJ_pkcs7,6L";
199
200 enum LN_pkcs3 = "pkcs3";
201 enum NID_pkcs3 = 27;
202 enum OBJ_pkcs3 = "OBJ_pkcs,3L";
203
204 enum LN_dhKeyAgreement = "dhKeyAgreement";
205 enum NID_dhKeyAgreement = 28;
206 enum OBJ_dhKeyAgreement = "OBJ_pkcs3,1L";
207
208 enum SN_des_ecb = "DES-ECB";
209 enum LN_des_ecb = "des-ecb";
210 enum NID_des_ecb = 29;
211 enum OBJ_des_ecb = "OBJ_algorithm,6L";
212
213 enum SN_des_cfb64 = "DES-CFB";
214 enum LN_des_cfb64 = "des-cfb";
215 enum NID_des_cfb64 = 30;
216 /* IV + num */
217 enum OBJ_des_cfb64 = "OBJ_algorithm,9L";
218
219 enum SN_des_cbc = "DES-CBC";
220 enum LN_des_cbc = "des-cbc";
221 enum NID_des_cbc = 31;
222 /* IV */
223 enum OBJ_des_cbc = "OBJ_algorithm,7L";
224
225 enum SN_des_ede = "DES-EDE";
226 enum LN_des_ede = "des-ede";
227 enum NID_des_ede = 32;
228 /* ?? */
229 enum OBJ_des_ede = "OBJ_algorithm,17L";
230
231 enum SN_des_ede3 = "DES-EDE3";
232 enum LN_des_ede3 = "des-ede3";
233 enum NID_des_ede3 = 33;
234
235 enum SN_idea_cbc = "IDEA-CBC";
236 enum LN_idea_cbc = "idea-cbc";
237 enum NID_idea_cbc = 34;
238 enum OBJ_idea_cbc = "1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L";
239
240 enum SN_idea_cfb64 = "IDEA-CFB";
241 enum LN_idea_cfb64 = "idea-cfb";
242 enum NID_idea_cfb64 = 35;
243
244 enum SN_idea_ecb = "IDEA-ECB";
245 enum LN_idea_ecb = "idea-ecb";
246 enum NID_idea_ecb = 36;
247
248 enum SN_rc2_cbc = "RC2-CBC";
249 enum LN_rc2_cbc = "rc2-cbc";
250 enum NID_rc2_cbc = 37;
251 enum OBJ_rc2_cbc = "OBJ_rsadsi,3L,2L";
252
253 enum SN_rc2_ecb = "RC2-ECB";
254 enum LN_rc2_ecb = "rc2-ecb";
255 enum NID_rc2_ecb = 38;
256
257 enum SN_rc2_cfb64 = "RC2-CFB";
258 enum LN_rc2_cfb64 = "rc2-cfb";
259 enum NID_rc2_cfb64 = 39;
260
261 enum SN_rc2_ofb64 = "RC2-OFB";
262 enum LN_rc2_ofb64 = "rc2-ofb";
263 enum NID_rc2_ofb64 = 40;
264
265 enum SN_sha = "SHA";
266 enum LN_sha = "sha";
267 enum NID_sha = 41;
268 enum OBJ_sha = "OBJ_algorithm,18L";
269
270 enum SN_shaWithRSAEncryption = "RSA-SHA";
271 enum LN_shaWithRSAEncryption = "shaWithRSAEncryption";
272 enum NID_shaWithRSAEncryption = 42;
273 enum OBJ_shaWithRSAEncryption = "OBJ_algorithm,15L";
274
275 enum SN_des_ede_cbc = "DES-EDE-CBC";
276 enum LN_des_ede_cbc = "des-ede-cbc";
277 enum NID_des_ede_cbc = 43;
278
279 enum SN_des_ede3_cbc = "DES-EDE3-CBC";
280 enum LN_des_ede3_cbc = "des-ede3-cbc";
281 enum NID_des_ede3_cbc = 44;
282 enum OBJ_des_ede3_cbc = "OBJ_rsadsi,3L,7L";
283
284 enum SN_des_ofb64 = "DES-OFB";
285 enum LN_des_ofb64 = "des-ofb";
286 enum NID_des_ofb64 = 45;
287 enum OBJ_des_ofb64 = "OBJ_algorithm,8L";
288
289 enum SN_idea_ofb64 = "IDEA-OFB";
290 enum LN_idea_ofb64 = "idea-ofb";
291 enum NID_idea_ofb64 = 46;
292
293 enum LN_pkcs9 = "pkcs9";
294 enum NID_pkcs9 = 47;
295 enum OBJ_pkcs9 = "OBJ_pkcs,9L";
296
297 enum SN_pkcs9_emailAddress = "Email";
298 enum LN_pkcs9_emailAddress = "emailAddress";
299 enum NID_pkcs9_emailAddress = 48;
300 enum OBJ_pkcs9_emailAddress = "OBJ_pkcs9,1L";
301
302 enum LN_pkcs9_unstructuredName = "unstructuredName";
303 enum NID_pkcs9_unstructuredName = 49;
304 enum OBJ_pkcs9_unstructuredName = "OBJ_pkcs9,2L";
305
306 enum LN_pkcs9_contentType = "contentType";
307 enum NID_pkcs9_contentType = 50;
308 enum OBJ_pkcs9_contentType = "OBJ_pkcs9,3L";
309
310 enum LN_pkcs9_messageDigest = "messageDigest";
311 enum NID_pkcs9_messageDigest = 51;
312 enum OBJ_pkcs9_messageDigest = "OBJ_pkcs9,4L";
313
314 enum LN_pkcs9_signingTime = "signingTime";
315 enum NID_pkcs9_signingTime = 52;
316 enum OBJ_pkcs9_signingTime = "OBJ_pkcs9,5L";
317
318 enum LN_pkcs9_countersignature = "countersignature";
319 enum NID_pkcs9_countersignature = 53;
320 enum OBJ_pkcs9_countersignature = "OBJ_pkcs9,6L";
321
322 enum LN_pkcs9_challengePassword = "challengePassword";
323 enum NID_pkcs9_challengePassword = 54;
324 enum OBJ_pkcs9_challengePassword = "OBJ_pkcs9,7L";
325
326 enum LN_pkcs9_unstructuredAddress = "unstructuredAddress";
327 enum NID_pkcs9_unstructuredAddress = 55;
328 enum OBJ_pkcs9_unstructuredAddress = "OBJ_pkcs9,8L";
329
330 enum LN_pkcs9_extCertAttributes = "extendedCertificateAttributes";
331 enum NID_pkcs9_extCertAttributes = 56;
332 enum OBJ_pkcs9_extCertAttributes = "OBJ_pkcs9,9L";
333
334 enum SN_netscape = "Netscape";
335 enum LN_netscape = "Netscape Communications Corp.";
336 enum NID_netscape = 57;
337 enum OBJ_netscape = "2L,16L,840L,1L,113730L";
338
339 enum SN_netscape_cert_extension = "nsCertExt";
340 enum LN_netscape_cert_extension = "Netscape Certificate Extension";
341 enum NID_netscape_cert_extension = 58;
342 enum OBJ_netscape_cert_extension = "OBJ_netscape,1L";
343
344 enum SN_netscape_data_type = "nsDataType";
345 enum LN_netscape_data_type = "Netscape Data Type";
346 enum NID_netscape_data_type = 59;
347 enum OBJ_netscape_data_type = "OBJ_netscape,2L";
348
349 enum SN_des_ede_cfb64 = "DES-EDE-CFB";
350 enum LN_des_ede_cfb64 = "des-ede-cfb";
351 enum NID_des_ede_cfb64 = 60;
352
353 enum SN_des_ede3_cfb64 = "DES-EDE3-CFB";
354 enum LN_des_ede3_cfb64 = "des-ede3-cfb";
355 enum NID_des_ede3_cfb64 = 61;
356
357 enum SN_des_ede_ofb64 = "DES-EDE-OFB";
358 enum LN_des_ede_ofb64 = "des-ede-ofb";
359 enum NID_des_ede_ofb64 = 62;
360
361 enum SN_des_ede3_ofb64 = "DES-EDE3-OFB";
362 enum LN_des_ede3_ofb64 = "des-ede3-ofb";
363 enum NID_des_ede3_ofb64 = 63;
364
365 /* I'm not sure about the object ID */
366 enum SN_sha1 = "SHA1";
367 enum LN_sha1 = "sha1";
368 enum NID_sha1 = 64;
369 enum OBJ_sha1 = "OBJ_algorithm,26L";
370 /* 28 Jun 1996 - eay */
371 /* alias 1L OBJ_sha1;,3L,14L,2L,26L,05L <- wrong */
372
373 enum SN_sha1WithRSAEncryption = "RSA-SHA1";
374 enum LN_sha1WithRSAEncryption = "sha1WithRSAEncryption";
375 enum NID_sha1WithRSAEncryption = 65;
376 enum OBJ_sha1WithRSAEncryption = "OBJ_pkcs,1L,5L";
377
378 enum SN_dsaWithSHA = "DSA-SHA";
379 enum LN_dsaWithSHA = "dsaWithSHA";
380 enum NID_dsaWithSHA = 66;
381 enum OBJ_dsaWithSHA = "OBJ_algorithm,13L";
382
383 enum SN_dsa_2 = "DSA-old";
384 enum LN_dsa_2 = "dsaEncryption-old";
385 enum NID_dsa_2 = 67;
386 enum OBJ_dsa_2 = "OBJ_algorithm,12L";
387
388 /* proposed by microsoft to RSA */
389 enum SN_pbeWithSHA1AndRC2_CBC = "PBE-SHA1-RC2-64";
390 enum LN_pbeWithSHA1AndRC2_CBC = "pbeWithSHA1AndRC2-CBC";
391 enum NID_pbeWithSHA1AndRC2_CBC = 68;
392 enum OBJ_pbeWithSHA1AndRC2_CBC = "OBJ_pkcs,5L,11L";
393
394 /* proposed by microsoft to RSA as pbeWithSHA1AndRC4: it is now
395 * defined explicitly in PKCS#5 v2.0 as id-PBKDF2 which is something
396 * completely different.
397 */
398 enum LN_id_pbkdf2 = "PBKDF2";
399 enum NID_id_pbkdf2 = 69;
400 enum OBJ_id_pbkdf2 = "OBJ_pkcs,5L,12L";
401
402 enum SN_dsaWithSHA1_2 = "DSA-SHA1-old";
403 enum LN_dsaWithSHA1_2 = "dsaWithSHA1-old";
404 enum NID_dsaWithSHA1_2 = 70;
405 /* Got this one from 'sdn706r20.pdf' which is actually an NSA document :-) */
406 enum OBJ_dsaWithSHA1_2 = "OBJ_algorithm,27L";
407
408 enum SN_netscape_cert_type = "nsCertType";
409 enum LN_netscape_cert_type = "Netscape Cert Type";
410 enum NID_netscape_cert_type = 71;
411 enum OBJ_netscape_cert_type = "OBJ_netscape_cert_extension,1L";
412
413 enum SN_netscape_base_url = "nsBaseUrl";
414 enum LN_netscape_base_url = "Netscape Base Url";
415 enum NID_netscape_base_url = 72;
416 enum OBJ_netscape_base_url = "OBJ_netscape_cert_extension,2L";
417
418 enum SN_netscape_revocation_url = "nsRevocationUrl";
419 enum LN_netscape_revocation_url = "Netscape Revocation Url";
420 enum NID_netscape_revocation_url = 73;
421 enum OBJ_netscape_revocation_url = "OBJ_netscape_cert_extension,3L";
422
423 enum SN_netscape_ca_revocation_url = "nsCaRevocationUrl";
424 enum LN_netscape_ca_revocation_url = "Netscape CA Revocation Url";
425 enum NID_netscape_ca_revocation_url = 74;
426 enum OBJ_netscape_ca_revocation_url = "OBJ_netscape_cert_extension,4L";
427
428 enum SN_netscape_renewal_url = "nsRenewalUrl";
429 enum LN_netscape_renewal_url = "Netscape Renewal Url";
430 enum NID_netscape_renewal_url = 75;
431 enum OBJ_netscape_renewal_url = "OBJ_netscape_cert_extension,7L";
432
433 enum SN_netscape_ca_policy_url = "nsCaPolicyUrl";
434 enum LN_netscape_ca_policy_url = "Netscape CA Policy Url";
435 enum NID_netscape_ca_policy_url = 76;
436 enum OBJ_netscape_ca_policy_url = "OBJ_netscape_cert_extension,8L";
437
438 enum SN_netscape_ssl_server_name = "nsSslServerName";
439 enum LN_netscape_ssl_server_name = "Netscape SSL Server Name";
440 enum NID_netscape_ssl_server_name = 77;
441 enum OBJ_netscape_ssl_server_name = "OBJ_netscape_cert_extension,12L";
442
443 enum SN_netscape_comment = "nsComment";
444 enum LN_netscape_comment = "Netscape Comment";
445 enum NID_netscape_comment = 78;
446 enum OBJ_netscape_comment = "OBJ_netscape_cert_extension,13L";
447
448 enum SN_netscape_cert_sequence = "nsCertSequence";
449 enum LN_netscape_cert_sequence = "Netscape Certificate Sequence";
450 enum NID_netscape_cert_sequence = 79;
451 enum OBJ_netscape_cert_sequence = "OBJ_netscape_data_type,5L";
452
453 enum SN_desx_cbc = "DESX-CBC";
454 enum LN_desx_cbc = "desx-cbc";
455 enum NID_desx_cbc = 80;
456
457 enum SN_id_ce = "id-ce";
458 enum NID_id_ce = 81;
459 enum OBJ_id_ce = "2L,5L,29L";
460
461 enum SN_subject_key_identifier = "subjectKeyIdentifier";
462 enum LN_subject_key_identifier = "X509v3 Subject Key Identifier";
463 enum NID_subject_key_identifier = 82;
464 enum OBJ_subject_key_identifier = "OBJ_id_ce,14L";
465
466 enum SN_key_usage = "keyUsage";
467 enum LN_key_usage = "X509v3 Key Usage";
468 enum NID_key_usage = 83;
469 enum OBJ_key_usage = "OBJ_id_ce,15L";
470
471 enum SN_private_key_usage_period = "privateKeyUsagePeriod";
472 enum LN_private_key_usage_period = "X509v3 Private Key Usage Period";
473 enum NID_private_key_usage_period = 84;
474 enum OBJ_private_key_usage_period = "OBJ_id_ce,16L";
475
476 enum SN_subject_alt_name = "subjectAltName";
477 enum LN_subject_alt_name = "X509v3 Subject Alternative Name";
478 enum NID_subject_alt_name = 85;
479 enum OBJ_subject_alt_name = "OBJ_id_ce,17L";
480
481 enum SN_issuer_alt_name = "issuerAltName";
482 enum LN_issuer_alt_name = "X509v3 Issuer Alternative Name";
483 enum NID_issuer_alt_name = 86;
484 enum OBJ_issuer_alt_name = "OBJ_id_ce,18L";
485
486 enum SN_basic_constraints = "basicConstraints";
487 enum LN_basic_constraints = "X509v3 Basic Constraints";
488 enum NID_basic_constraints = 87;
489 enum OBJ_basic_constraints = "OBJ_id_ce,19L";
490
491 enum SN_crl_number = "crlNumber";
492 enum LN_crl_number = "X509v3 CRL Number";
493 enum NID_crl_number = 88;
494 enum OBJ_crl_number = "OBJ_id_ce,20L";
495
496 enum SN_certificate_policies = "certificatePolicies";
497 enum LN_certificate_policies = "X509v3 Certificate Policies";
498 enum NID_certificate_policies = 89;
499 enum OBJ_certificate_policies = "OBJ_id_ce,32L";
500
501 enum SN_authority_key_identifier = "authorityKeyIdentifier";
502 enum LN_authority_key_identifier = "X509v3 Authority Key Identifier";
503 enum NID_authority_key_identifier = 90;
504 enum OBJ_authority_key_identifier = "OBJ_id_ce,35L";
505
506 enum SN_bf_cbc = "BF-CBC";
507 enum LN_bf_cbc = "bf-cbc";
508 enum NID_bf_cbc = 91;
509 enum OBJ_bf_cbc = "1L,3L,6L,1L,4L,1L,3029L,1L,2L";
510
511 enum SN_bf_ecb = "BF-ECB";
512 enum LN_bf_ecb = "bf-ecb";
513 enum NID_bf_ecb = 92;
514
515 enum SN_bf_cfb64 = "BF-CFB";
516 enum LN_bf_cfb64 = "bf-cfb";
517 enum NID_bf_cfb64 = 93;
518
519 enum SN_bf_ofb64 = "BF-OFB";
520 enum LN_bf_ofb64 = "bf-ofb";
521 enum NID_bf_ofb64 = 94;
522
523 enum SN_mdc2 = "MDC2";
524 enum LN_mdc2 = "mdc2";
525 enum NID_mdc2 = 95;
526 enum OBJ_mdc2 = "2L,5L,8L,3L,101L";
527 /* An alternative? 1L,3L,14L,3L,2L,19L */
528
529 enum SN_mdc2WithRSA = "RSA-MDC2";
530 enum LN_mdc2WithRSA = "mdc2withRSA";
531 enum NID_mdc2WithRSA = 96;
532 enum OBJ_mdc2WithRSA = "2L,5L,8L,3L,100L";
533
534 enum SN_rc4_40 = "RC4-40";
535 enum LN_rc4_40 = "rc4-40";
536 enum NID_rc4_40 = 97;
537
538 enum SN_rc2_40_cbc = "RC2-40-CBC";
539 enum LN_rc2_40_cbc = "rc2-40-cbc";
540 enum NID_rc2_40_cbc = 98;
541
542 enum SN_givenName = "G";
543 enum LN_givenName = "givenName";
544 enum NID_givenName = 99;
545 enum OBJ_givenName = "OBJ_X509,42L";
546
547 enum SN_surname = "S";
548 enum LN_surname = "surname";
549 enum NID_surname = 100;
550 enum OBJ_surname = "OBJ_X509,4L";
551
552 enum SN_initials = "I";
553 enum LN_initials = "initials";
554 enum NID_initials = 101;
555 enum OBJ_initials = "OBJ_X509,43L";
556
557 enum SN_uniqueIdentifier = "UID";
558 enum LN_uniqueIdentifier = "uniqueIdentifier";
559 enum NID_uniqueIdentifier = 102;
560 enum OBJ_uniqueIdentifier = "OBJ_X509,45L";
561
562 enum SN_crl_distribution_points = "crlDistributionPoints";
563 enum LN_crl_distribution_points = "X509v3 CRL Distribution Points";
564 enum NID_crl_distribution_points = 103;
565 enum OBJ_crl_distribution_points = "OBJ_id_ce,31L";
566
567 enum SN_md5WithRSA = "RSA-NP-MD5";
568 enum LN_md5WithRSA = "md5WithRSA";
569 enum NID_md5WithRSA = 104;
570 enum OBJ_md5WithRSA = "OBJ_algorithm,3L";
571
572 enum SN_serialNumber = "SN";
573 enum LN_serialNumber = "serialNumber";
574 enum NID_serialNumber = 105;
575 enum OBJ_serialNumber = "OBJ_X509,5L";
576
577 enum SN_title = "T";
578 enum LN_title = "title";
579 enum NID_title = 106;
580 enum OBJ_title = "OBJ_X509,12L";
581
582 enum SN_description = "D";
583 enum LN_description = "description";
584 enum NID_description = 107;
585 enum OBJ_description = "OBJ_X509,13L";
586
587 /* CAST5 is CAST-128, I'm just sticking with the documentation */
588 enum SN_cast5_cbc = "CAST5-CBC";
589 enum LN_cast5_cbc = "cast5-cbc";
590 enum NID_cast5_cbc = 108;
591 enum OBJ_cast5_cbc = "1L,2L,840L,113533L,7L,66L,10L";
592
593 enum SN_cast5_ecb = "CAST5-ECB";
594 enum LN_cast5_ecb = "cast5-ecb";
595 enum NID_cast5_ecb = 109;
596
597 enum SN_cast5_cfb64 = "CAST5-CFB";
598 enum LN_cast5_cfb64 = "cast5-cfb";
599 enum NID_cast5_cfb64 = 110;
600
601 enum SN_cast5_ofb64 = "CAST5-OFB";
602 enum LN_cast5_ofb64 = "cast5-ofb";
603 enum NID_cast5_ofb64 = 111;
604
605 enum LN_pbeWithMD5AndCast5_CBC = "pbeWithMD5AndCast5CBC";
606 enum NID_pbeWithMD5AndCast5_CBC = 112;
607 enum OBJ_pbeWithMD5AndCast5_CBC = "1L,2L,840L,113533L,7L,66L,12L";
608
609 /* This is one sun will soon be using :-(
610 * id-dsa-with-sha1 ID ::= {
611 * iso(1) member-body(2) us(840) x9-57 (10040) x9cm(4) 3 }
612 */
613 enum SN_dsaWithSHA1 = "DSA-SHA1";
614 enum LN_dsaWithSHA1 = "dsaWithSHA1";
615 enum NID_dsaWithSHA1 = 113;
616 enum OBJ_dsaWithSHA1 = "1L,2L,840L,10040L,4L,3L";
617
618 enum NID_md5_sha1 = 114;
619 enum SN_md5_sha1 = "MD5-SHA1";
620 enum LN_md5_sha1 = "md5-sha1";
621
622 enum SN_sha1WithRSA = "RSA-SHA1-2";
623 enum LN_sha1WithRSA = "sha1WithRSA";
624 enum NID_sha1WithRSA = 115;
625 enum OBJ_sha1WithRSA = "OBJ_algorithm,29L";
626
627 enum SN_dsa = "DSA";
628 enum LN_dsa = "dsaEncryption";
629 enum NID_dsa = 116;
630 enum OBJ_dsa = "1L,2L,840L,10040L,4L,1L";
631
632 enum SN_ripemd160 = "RIPEMD160";
633 enum LN_ripemd160 = "ripemd160";
634 enum NID_ripemd160 = 117;
635 enum OBJ_ripemd160 = "1L,3L,36L,3L,2L,1L";
636
637 /* The name should actually be rsaSignatureWithripemd160, but I'm going
638 * to continue using the convention I'm using with the other ciphers */
639 enum SN_ripemd160WithRSA = "RSA-RIPEMD160";
640 enum LN_ripemd160WithRSA = "ripemd160WithRSA";
641 enum NID_ripemd160WithRSA = 119;
642 enum OBJ_ripemd160WithRSA = "1L,3L,36L,3L,3L,1L,2L";
643
644 /* Taken from rfc2040
645 * RC5_CBC_Parameters ::= SEQUENCE {
646 * version INTEGER (v1_0(16)),
647 * rounds INTEGER (8..127),
648 * blockSizeInBits INTEGER (64, 128),
649 * iv OCTET STRING OPTIONAL
650 * }
651 */
652 enum SN_rc5_cbc = "RC5-CBC";
653 enum LN_rc5_cbc = "rc5-cbc";
654 enum NID_rc5_cbc = 120;
655 enum OBJ_rc5_cbc = "OBJ_rsadsi,3L,8L";
656
657 enum SN_rc5_ecb = "RC5-ECB";
658 enum LN_rc5_ecb = "rc5-ecb";
659 enum NID_rc5_ecb = 121;
660
661 enum SN_rc5_cfb64 = "RC5-CFB";
662 enum LN_rc5_cfb64 = "rc5-cfb";
663 enum NID_rc5_cfb64 = 122;
664
665 enum SN_rc5_ofb64 = "RC5-OFB";
666 enum LN_rc5_ofb64 = "rc5-ofb";
667 enum NID_rc5_ofb64 = 123;
668
669 enum SN_rle_compression = "RLE";
670 enum LN_rle_compression = "run length compression";
671 enum NID_rle_compression = 124;
672 enum OBJ_rle_compression = "1L,1L,1L,1L,666L,1L";
673
674 enum SN_zlib_compression = "ZLIB";
675 enum LN_zlib_compression = "zlib compression";
676 enum NID_zlib_compression = 125;
677 enum OBJ_zlib_compression = "1L,1L,1L,1L,666L,2L";
678
679 enum SN_ext_key_usage = "extendedKeyUsage";
680 enum LN_ext_key_usage = "X509v3 Extended Key Usage";
681 enum NID_ext_key_usage = 126;
682 enum OBJ_ext_key_usage = "OBJ_id_ce,37";
683
684 enum SN_id_pkix = "PKIX";
685 enum NID_id_pkix = 127;
686 enum OBJ_id_pkix = "1L,3L,6L,1L,5L,5L,7L";
687
688 enum SN_id_kp = "id-kp";
689 enum NID_id_kp = 128;
690 enum OBJ_id_kp = "OBJ_id_pkix,3L";
691
692 /* PKIX extended key usage OIDs */
693
694 enum SN_server_auth = "serverAuth";
695 enum LN_server_auth = "TLS Web Server Authentication";
696 enum NID_server_auth = 129;
697 enum OBJ_server_auth = "OBJ_id_kp,1L";
698
699 enum SN_client_auth = "clientAuth";
700 enum LN_client_auth = "TLS Web Client Authentication";
701 enum NID_client_auth = 130;
702 enum OBJ_client_auth = "OBJ_id_kp,2L";
703
704 enum SN_code_sign = "codeSigning";
705 enum LN_code_sign = "Code Signing";
706 enum NID_code_sign = 131;
707 enum OBJ_code_sign = "OBJ_id_kp,3L";
708
709 enum SN_email_protect = "emailProtection";
710 enum LN_email_protect = "E-mail Protection";
711 enum NID_email_protect = 132;
712 enum OBJ_email_protect = "OBJ_id_kp,4L";
713
714 enum SN_time_stamp = "timeStamping";
715 enum LN_time_stamp = "Time Stamping";
716 enum NID_time_stamp = 133;
717 enum OBJ_time_stamp = "OBJ_id_kp,8L";
718
719 /* Additional extended key usage OIDs: Microsoft */
720
721 enum SN_ms_code_ind = "msCodeInd";
722 enum LN_ms_code_ind = "Microsoft Individual Code Signing";
723 enum NID_ms_code_ind = 134;
724 enum OBJ_ms_code_ind = "1L,3L,6L,1L,4L,1L,311L,2L,1L,21L";
725
726 enum SN_ms_code_com = "msCodeCom";
727 enum LN_ms_code_com = "Microsoft Commercial Code Signing";
728 enum NID_ms_code_com = 135;
729 enum OBJ_ms_code_com = "1L,3L,6L,1L,4L,1L,311L,2L,1L,22L";
730
731 enum SN_ms_ctl_sign = "msCTLSign";
732 enum LN_ms_ctl_sign = "Microsoft Trust List Signing";
733 enum NID_ms_ctl_sign = 136;
734 enum OBJ_ms_ctl_sign = "1L,3L,6L,1L,4L,1L,311L,10L,3L,1L";
735
736 enum SN_ms_sgc = "msSGC";
737 enum LN_ms_sgc = "Microsoft Server Gated Crypto";
738 enum NID_ms_sgc = 137;
739 enum OBJ_ms_sgc = "1L,3L,6L,1L,4L,1L,311L,10L,3L,3L";
740
741 enum SN_ms_efs = "msEFS";
742 enum LN_ms_efs = "Microsoft Encrypted File System";
743 enum NID_ms_efs = 138;
744 enum OBJ_ms_efs = "1L,3L,6L,1L,4L,1L,311L,10L,3L,4L";
745
746 /* Additional usage: Netscape */
747
748 enum SN_ns_sgc = "nsSGC";
749 enum LN_ns_sgc = "Netscape Server Gated Crypto";
750 enum NID_ns_sgc = 139;
751 enum OBJ_ns_sgc = "OBJ_netscape,4L,1L";
752
753 enum SN_delta_crl = "deltaCRL";
754 enum LN_delta_crl = "X509v3 Delta CRL Indicator";
755 enum NID_delta_crl = 140;
756 enum OBJ_delta_crl = "OBJ_id_ce,27L";
757
758 enum SN_crl_reason = "CRLReason";
759 enum LN_crl_reason = "CRL Reason Code";
760 enum NID_crl_reason = 141;
761 enum OBJ_crl_reason = "OBJ_id_ce,21L";
762
763 enum SN_invalidity_date = "invalidityDate";
764 enum LN_invalidity_date = "Invalidity Date";
765 enum NID_invalidity_date = 142;
766 enum OBJ_invalidity_date = "OBJ_id_ce,24L";
767
768 enum SN_sxnet = "SXNetID";
769 enum LN_sxnet = "Strong Extranet ID";
770 enum NID_sxnet = 143;
771 enum OBJ_sxnet = "1L,3L,101L,1L,4L,1L";
772
773 /* PKCS12 and related OBJECT IDENTIFIERS */
774
775 enum OBJ_pkcs12 = "OBJ_pkcs,12L";
776 alias OBJ_pkcs12 OBJ_pkcs12_pbeids;, 1
777
778 enum SN_pbe_WithSHA1And128BitRC4 = "PBE-SHA1-RC4-128";
779 enum LN_pbe_WithSHA1And128BitRC4 = "pbeWithSHA1And128BitRC4";
780 enum NID_pbe_WithSHA1And128BitRC4 = 144;
781 alias OBJ_pkcs12_pbeids OBJ_pbe_WithSHA1And128BitRC4;, 1L
782
783 enum SN_pbe_WithSHA1And40BitRC4 = "PBE-SHA1-RC4-40";
784 enum LN_pbe_WithSHA1And40BitRC4 = "pbeWithSHA1And40BitRC4";
785 enum NID_pbe_WithSHA1And40BitRC4 = 145;
786 alias OBJ_pkcs12_pbeids OBJ_pbe_WithSHA1And40BitRC4;, 2L
787
788 enum SN_pbe_WithSHA1And3_Key_TripleDES_CBC = "PBE-SHA1-3DES";
789 enum LN_pbe_WithSHA1And3_Key_TripleDES_CBC = "pbeWithSHA1And3-KeyTripleDES-CBC";
790 enum NID_pbe_WithSHA1And3_Key_TripleDES_CBC = 146;
791 alias OBJ_pkcs12_pbeids OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC;, 3L
792
793 enum SN_pbe_WithSHA1And2_Key_TripleDES_CBC = "PBE-SHA1-2DES";
794 enum LN_pbe_WithSHA1And2_Key_TripleDES_CBC = "pbeWithSHA1And2-KeyTripleDES-CBC";
795 enum NID_pbe_WithSHA1And2_Key_TripleDES_CBC = 147;
796 alias OBJ_pkcs12_pbeids OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC;, 4L
797
798 enum SN_pbe_WithSHA1And128BitRC2_CBC = "PBE-SHA1-RC2-128";
799 enum LN_pbe_WithSHA1And128BitRC2_CBC = "pbeWithSHA1And128BitRC2-CBC";
800 enum NID_pbe_WithSHA1And128BitRC2_CBC = 148;
801 alias OBJ_pkcs12_pbeids OBJ_pbe_WithSHA1And128BitRC2_CBC;, 5L
802
803 enum SN_pbe_WithSHA1And40BitRC2_CBC = "PBE-SHA1-RC2-40";
804 enum LN_pbe_WithSHA1And40BitRC2_CBC = "pbeWithSHA1And40BitRC2-CBC";
805 enum NID_pbe_WithSHA1And40BitRC2_CBC = 149;
806 alias OBJ_pkcs12_pbeids OBJ_pbe_WithSHA1And40BitRC2_CBC;, 6L
807
808 alias OBJ_pkcs12 OBJ_pkcs12_Version1;, 10L
809
810 alias OBJ_pkcs12_Version1 OBJ_pkcs12_BagIds;, 1L
811
812 enum LN_keyBag = "keyBag";
813 enum NID_keyBag = 150;
814 alias OBJ_pkcs12_BagIds OBJ_keyBag;, 1L
815
816 enum LN_pkcs8ShroudedKeyBag = "pkcs8ShroudedKeyBag";
817 enum NID_pkcs8ShroudedKeyBag = 151;
818 alias OBJ_pkcs12_BagIds OBJ_pkcs8ShroudedKeyBag;, 2L
819
820 enum LN_certBag = "certBag";
821 enum NID_certBag = 152;
822 alias OBJ_pkcs12_BagIds OBJ_certBag;, 3L
823
824 enum LN_crlBag = "crlBag";
825 enum NID_crlBag = 153;
826 alias OBJ_pkcs12_BagIds OBJ_crlBag;, 4L
827
828 enum LN_secretBag = "secretBag";
829 enum NID_secretBag = 154;
830 alias OBJ_pkcs12_BagIds OBJ_secretBag;, 5L
831
832 enum LN_safeContentsBag = "safeContentsBag";
833 enum NID_safeContentsBag = 155;
834 alias OBJ_pkcs12_BagIds OBJ_safeContentsBag;, 6L
835
836 enum LN_friendlyName = "friendlyName";
837 enum NID_friendlyName = 156;
838 alias OBJ_pkcs9 OBJ_friendlyName;, 20L
839
840 enum LN_localKeyID = "localKeyID";
841 enum NID_localKeyID = 157;
842 alias OBJ_pkcs9 OBJ_localKeyID;, 21L
843
844 alias OBJ_pkcs9 OBJ_certTypes;, 22L
845
846 enum LN_x509Certificate = "x509Certificate";
847 enum NID_x509Certificate = 158;
848 alias OBJ_certTypes OBJ_x509Certificate;, 1L
849
850 enum LN_sdsiCertificate = "sdsiCertificate";
851 enum NID_sdsiCertificate = 159;
852 alias OBJ_certTypes OBJ_sdsiCertificate;, 2L
853
854 alias OBJ_pkcs9 OBJ_crlTypes;, 23L
855
856 enum LN_x509Crl = "x509Crl";
857 enum NID_x509Crl = 160;
858 alias OBJ_crlTypes OBJ_x509Crl;, 1L
859
860 /* PKCS#5 v2 OIDs */
861
862 enum LN_pbes2 = "PBES2";
863 enum NID_pbes2 = 161;
864 enum OBJ_pbes2 = "OBJ_pkcs,5L,13L";
865
866 enum LN_pbmac1 = "PBMAC1";
867 enum NID_pbmac1 = 162;
868 enum OBJ_pbmac1 = "OBJ_pkcs,5L,14L";
869
870 enum LN_hmacWithSHA1 = "hmacWithSHA1";
871 enum NID_hmacWithSHA1 = 163;
872 enum OBJ_hmacWithSHA1 = "OBJ_rsadsi,2L,7L";
873
874 /* Policy Qualifier Ids */
875
876 enum LN_id_qt_cps = "Policy Qualifier CPS";
877 enum SN_id_qt_cps = "id-qt-cps";
878 enum NID_id_qt_cps = 164;
879 enum OBJ_id_qt_cps = "OBJ_id_pkix,2L,1L";
880
881 enum LN_id_qt_unotice = "Policy Qualifier User Notice";
882 enum SN_id_qt_unotice = "id-qt-unotice";
883 enum NID_id_qt_unotice = 165;
884 enum OBJ_id_qt_unotice = "OBJ_id_pkix,2L,2L";
885
886 enum SN_rc2_64_cbc = "RC2-64-CBC";
887 enum LN_rc2_64_cbc = "rc2-64-cbc";
888 enum NID_rc2_64_cbc = 166;
889
890 enum SN_SMIMECapabilities = "SMIME-CAPS";
891 enum LN_SMIMECapabilities = "S/MIME Capabilities";
892 enum NID_SMIMECapabilities = 167;
893 enum OBJ_SMIMECapabilities = "OBJ_pkcs9,15L";
894
895 enum SN_pbeWithMD2AndRC2_CBC = "PBE-MD2-RC2-64";
896 enum LN_pbeWithMD2AndRC2_CBC = "pbeWithMD2AndRC2-CBC";
897 enum NID_pbeWithMD2AndRC2_CBC = 168;
898 enum OBJ_pbeWithMD2AndRC2_CBC = "OBJ_pkcs,5L,4L";
899
900 enum SN_pbeWithMD5AndRC2_CBC = "PBE-MD5-RC2-64";
901 enum LN_pbeWithMD5AndRC2_CBC = "pbeWithMD5AndRC2-CBC";
902 enum NID_pbeWithMD5AndRC2_CBC = 169;
903 enum OBJ_pbeWithMD5AndRC2_CBC = "OBJ_pkcs,5L,6L";
904
905 enum SN_pbeWithSHA1AndDES_CBC = "PBE-SHA1-DES";
906 enum LN_pbeWithSHA1AndDES_CBC = "pbeWithSHA1AndDES-CBC";
907 enum NID_pbeWithSHA1AndDES_CBC = 170;
908 enum OBJ_pbeWithSHA1AndDES_CBC = "OBJ_pkcs,5L,10L";
909
910 /* Extension request OIDs */
911
912 enum LN_ms_ext_req = "Microsoft Extension Request";
913 enum SN_ms_ext_req = "msExtReq";
914 enum NID_ms_ext_req = 171;
915 enum OBJ_ms_ext_req = "1L,3L,6L,1L,4L,1L,311L,2L,1L,14L";
916
917 enum LN_ext_req = "Extension Request";
918 enum SN_ext_req = "extReq";
919 enum NID_ext_req = 172;
920 enum OBJ_ext_req = "OBJ_pkcs9,14L";
921
922 enum SN_name = "name";
923 enum LN_name = "name";
924 enum NID_name = 173;
925 enum OBJ_name = "OBJ_X509,41L";
926
927 enum SN_dnQualifier = "dnQualifier";
928 enum LN_dnQualifier = "dnQualifier";
929 enum NID_dnQualifier = 174;
930 enum OBJ_dnQualifier = "OBJ_X509,46L";
931
932 enum SN_id_pe = "id-pe";
933 enum NID_id_pe = 175;
934 enum OBJ_id_pe = "OBJ_id_pkix,1L";
935
936 enum SN_id_ad = "id-ad";
937 enum NID_id_ad = 176;
938 enum OBJ_id_ad = "OBJ_id_pkix,48L";
939
940 enum SN_info_access = "authorityInfoAccess";
941 enum LN_info_access = "Authority Information Access";
942 enum NID_info_access = 177;
943 enum OBJ_info_access = "OBJ_id_pe,1L";
944
945 enum SN_ad_OCSP = "OCSP";
946 enum LN_ad_OCSP = "OCSP";
947 enum NID_ad_OCSP = 178;
948 enum OBJ_ad_OCSP = "OBJ_id_ad,1L";
949
950 enum SN_ad_ca_issuers = "caIssuers";
951 enum LN_ad_ca_issuers = "CA Issuers";
952 enum NID_ad_ca_issuers = 179;
953 enum OBJ_ad_ca_issuers = "OBJ_id_ad,2L";
954
955 enum SN_OCSP_sign = "OCSPSigning";
956 enum LN_OCSP_sign = "OCSP Signing";
957 enum NID_OCSP_sign = 180;
958 enum OBJ_OCSP_sign = "OBJ_id_kp,9L";
959 +/
960 } /* USE_OBJ_MAC */
961
962 public import deimos.openssl.bio;
963 public import deimos.openssl.asn1;
964
965 enum OBJ_NAME_TYPE_UNDEF = "0x00";
966 enum OBJ_NAME_TYPE_MD_METH = "0x01";
967 enum OBJ_NAME_TYPE_CIPHER_METH = "0x02";
968 enum OBJ_NAME_TYPE_PKEY_METH = "0x03";
969 enum OBJ_NAME_TYPE_COMP_METH = "0x04";
970 enum OBJ_NAME_TYPE_NUM = "0x05";
971
972 enum OBJ_NAME_ALIAS = "0x8000";
973
974 enum OBJ_BSEARCH_VALUE_ON_NOMATCH = "0x01";
975 enum OBJ_BSEARCH_FIRST_VALUE_ON_MATCH = "0x02";
976
977
978 extern (C):
979 nothrow:
980
981 struct obj_name_st {
982 int type;
983 int alias_;
984 const(char)* name;
985 const(char)* data;
986 }
987 alias obj_name_st OBJ_NAME;
988
989 alias OBJ_create OBJ_create_and_add_object;
990
991
992 int OBJ_NAME_init();
993 int OBJ_NAME_new_index(ExternC!(c_ulong function(const(char)*)) hash_func,
994 ExternC!(int function(const(char)*, const(char)*)) cmp_func,
995 ExternC!(void function(const(char)*, int, const(char)*)) free_func);
996 const(char)* OBJ_NAME_get(const(char)* name,int type);
997 int OBJ_NAME_add(const(char)* name,int type,const(char)* data);
998 int OBJ_NAME_remove(const(char)* name,int type);
999 void OBJ_NAME_cleanup(int type); /* -1 for everything */
1000 void OBJ_NAME_do_all(int type,ExternC!(void function(const(OBJ_NAME)*,void* arg)) fn,
1001 void* arg);
1002 void OBJ_NAME_do_all_sorted(int type,ExternC!(void function(const(OBJ_NAME)*,void* arg)) fn,
1003 void* arg);
1004
1005 ASN1_OBJECT* OBJ_dup(const(ASN1_OBJECT)* o);
1006 ASN1_OBJECT* OBJ_nid2obj(int n);
1007 const(char)* OBJ_nid2ln(int n);
1008 const(char)* OBJ_nid2sn(int n);
1009 int OBJ_obj2nid(const(ASN1_OBJECT)* o);
1010 ASN1_OBJECT* OBJ_txt2obj(const(char)* s, int no_name);
1011 int OBJ_obj2txt(char* buf, int buf_len, const(ASN1_OBJECT)* a, int no_name);
1012 int OBJ_txt2nid(const(char)* s);
1013 int OBJ_ln2nid(const(char)* s);
1014 int OBJ_sn2nid(const(char)* s);
1015 int OBJ_cmp(const(ASN1_OBJECT)* a,const(ASN1_OBJECT)* b);
1016 const(void)* OBJ_bsearch_(const(void)* key,const(void)* base,int num,int size,
1017 ExternC!(int function(const(void)*, const(void)*)) cmp);
1018 const(void)* OBJ_bsearch_ex_(const(void)* key,const(void)* base,int num,
1019 int size,
1020 ExternC!(int function(const(void)*, const(void)*)) cmp,
1021 int flags);
1022
1023 mixin template _DECLARE_OBJ_BSEARCH_CMP_FN(string scope_, type1, type2, string nm) {
1024 mixin("
1025 int " ~ nm ~ "_cmp_BSEARCH_CMP_FN(const()*, const()*);
1026 int " ~ nm ~ "_cmp(const(" ~ type2 ~ ")*, const(" ~ type2 ~ ")*);
1027 " ~ scope_ ~ " " ~ type2 ~ "* OBJ_bsearch_" ~ nm ~ "(" ~ type1 ~ "* key, const(" ~ type2 ~ ")* base, int num);
1028 ");
1029 }
1030
1031 mixin template DECLARE_OBJ_BSEARCH_CMP_FN(type1, type2, string cmp) {
1032 mixin _DECLARE_OBJ_BSEARCH_CMP_FN!("static", type1, type2, cmp);
1033 }
1034
1035 mixin template DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, string nm) {
1036 mixin("type2* OBJ_bsearch_" ~ nm ~ "(type1* key, const(type2)* base, int num);");
1037 }
1038
1039
1040 /*
1041 * Unsolved problem: if a type is actually a pointer type, like
1042 * nid_triple is, then its impossible to get a const where you need
1043 * it. Consider:
1044 *
1045 * typedef int nid_triple[3];
1046 * const(void)* a_;
1047 * const nid_triple const* a = a_;
1048 *
1049 * The assignement discards a const because what you really want is:
1050 *
1051 * const int const* const* a = a_;
1052 *
1053 * But if you do that, you lose the fact that a is an array of 3 ints,
1054 * which breaks comparison functions.
1055 *
1056 * Thus we end up having to cast, sadly, or unpack the
1057 * declarations. Or, as I finally did in this case, delcare nid_triple
1058 * to be a struct, which it should have been in the first place.
1059 *
1060 * Ben, August 2008.
1061 *
1062 * Also, strictly speaking not all types need be const, but handling
1063 * the non-constness means a lot of complication, and in practice
1064 * comparison routines do always not touch their arguments.
1065 */
1066
1067 mixin template IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, string nm) {
1068 mixin("
1069 static int " ~ nm ~ "_cmp_BSEARCH_CMP_FN(const()* a_, const()* b_)
1070 {
1071 auto a = cast(const(type1)*) a_;
1072 auto b = cast(const(type2)*) b_;
1073 return " ~ nm ~ "_cmp(a,b);
1074 }
1075 static type2* OBJ_bsearch_" ~ nm ~ "(type1* key, const(type2)* base, int num)
1076 {
1077 return cast(type2*) OBJ_bsearch_(key, base, num, type2.sizeof,
1078 " ~ nm ~ "_cmp_BSEARCH_CMP_FN);
1079 }
1080 extern void dummy_prototype();
1081 ");
1082 }
1083
1084
1085 mixin template IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, string nm) {
1086 mixin("
1087 static int " ~ nm ~ "_cmp_BSEARCH_CMP_FN(const()* a_, const()* b_)
1088 {
1089 auto a = cast(const(type1)*) a_;
1090 auto b = cast(const(type2)*) b_;
1091 return " ~ nm ~ "_cmp(a,b);
1092 }
1093 type2* OBJ_bsearch_" ~ nm ~ "(type1* key, const(type2)* base, int num)
1094 {
1095 return cast(type2*) OBJ_bsearch_(key, base, num, type2.sizeof,
1096 " ~ nm ~ "_cmp_BSEARCH_CMP_FN);
1097 }
1098 extern void dummy_prototype();
1099 ");
1100 }
1101
1102 template OBJ_bsearch(string type1, string key, string type2, string base, string num, string cmp) {
1103 enum OBJ_bsearch = "(cast(" ~ type2 ~ "*)OBJ_bsearch_(CHECKED_PTR_OF!(" ~ type1 ~ ")(key),CHECKED_PTR_OF!(" ~ type2 ~ ")(base),
1104 num, " ~ type2 ~ ".sizeof,
1105 " ~ cmp ~ "_BSEARCH_CMP_FN))";
1106 }
1107
1108 // FIXME: Not translated due to confusing original code ("type_2=CHECKED_PTR_OF"?)
1109 // #define OBJ_bsearch_ex(type1,key,type2,base,num,cmp,flags) \
1110 // ((type2*)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \
1111 // num,sizeof(type2), \
1112 // (()CHECKED_PTR_OF(type1,cmp##_type_1), \
1113 // ()type_2=CHECKED_PTR_OF(type2,cmp##_type_2), \
1114 // cmp##_BSEARCH_CMP_FN)),flags)
1115
1116 int OBJ_new_nid(int num);
1117 int OBJ_add_object(const(ASN1_OBJECT)* obj);
1118 int OBJ_create(const(char)* oid,const(char)* sn,const(char)* ln);
1119 void OBJ_cleanup();
1120 int OBJ_create_objects(BIO* in_);
1121
1122 int OBJ_find_sigid_algs(int signid, int* pdig_nid, int* ppkey_nid);
1123 int OBJ_find_sigid_by_algs(int* psignid, int dig_nid, int pkey_nid);
1124 int OBJ_add_sigid(int signid, int dig_id, int pkey_id);
1125 void OBJ_sigid_free();
1126
1127 extern int obj_cleanup_defer;
1128 void check_defer(int nid);
1129
1130 /* BEGIN ERROR CODES */
1131 /* The following lines are auto generated by the script mkerr.pl. Any changes
1132 * made after this point may be overwritten when the script is next run.
1133 */
1134 void ERR_load_OBJ_strings();
1135
1136 /* Error codes for the OBJ functions. */
1137
1138 /* Function codes. */
1139 enum OBJ_F_OBJ_ADD_OBJECT = "105";
1140 enum OBJ_F_OBJ_CREATE = "100";
1141 enum OBJ_F_OBJ_DUP = "101";
1142 enum OBJ_F_OBJ_NAME_NEW_INDEX = "106";
1143 enum OBJ_F_OBJ_NID2LN = "102";
1144 enum OBJ_F_OBJ_NID2OBJ = "103";
1145 enum OBJ_F_OBJ_NID2SN = "104";
1146
1147 /* Reason codes. */
1148 enum OBJ_R_MALLOC_FAILURE = "100";
1149 enum OBJ_R_UNKNOWN_NID = "101";