]>
Commit | Line | Data |
---|---|---|
d02b48c6 | 1 | /* crypto/x509/x509.h */ |
58964a49 | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
d02b48c6 RE |
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 | #ifndef HEADER_X509_H | |
60 | #define HEADER_X509_H | |
61 | ||
62 | #ifdef __cplusplus | |
63 | extern "C" { | |
64 | #endif | |
65 | ||
7d7d2cbc UM |
66 | #ifdef VMS |
67 | #undef X509_REVOKED_get_ext_by_critical | |
68 | #define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic | |
69 | #endif | |
70 | ||
ec577822 BM |
71 | #include <openssl/stack.h> |
72 | #include <openssl/asn1.h> | |
73 | #include <openssl/safestack.h> | |
d02b48c6 RE |
74 | |
75 | #ifndef NO_RSA | |
ec577822 | 76 | #include <openssl/rsa.h> |
d02b48c6 RE |
77 | #endif |
78 | ||
79 | #ifndef NO_DSA | |
ec577822 | 80 | #include <openssl/dsa.h> |
d02b48c6 RE |
81 | #endif |
82 | ||
83 | #ifndef NO_DH | |
ec577822 | 84 | #include <openssl/dh.h> |
d02b48c6 RE |
85 | #endif |
86 | ||
ec577822 | 87 | #include <openssl/evp.h> |
d02b48c6 | 88 | |
4b55c2a3 DSH |
89 | |
90 | #ifdef WIN32 | |
91 | /* Under Win32 this is defined in wincrypt.h */ | |
92 | #undef X509_NAME | |
93 | #endif | |
94 | ||
d02b48c6 RE |
95 | #define X509_FILETYPE_PEM 1 |
96 | #define X509_FILETYPE_ASN1 2 | |
97 | #define X509_FILETYPE_DEFAULT 3 | |
98 | ||
58964a49 RE |
99 | #define X509v3_KU_DIGITAL_SIGNATURE 0x0080 |
100 | #define X509v3_KU_NON_REPUDIATION 0x0040 | |
101 | #define X509v3_KU_KEY_ENCIPHERMENT 0x0020 | |
102 | #define X509v3_KU_DATA_ENCIPHERMENT 0x0010 | |
103 | #define X509v3_KU_KEY_AGREEMENT 0x0008 | |
104 | #define X509v3_KU_KEY_CERT_SIGN 0x0004 | |
105 | #define X509v3_KU_CRL_SIGN 0x0002 | |
106 | #define X509v3_KU_ENCIPHER_ONLY 0x0001 | |
107 | #define X509v3_KU_DECIPHER_ONLY 0x8000 | |
108 | #define X509v3_KU_UNDEF 0xffff | |
109 | ||
110 | typedef struct X509_objects_st | |
111 | { | |
112 | int nid; | |
113 | int (*a2i)(); | |
114 | int (*i2a)(); | |
115 | } X509_OBJECTS; | |
116 | ||
d02b48c6 RE |
117 | typedef struct X509_algor_st |
118 | { | |
119 | ASN1_OBJECT *algorithm; | |
120 | ASN1_TYPE *parameter; | |
121 | } X509_ALGOR; | |
122 | ||
426edadf BL |
123 | DECLARE_STACK_OF(X509_ALGOR) |
124 | DECLARE_ASN1_SET_OF(X509_ALGOR) | |
125 | ||
d02b48c6 RE |
126 | typedef struct X509_val_st |
127 | { | |
128 | ASN1_UTCTIME *notBefore; | |
129 | ASN1_UTCTIME *notAfter; | |
130 | } X509_VAL; | |
131 | ||
132 | typedef struct X509_pubkey_st | |
133 | { | |
134 | X509_ALGOR *algor; | |
135 | ASN1_BIT_STRING *public_key; | |
cfdcfede | 136 | EVP_PKEY *pkey; |
d02b48c6 RE |
137 | } X509_PUBKEY; |
138 | ||
139 | typedef struct X509_sig_st | |
140 | { | |
141 | X509_ALGOR *algor; | |
142 | ASN1_OCTET_STRING *digest; | |
143 | } X509_SIG; | |
144 | ||
145 | typedef struct X509_name_entry_st | |
146 | { | |
147 | ASN1_OBJECT *object; | |
148 | ASN1_STRING *value; | |
149 | int set; | |
150 | int size; /* temp variable */ | |
151 | } X509_NAME_ENTRY; | |
152 | ||
65d4927b BL |
153 | DECLARE_STACK_OF(X509_NAME_ENTRY) |
154 | DECLARE_ASN1_SET_OF(X509_NAME_ENTRY) | |
155 | ||
d02b48c6 RE |
156 | /* we always keep X509_NAMEs in 2 forms. */ |
157 | typedef struct X509_name_st | |
158 | { | |
65d4927b | 159 | STACK_OF(X509_NAME_ENTRY) *entries; |
d02b48c6 RE |
160 | int modified; /* true if 'bytes' needs to be built */ |
161 | #ifdef HEADER_BUFFER_H | |
162 | BUF_MEM *bytes; | |
163 | #else | |
164 | char *bytes; | |
165 | #endif | |
58964a49 | 166 | unsigned long hash; /* Keep the hash around for lookups */ |
d02b48c6 RE |
167 | } X509_NAME; |
168 | ||
f73e07cf BL |
169 | DECLARE_STACK_OF(X509_NAME) |
170 | ||
58964a49 RE |
171 | #define X509_EX_V_NETSCAPE_HACK 0x8000 |
172 | #define X509_EX_V_INIT 0x0001 | |
d02b48c6 RE |
173 | typedef struct X509_extension_st |
174 | { | |
175 | ASN1_OBJECT *object; | |
176 | short critical; | |
177 | short netscape_hack; | |
178 | ASN1_OCTET_STRING *value; | |
3ea23631 DSH |
179 | struct v3_ext_method *method; /* V3 method to use */ |
180 | void *ext_val; /* extension value */ | |
d02b48c6 RE |
181 | } X509_EXTENSION; |
182 | ||
0b3f827c BL |
183 | DECLARE_STACK_OF(X509_EXTENSION) |
184 | DECLARE_ASN1_SET_OF(X509_EXTENSION) | |
185 | ||
d500de16 BL |
186 | /* a sequence of these are used */ |
187 | typedef struct x509_attributes_st | |
188 | { | |
189 | ASN1_OBJECT *object; | |
190 | int set; /* 1 for a set, 0 for a single item (which is wrong) */ | |
191 | union { | |
192 | char *ptr; | |
d35ea5b0 | 193 | /* 1 */ STACK_OF(ASN1_TYPE) *set; |
d500de16 BL |
194 | /* 0 */ ASN1_TYPE *single; |
195 | } value; | |
196 | } X509_ATTRIBUTE; | |
197 | ||
198 | DECLARE_STACK_OF(X509_ATTRIBUTE) | |
199 | DECLARE_ASN1_SET_OF(X509_ATTRIBUTE) | |
200 | ||
d02b48c6 RE |
201 | typedef struct X509_req_info_st |
202 | { | |
203 | ASN1_INTEGER *version; | |
204 | X509_NAME *subject; | |
205 | X509_PUBKEY *pubkey; | |
206 | /* d=2 hl=2 l= 0 cons: cont: 00 */ | |
d500de16 | 207 | STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ |
d02b48c6 RE |
208 | int req_kludge; |
209 | } X509_REQ_INFO; | |
210 | ||
211 | typedef struct X509_req_st | |
212 | { | |
213 | X509_REQ_INFO *req_info; | |
214 | X509_ALGOR *sig_alg; | |
215 | ASN1_BIT_STRING *signature; | |
216 | int references; | |
217 | } X509_REQ; | |
218 | ||
219 | typedef struct x509_cinf_st | |
220 | { | |
221 | ASN1_INTEGER *version; /* [ 0 ] default of v1 */ | |
222 | ASN1_INTEGER *serialNumber; | |
223 | X509_ALGOR *signature; | |
224 | X509_NAME *issuer; | |
225 | X509_VAL *validity; | |
226 | X509_NAME *subject; | |
227 | X509_PUBKEY *key; | |
228 | ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */ | |
229 | ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */ | |
0b3f827c | 230 | STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */ |
d02b48c6 RE |
231 | } X509_CINF; |
232 | ||
ce1b4fe1 DSH |
233 | /* This stuff is certificate "auxiliary info" |
234 | * it contains details which are useful in certificate | |
235 | * stores and databases. When used this is tagged onto | |
236 | * the end of the certificate itself | |
237 | */ | |
238 | ||
239 | /* Bit values for trust/notrust */ | |
240 | ||
d4cec6a1 DSH |
241 | #define X509_TRUST_BIT_ALL 0 |
242 | #define X509_TRUST_BIT_SSL_CLIENT 1 | |
243 | #define X509_TRUST_BIT_SSL_SERVER 2 | |
244 | #define X509_TRUST_BIT_EMAIL 3 | |
245 | #define X509_TRUST_BIT_OBJECT_SIGN 4 | |
246 | ||
ce1b4fe1 DSH |
247 | |
248 | typedef struct x509_cert_aux_st | |
249 | { | |
250 | ASN1_BIT_STRING *trust; /* trusted uses */ | |
251 | ASN1_BIT_STRING *notrust; /* rejected uses */ | |
252 | STACK_OF(ASN1_OBJECT) *othertrust; /* extra uses */ | |
253 | STACK_OF(ASN1_OBJECT) *othernotrust; /* extra rejected uses */ | |
254 | ASN1_UTF8STRING *alias; /* "friendly name" */ | |
255 | ASN1_TYPE *other; /* other unspecified info */ | |
256 | } X509_CERT_AUX; | |
257 | ||
d02b48c6 RE |
258 | typedef struct x509_st |
259 | { | |
260 | X509_CINF *cert_info; | |
261 | X509_ALGOR *sig_alg; | |
262 | ASN1_BIT_STRING *signature; | |
263 | int valid; | |
264 | int references; | |
265 | char *name; | |
56a3fec1 | 266 | CRYPTO_EX_DATA ex_data; |
673b102c DSH |
267 | /* These contain copies of various extension values */ |
268 | long ex_pathlen; | |
269 | unsigned long ex_flags; | |
270 | unsigned long ex_kusage; | |
271 | unsigned long ex_xkusage; | |
272 | unsigned long ex_nscert; | |
e947f396 | 273 | unsigned char sha1_hash[SHA_DIGEST_LENGTH]; |
ce1b4fe1 | 274 | X509_CERT_AUX *aux; |
d02b48c6 RE |
275 | } X509; |
276 | ||
f73e07cf BL |
277 | DECLARE_STACK_OF(X509) |
278 | DECLARE_ASN1_SET_OF(X509) | |
279 | ||
d4cec6a1 DSH |
280 | /* This is used for a table of trust checking functions */ |
281 | ||
282 | typedef struct x509_trust_st { | |
283 | int trust_id; | |
284 | int trust_flags; | |
285 | int (*check_trust)(struct x509_trust_st *, X509 *, int); | |
286 | char *trust_name; | |
287 | int trust_bit; | |
288 | void *usr_data; | |
289 | } X509_TRUST; | |
290 | ||
291 | /* X509 trust ids */ | |
292 | ||
293 | #define X509_TRUST_ANY 1 | |
294 | #define X509_TRUST_SSL_CLIENT 2 | |
295 | #define X509_TRUST_SSL_SERVER 3 | |
296 | #define X509_TRUST_EMAIL 4 | |
297 | ||
d02b48c6 RE |
298 | typedef struct X509_revoked_st |
299 | { | |
300 | ASN1_INTEGER *serialNumber; | |
301 | ASN1_UTCTIME *revocationDate; | |
0b3f827c | 302 | STACK_OF(X509_EXTENSION) /* optional */ *extensions; |
d02b48c6 RE |
303 | int sequence; /* load sequence */ |
304 | } X509_REVOKED; | |
305 | ||
ee8ba0b2 BL |
306 | DECLARE_STACK_OF(X509_REVOKED) |
307 | DECLARE_ASN1_SET_OF(X509_REVOKED) | |
308 | ||
d02b48c6 RE |
309 | typedef struct X509_crl_info_st |
310 | { | |
311 | ASN1_INTEGER *version; | |
312 | X509_ALGOR *sig_alg; | |
313 | X509_NAME *issuer; | |
314 | ASN1_UTCTIME *lastUpdate; | |
315 | ASN1_UTCTIME *nextUpdate; | |
ee8ba0b2 | 316 | STACK_OF(X509_REVOKED) *revoked; |
0b3f827c | 317 | STACK_OF(X509_EXTENSION) /* [0] */ *extensions; |
d02b48c6 RE |
318 | } X509_CRL_INFO; |
319 | ||
320 | typedef struct X509_crl_st | |
321 | { | |
322 | /* actual signature */ | |
323 | X509_CRL_INFO *crl; | |
324 | X509_ALGOR *sig_alg; | |
325 | ASN1_BIT_STRING *signature; | |
326 | int references; | |
327 | } X509_CRL; | |
328 | ||
6d114240 BL |
329 | DECLARE_STACK_OF(X509_CRL) |
330 | DECLARE_ASN1_SET_OF(X509_CRL) | |
331 | ||
d02b48c6 RE |
332 | typedef struct private_key_st |
333 | { | |
334 | int version; | |
335 | /* The PKCS#8 data types */ | |
336 | X509_ALGOR *enc_algor; | |
337 | ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */ | |
338 | ||
339 | /* When decrypted, the following will not be NULL */ | |
340 | EVP_PKEY *dec_pkey; | |
341 | ||
342 | /* used to encrypt and decrypt */ | |
343 | int key_length; | |
344 | char *key_data; | |
345 | int key_free; /* true if we should auto free key_data */ | |
346 | ||
347 | /* expanded version of 'enc_algor' */ | |
348 | EVP_CIPHER_INFO cipher; | |
349 | ||
350 | int references; | |
351 | } X509_PKEY; | |
352 | ||
353 | #ifdef HEADER_ENVELOPE_H | |
354 | typedef struct X509_info_st | |
355 | { | |
356 | X509 *x509; | |
357 | X509_CRL *crl; | |
358 | X509_PKEY *x_pkey; | |
359 | ||
360 | EVP_CIPHER_INFO enc_cipher; | |
361 | int enc_len; | |
362 | char *enc_data; | |
363 | ||
364 | int references; | |
365 | } X509_INFO; | |
20b85fdd RE |
366 | |
367 | DECLARE_STACK_OF(X509_INFO) | |
d02b48c6 RE |
368 | #endif |
369 | ||
370 | /* The next 2 structures and their 8 routines were sent to me by | |
371 | * Pat Richard <patr@x509.com> and are used to manipulate | |
372 | * Netscapes spki strucutres - usefull if you are writing a CA web page | |
373 | */ | |
374 | typedef struct Netscape_spkac_st | |
375 | { | |
376 | X509_PUBKEY *pubkey; | |
377 | ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */ | |
378 | } NETSCAPE_SPKAC; | |
379 | ||
380 | typedef struct Netscape_spki_st | |
381 | { | |
382 | NETSCAPE_SPKAC *spkac; /* signed public key and challenge */ | |
383 | X509_ALGOR *sig_algor; | |
384 | ASN1_BIT_STRING *signature; | |
385 | } NETSCAPE_SPKI; | |
386 | ||
92c046ca DSH |
387 | /* Netscape certificate sequence structure */ |
388 | typedef struct Netscape_certificate_sequence | |
389 | { | |
390 | ASN1_OBJECT *type; | |
e5e932d2 | 391 | STACK_OF(X509) *certs; |
92c046ca DSH |
392 | } NETSCAPE_CERT_SEQUENCE; |
393 | ||
d02b48c6 RE |
394 | typedef struct CBCParameter_st |
395 | { | |
396 | unsigned char iv[8]; | |
397 | } CBC_PARAM; | |
398 | ||
cfcefcbe DSH |
399 | /* Password based encryption structure */ |
400 | ||
401 | typedef struct PBEPARAM_st { | |
402 | ASN1_OCTET_STRING *salt; | |
403 | ASN1_INTEGER *iter; | |
404 | } PBEPARAM; | |
405 | ||
d2e26dcc DSH |
406 | /* Password based encryption V2 structures */ |
407 | ||
408 | typedef struct PBE2PARAM_st { | |
409 | X509_ALGOR *keyfunc; | |
410 | X509_ALGOR *encryption; | |
411 | } PBE2PARAM; | |
412 | ||
413 | typedef struct PBKDF2PARAM_st { | |
8e21c146 | 414 | ASN1_TYPE *salt; /* Usually OCTET STRING but could be anything */ |
d2e26dcc DSH |
415 | ASN1_INTEGER *iter; |
416 | ASN1_INTEGER *keylength; | |
417 | X509_ALGOR *prf; | |
418 | } PBKDF2PARAM; | |
419 | ||
420 | ||
cfcefcbe DSH |
421 | /* PKCS#8 private key info structure */ |
422 | ||
423 | typedef struct pkcs8_priv_key_info_st | |
424 | { | |
425 | int broken; /* Flag for various broken formats */ | |
426 | #define PKCS8_OK 0 | |
427 | #define PKCS8_NO_OCTET 1 | |
428 | ASN1_INTEGER *version; | |
429 | X509_ALGOR *pkeyalg; | |
430 | ASN1_TYPE *pkey; /* Should be OCTET STRING but some are broken */ | |
fc875472 | 431 | STACK_OF(X509_ATTRIBUTE) *attributes; |
cfcefcbe DSH |
432 | } PKCS8_PRIV_KEY_INFO; |
433 | ||
ec577822 BM |
434 | #include <openssl/x509_vfy.h> |
435 | #include <openssl/pkcs7.h> | |
d02b48c6 RE |
436 | |
437 | #ifdef SSLEAY_MACROS | |
438 | #define X509_verify(a,r) ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg,\ | |
439 | a->signature,(char *)a->cert_info,r) | |
440 | #define X509_REQ_verify(a,r) ASN1_verify((int (*)())i2d_X509_REQ_INFO, \ | |
441 | a->sig_alg,a->signature,(char *)a->req_info,r) | |
442 | #define X509_CRL_verify(a,r) ASN1_verify((int (*)())i2d_X509_CRL_INFO, \ | |
443 | a->sig_alg, a->signature,(char *)a->crl,r) | |
d02b48c6 RE |
444 | |
445 | #define X509_sign(x,pkey,md) \ | |
446 | ASN1_sign((int (*)())i2d_X509_CINF, x->cert_info->signature, \ | |
447 | x->sig_alg, x->signature, (char *)x->cert_info,pkey,md) | |
448 | #define X509_REQ_sign(x,pkey,md) \ | |
449 | ASN1_sign((int (*)())i2d_X509_REQ_INFO,x->sig_alg, NULL, \ | |
450 | x->signature, (char *)x->req_info,pkey,md) | |
451 | #define X509_CRL_sign(x,pkey,md) \ | |
452 | ASN1_sign((int (*)())i2d_X509_CRL_INFO,x->crl->sig_alg,x->sig_alg, \ | |
453 | x->signature, (char *)x->crl,pkey,md) | |
454 | #define NETSCAPE_SPKI_sign(x,pkey,md) \ | |
455 | ASN1_sign((int (*)())i2d_NETSCAPE_SPKAC, x->sig_algor,NULL, \ | |
456 | x->signature, (char *)x->spkac,pkey,md) | |
457 | ||
458 | #define X509_dup(x509) (X509 *)ASN1_dup((int (*)())i2d_X509, \ | |
459 | (char *(*)())d2i_X509,(char *)x509) | |
dfeab068 RE |
460 | #define X509_ATTRIBUTE_dup(xa) (X509_ATTRIBUTE *)ASN1_dup(\ |
461 | (int (*)())i2d_X509_ATTRIBUTE, \ | |
462 | (char *(*)())d2i_X509_ATTRIBUTE,(char *)xa) | |
d02b48c6 RE |
463 | #define X509_EXTENSION_dup(ex) (X509_EXTENSION *)ASN1_dup( \ |
464 | (int (*)())i2d_X509_EXTENSION, \ | |
465 | (char *(*)())d2i_X509_EXTENSION,(char *)ex) | |
466 | #define d2i_X509_fp(fp,x509) (X509 *)ASN1_d2i_fp((char *(*)())X509_new, \ | |
467 | (char *(*)())d2i_X509, (fp),(unsigned char **)(x509)) | |
468 | #define i2d_X509_fp(fp,x509) ASN1_i2d_fp(i2d_X509,fp,(unsigned char *)x509) | |
469 | #define d2i_X509_bio(bp,x509) (X509 *)ASN1_d2i_bio((char *(*)())X509_new, \ | |
470 | (char *(*)())d2i_X509, (bp),(unsigned char **)(x509)) | |
471 | #define i2d_X509_bio(bp,x509) ASN1_i2d_bio(i2d_X509,bp,(unsigned char *)x509) | |
472 | ||
473 | #define X509_CRL_dup(crl) (X509_CRL *)ASN1_dup((int (*)())i2d_X509_CRL, \ | |
474 | (char *(*)())d2i_X509_CRL,(char *)crl) | |
475 | #define d2i_X509_CRL_fp(fp,crl) (X509_CRL *)ASN1_d2i_fp((char *(*)()) \ | |
476 | X509_CRL_new,(char *(*)())d2i_X509_CRL, (fp),\ | |
477 | (unsigned char **)(crl)) | |
478 | #define i2d_X509_CRL_fp(fp,crl) ASN1_i2d_fp(i2d_X509_CRL,fp,\ | |
479 | (unsigned char *)crl) | |
480 | #define d2i_X509_CRL_bio(bp,crl) (X509_CRL *)ASN1_d2i_bio((char *(*)()) \ | |
481 | X509_CRL_new,(char *(*)())d2i_X509_CRL, (bp),\ | |
482 | (unsigned char **)(crl)) | |
483 | #define i2d_X509_CRL_bio(bp,crl) ASN1_i2d_bio(i2d_X509_CRL,bp,\ | |
484 | (unsigned char *)crl) | |
485 | ||
486 | #define PKCS7_dup(p7) (PKCS7 *)ASN1_dup((int (*)())i2d_PKCS7, \ | |
487 | (char *(*)())d2i_PKCS7,(char *)p7) | |
488 | #define d2i_PKCS7_fp(fp,p7) (PKCS7 *)ASN1_d2i_fp((char *(*)()) \ | |
489 | PKCS7_new,(char *(*)())d2i_PKCS7, (fp),\ | |
490 | (unsigned char **)(p7)) | |
491 | #define i2d_PKCS7_fp(fp,p7) ASN1_i2d_fp(i2d_PKCS7,fp,\ | |
492 | (unsigned char *)p7) | |
493 | #define d2i_PKCS7_bio(bp,p7) (PKCS7 *)ASN1_d2i_bio((char *(*)()) \ | |
494 | PKCS7_new,(char *(*)())d2i_PKCS7, (bp),\ | |
495 | (unsigned char **)(p7)) | |
496 | #define i2d_PKCS7_bio(bp,p7) ASN1_i2d_bio(i2d_PKCS7,bp,\ | |
497 | (unsigned char *)p7) | |
498 | ||
499 | #define X509_REQ_dup(req) (X509_REQ *)ASN1_dup((int (*)())i2d_X509_REQ, \ | |
500 | (char *(*)())d2i_X509_REQ,(char *)req) | |
501 | #define d2i_X509_REQ_fp(fp,req) (X509_REQ *)ASN1_d2i_fp((char *(*)())\ | |
502 | X509_REQ_new, (char *(*)())d2i_X509_REQ, (fp),\ | |
503 | (unsigned char **)(req)) | |
504 | #define i2d_X509_REQ_fp(fp,req) ASN1_i2d_fp(i2d_X509_REQ,fp,\ | |
505 | (unsigned char *)req) | |
506 | #define d2i_X509_REQ_bio(bp,req) (X509_REQ *)ASN1_d2i_bio((char *(*)())\ | |
507 | X509_REQ_new, (char *(*)())d2i_X509_REQ, (bp),\ | |
508 | (unsigned char **)(req)) | |
509 | #define i2d_X509_REQ_bio(bp,req) ASN1_i2d_bio(i2d_X509_REQ,bp,\ | |
510 | (unsigned char *)req) | |
511 | ||
512 | #define RSAPublicKey_dup(rsa) (RSA *)ASN1_dup((int (*)())i2d_RSAPublicKey, \ | |
513 | (char *(*)())d2i_RSAPublicKey,(char *)rsa) | |
514 | #define RSAPrivateKey_dup(rsa) (RSA *)ASN1_dup((int (*)())i2d_RSAPrivateKey, \ | |
515 | (char *(*)())d2i_RSAPrivateKey,(char *)rsa) | |
516 | ||
517 | #define d2i_RSAPrivateKey_fp(fp,rsa) (RSA *)ASN1_d2i_fp((char *(*)())\ | |
518 | RSA_new,(char *(*)())d2i_RSAPrivateKey, (fp), \ | |
519 | (unsigned char **)(rsa)) | |
520 | #define i2d_RSAPrivateKey_fp(fp,rsa) ASN1_i2d_fp(i2d_RSAPrivateKey,fp, \ | |
521 | (unsigned char *)rsa) | |
522 | #define d2i_RSAPrivateKey_bio(bp,rsa) (RSA *)ASN1_d2i_bio((char *(*)())\ | |
523 | RSA_new,(char *(*)())d2i_RSAPrivateKey, (bp), \ | |
524 | (unsigned char **)(rsa)) | |
525 | #define i2d_RSAPrivateKey_bio(bp,rsa) ASN1_i2d_bio(i2d_RSAPrivateKey,bp, \ | |
526 | (unsigned char *)rsa) | |
527 | ||
528 | #define d2i_RSAPublicKey_fp(fp,rsa) (RSA *)ASN1_d2i_fp((char *(*)())\ | |
529 | RSA_new,(char *(*)())d2i_RSAPublicKey, (fp), \ | |
530 | (unsigned char **)(rsa)) | |
531 | #define i2d_RSAPublicKey_fp(fp,rsa) ASN1_i2d_fp(i2d_RSAPublicKey,fp, \ | |
532 | (unsigned char *)rsa) | |
533 | #define d2i_RSAPublicKey_bio(bp,rsa) (RSA *)ASN1_d2i_bio((char *(*)())\ | |
534 | RSA_new,(char *(*)())d2i_RSAPublicKey, (bp), \ | |
535 | (unsigned char **)(rsa)) | |
536 | #define i2d_RSAPublicKey_bio(bp,rsa) ASN1_i2d_bio(i2d_RSAPublicKey,bp, \ | |
537 | (unsigned char *)rsa) | |
538 | ||
539 | #define d2i_DSAPrivateKey_fp(fp,dsa) (DSA *)ASN1_d2i_fp((char *(*)())\ | |
540 | DSA_new,(char *(*)())d2i_DSAPrivateKey, (fp), \ | |
541 | (unsigned char **)(dsa)) | |
542 | #define i2d_DSAPrivateKey_fp(fp,dsa) ASN1_i2d_fp(i2d_DSAPrivateKey,fp, \ | |
543 | (unsigned char *)dsa) | |
544 | #define d2i_DSAPrivateKey_bio(bp,dsa) (DSA *)ASN1_d2i_bio((char *(*)())\ | |
545 | DSA_new,(char *(*)())d2i_DSAPrivateKey, (bp), \ | |
546 | (unsigned char **)(dsa)) | |
547 | #define i2d_DSAPrivateKey_bio(bp,dsa) ASN1_i2d_bio(i2d_DSAPrivateKey,bp, \ | |
548 | (unsigned char *)dsa) | |
549 | ||
dfeab068 RE |
550 | #define X509_ALGOR_dup(xn) (X509_ALGOR *)ASN1_dup((int (*)())i2d_X509_ALGOR,\ |
551 | (char *(*)())d2i_X509_ALGOR,(char *)xn) | |
552 | ||
d02b48c6 RE |
553 | #define X509_NAME_dup(xn) (X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, \ |
554 | (char *(*)())d2i_X509_NAME,(char *)xn) | |
555 | #define X509_NAME_ENTRY_dup(ne) (X509_NAME_ENTRY *)ASN1_dup( \ | |
556 | (int (*)())i2d_X509_NAME_ENTRY, \ | |
557 | (char *(*)())d2i_X509_NAME_ENTRY,\ | |
558 | (char *)ne) | |
559 | ||
560 | #define X509_digest(data,type,md,len) \ | |
561 | ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len) | |
562 | #define X509_NAME_digest(data,type,md,len) \ | |
563 | ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len) | |
dfeab068 | 564 | #ifndef PKCS7_ISSUER_AND_SERIAL_digest |
d02b48c6 RE |
565 | #define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \ |
566 | ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\ | |
567 | (char *)data,md,len) | |
568 | #endif | |
dfeab068 | 569 | #endif |
d02b48c6 | 570 | |
58964a49 RE |
571 | #define X509_EXT_PACK_UNKNOWN 1 |
572 | #define X509_EXT_PACK_STRING 2 | |
573 | ||
d02b48c6 RE |
574 | #define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version) |
575 | /* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */ | |
576 | #define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore) | |
577 | #define X509_get_notAfter(x) ((x)->cert_info->validity->notAfter) | |
578 | #define X509_extract_key(x) X509_get_pubkey(x) /*****/ | |
579 | #define X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version) | |
580 | #define X509_REQ_get_subject_name(x) ((x)->req_info->subject) | |
581 | #define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a) | |
582 | #define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) | |
583 | #define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm)) | |
584 | ||
0ca5f8b1 DSH |
585 | #define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version) |
586 | #define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate) | |
587 | #define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate) | |
588 | #define X509_CRL_get_issuer(x) ((x)->crl->issuer) | |
589 | #define X509_CRL_get_REVOKED(x) ((x)->crl->revoked) | |
590 | ||
d02b48c6 RE |
591 | /* This one is only used so that a binary form can output, as in |
592 | * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) */ | |
593 | #define X509_get_X509_PUBKEY(x) ((x)->cert_info->key) | |
594 | ||
d02b48c6 | 595 | |
16bc9fea BM |
596 | const char *X509_verify_cert_error_string(long n); |
597 | ||
d02b48c6 RE |
598 | #ifndef SSLEAY_MACROS |
599 | #ifdef HEADER_ENVELOPE_H | |
600 | int X509_verify(X509 *a, EVP_PKEY *r); | |
d02b48c6 RE |
601 | |
602 | int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); | |
603 | int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); | |
604 | int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r); | |
605 | ||
092ec334 | 606 | NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len); |
8ce97163 DSH |
607 | char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x); |
608 | EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x); | |
609 | int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey); | |
610 | ||
611 | int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); | |
612 | ||
e778802f BL |
613 | int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); |
614 | int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); | |
615 | int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); | |
616 | int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); | |
d02b48c6 RE |
617 | |
618 | int X509_digest(X509 *data,EVP_MD *type,unsigned char *md,unsigned int *len); | |
619 | int X509_NAME_digest(X509_NAME *data,EVP_MD *type, | |
620 | unsigned char *md,unsigned int *len); | |
621 | #endif | |
622 | ||
58964a49 | 623 | #ifndef NO_FP_API |
31a352d1 | 624 | X509 *d2i_X509_fp(FILE *fp, X509 **x509); |
d02b48c6 | 625 | int i2d_X509_fp(FILE *fp,X509 *x509); |
31a352d1 | 626 | X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl); |
d02b48c6 | 627 | int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl); |
31a352d1 | 628 | X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req); |
d02b48c6 | 629 | int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req); |
f5d7a031 | 630 | #ifndef NO_RSA |
31a352d1 | 631 | RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa); |
d02b48c6 | 632 | int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa); |
31a352d1 | 633 | RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA **rsa); |
d02b48c6 | 634 | int i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa); |
52664f50 DSH |
635 | RSA *d2i_RSA_PUBKEY_fp(FILE *fp,RSA **rsa); |
636 | int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa); | |
d02b48c6 | 637 | #endif |
f5d7a031 | 638 | #ifndef NO_DSA |
52664f50 DSH |
639 | DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); |
640 | int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); | |
31a352d1 | 641 | DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); |
f5d7a031 | 642 | int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); |
3cbb7937 DSH |
643 | X509_SIG *d2i_PKCS8_fp(FILE *fp,X509_SIG **p8); |
644 | int i2d_PKCS8_fp(FILE *fp,X509_SIG *p8); | |
645 | PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, | |
646 | PKCS8_PRIV_KEY_INFO **p8inf); | |
647 | int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,PKCS8_PRIV_KEY_INFO *p8inf); | |
f5d7a031 UM |
648 | #endif |
649 | #endif | |
d02b48c6 RE |
650 | |
651 | #ifdef HEADER_BIO_H | |
31a352d1 | 652 | X509 *d2i_X509_bio(BIO *bp,X509 **x509); |
d02b48c6 | 653 | int i2d_X509_bio(BIO *bp,X509 *x509); |
31a352d1 | 654 | X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl); |
d02b48c6 | 655 | int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl); |
31a352d1 | 656 | X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req); |
d02b48c6 | 657 | int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req); |
f5d7a031 | 658 | #ifndef NO_RSA |
31a352d1 | 659 | RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa); |
d02b48c6 | 660 | int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa); |
31a352d1 | 661 | RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA **rsa); |
d02b48c6 | 662 | int i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa); |
52664f50 DSH |
663 | RSA *d2i_RSA_PUBKEY_bio(BIO *bp,RSA **rsa); |
664 | int i2d_RSA_PUBKEY_bio(BIO *bp,RSA *rsa); | |
d02b48c6 | 665 | #endif |
f5d7a031 | 666 | #ifndef NO_DSA |
52664f50 DSH |
667 | DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa); |
668 | int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa); | |
31a352d1 | 669 | DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa); |
f5d7a031 | 670 | int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa); |
5271ebd9 | 671 | #endif |
3cbb7937 DSH |
672 | X509_SIG *d2i_PKCS8_bio(BIO *bp,X509_SIG **p8); |
673 | int i2d_PKCS8_bio(BIO *bp,X509_SIG *p8); | |
674 | PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, | |
675 | PKCS8_PRIV_KEY_INFO **p8inf); | |
676 | int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,PKCS8_PRIV_KEY_INFO *p8inf); | |
f5d7a031 | 677 | #endif |
d02b48c6 RE |
678 | |
679 | X509 *X509_dup(X509 *x509); | |
dfeab068 | 680 | X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa); |
d02b48c6 RE |
681 | X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex); |
682 | X509_CRL *X509_CRL_dup(X509_CRL *crl); | |
683 | X509_REQ *X509_REQ_dup(X509_REQ *req); | |
dfeab068 | 684 | X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn); |
d02b48c6 RE |
685 | X509_NAME *X509_NAME_dup(X509_NAME *xn); |
686 | X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); | |
f5d7a031 | 687 | #ifndef NO_RSA |
d02b48c6 RE |
688 | RSA *RSAPublicKey_dup(RSA *rsa); |
689 | RSA *RSAPrivateKey_dup(RSA *rsa); | |
f5d7a031 | 690 | #endif |
d02b48c6 RE |
691 | |
692 | #endif /* !SSLEAY_MACROS */ | |
693 | ||
694 | int X509_cmp_current_time(ASN1_UTCTIME *s); | |
695 | ASN1_UTCTIME * X509_gmtime_adj(ASN1_UTCTIME *s, long adj); | |
696 | ||
e778802f BL |
697 | const char * X509_get_default_cert_area(void ); |
698 | const char * X509_get_default_cert_dir(void ); | |
699 | const char * X509_get_default_cert_file(void ); | |
700 | const char * X509_get_default_cert_dir_env(void ); | |
701 | const char * X509_get_default_cert_file_env(void ); | |
702 | const char * X509_get_default_private_dir(void ); | |
d02b48c6 | 703 | |
58964a49 | 704 | X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, EVP_MD *md); |
d02b48c6 RE |
705 | X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey); |
706 | void ERR_load_X509_strings(void ); | |
707 | ||
708 | X509_ALGOR * X509_ALGOR_new(void ); | |
709 | void X509_ALGOR_free(X509_ALGOR *a); | |
710 | int i2d_X509_ALGOR(X509_ALGOR *a,unsigned char **pp); | |
711 | X509_ALGOR * d2i_X509_ALGOR(X509_ALGOR **a,unsigned char **pp, | |
712 | long length); | |
713 | ||
714 | X509_VAL * X509_VAL_new(void ); | |
715 | void X509_VAL_free(X509_VAL *a); | |
716 | int i2d_X509_VAL(X509_VAL *a,unsigned char **pp); | |
717 | X509_VAL * d2i_X509_VAL(X509_VAL **a,unsigned char **pp, | |
718 | long length); | |
719 | ||
720 | X509_PUBKEY * X509_PUBKEY_new(void ); | |
721 | void X509_PUBKEY_free(X509_PUBKEY *a); | |
722 | int i2d_X509_PUBKEY(X509_PUBKEY *a,unsigned char **pp); | |
723 | X509_PUBKEY * d2i_X509_PUBKEY(X509_PUBKEY **a,unsigned char **pp, | |
724 | long length); | |
725 | int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); | |
726 | EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); | |
7e258a56 BL |
727 | int X509_get_pubkey_parameters(EVP_PKEY *pkey, |
728 | STACK_OF(X509) *chain); | |
52664f50 DSH |
729 | int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp); |
730 | EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,unsigned char **pp, | |
731 | long length); | |
732 | int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp); | |
733 | RSA * d2i_RSA_PUBKEY(RSA **a,unsigned char **pp, | |
734 | long length); | |
735 | int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp); | |
736 | DSA * d2i_DSA_PUBKEY(DSA **a,unsigned char **pp, | |
737 | long length); | |
d02b48c6 RE |
738 | |
739 | X509_SIG * X509_SIG_new(void ); | |
740 | void X509_SIG_free(X509_SIG *a); | |
741 | int i2d_X509_SIG(X509_SIG *a,unsigned char **pp); | |
742 | X509_SIG * d2i_X509_SIG(X509_SIG **a,unsigned char **pp,long length); | |
743 | ||
744 | X509_REQ_INFO *X509_REQ_INFO_new(void); | |
745 | void X509_REQ_INFO_free(X509_REQ_INFO *a); | |
746 | int i2d_X509_REQ_INFO(X509_REQ_INFO *a,unsigned char **pp); | |
747 | X509_REQ_INFO *d2i_X509_REQ_INFO(X509_REQ_INFO **a,unsigned char **pp, | |
748 | long length); | |
749 | ||
750 | X509_REQ * X509_REQ_new(void); | |
751 | void X509_REQ_free(X509_REQ *a); | |
752 | int i2d_X509_REQ(X509_REQ *a,unsigned char **pp); | |
753 | X509_REQ * d2i_X509_REQ(X509_REQ **a,unsigned char **pp,long length); | |
754 | ||
755 | X509_ATTRIBUTE *X509_ATTRIBUTE_new(void ); | |
756 | void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a); | |
757 | int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a,unsigned char **pp); | |
758 | X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a,unsigned char **pp, | |
759 | long length); | |
c8b41850 | 760 | X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value); |
dfeab068 | 761 | |
d02b48c6 RE |
762 | |
763 | X509_EXTENSION *X509_EXTENSION_new(void ); | |
764 | void X509_EXTENSION_free(X509_EXTENSION *a); | |
765 | int i2d_X509_EXTENSION(X509_EXTENSION *a,unsigned char **pp); | |
766 | X509_EXTENSION *d2i_X509_EXTENSION(X509_EXTENSION **a,unsigned char **pp, | |
767 | long length); | |
768 | ||
769 | X509_NAME_ENTRY *X509_NAME_ENTRY_new(void); | |
770 | void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a); | |
771 | int i2d_X509_NAME_ENTRY(X509_NAME_ENTRY *a,unsigned char **pp); | |
772 | X509_NAME_ENTRY *d2i_X509_NAME_ENTRY(X509_NAME_ENTRY **a,unsigned char **pp, | |
773 | long length); | |
774 | ||
775 | X509_NAME * X509_NAME_new(void); | |
776 | void X509_NAME_free(X509_NAME *a); | |
777 | int i2d_X509_NAME(X509_NAME *a,unsigned char **pp); | |
778 | X509_NAME * d2i_X509_NAME(X509_NAME **a,unsigned char **pp,long length); | |
779 | int X509_NAME_set(X509_NAME **xn, X509_NAME *name); | |
780 | ||
781 | ||
782 | X509_CINF * X509_CINF_new(void); | |
783 | void X509_CINF_free(X509_CINF *a); | |
784 | int i2d_X509_CINF(X509_CINF *a,unsigned char **pp); | |
785 | X509_CINF * d2i_X509_CINF(X509_CINF **a,unsigned char **pp,long length); | |
786 | ||
787 | X509 * X509_new(void); | |
788 | void X509_free(X509 *a); | |
789 | int i2d_X509(X509 *a,unsigned char **pp); | |
790 | X509 * d2i_X509(X509 **a,unsigned char **pp,long length); | |
56a3fec1 DSH |
791 | int X509_get_ex_new_index(long argl, char *argp, int (*new_func)(), |
792 | int (*dup_func)(), void (*free_func)()); | |
793 | int X509_set_ex_data(X509 *r, int idx, char *arg); | |
794 | char *X509_get_ex_data(X509 *r, int idx); | |
ce1b4fe1 DSH |
795 | int i2d_X509_AUX(X509 *a,unsigned char **pp); |
796 | X509 * d2i_X509_AUX(X509 **a,unsigned char **pp,long length); | |
797 | ||
798 | X509_CERT_AUX * X509_CERT_AUX_new(void); | |
799 | void X509_CERT_AUX_free(X509_CERT_AUX *a); | |
800 | int i2d_X509_CERT_AUX(X509_CERT_AUX *a,unsigned char **pp); | |
801 | X509_CERT_AUX * d2i_X509_CERT_AUX(X509_CERT_AUX **a,unsigned char **pp, | |
802 | long length); | |
803 | int X509_alias_set(X509 *x, unsigned char *name, int len); | |
804 | unsigned char * X509_alias_get(X509 *x, int *len); | |
805 | int X509_trust_set_bit(X509 *x, int bit, int value); | |
806 | int X509_notrust_set_bit(X509 *x, int bit, int value); | |
807 | int X509_add_trust_object(X509 *x, ASN1_OBJECT *obj); | |
808 | int X509_add_notrust_object(X509 *x, ASN1_OBJECT *obj); | |
809 | ||
810 | int X509_trust_set_bit_asc(X509 *x, char *str, int value); | |
811 | int X509_notrust_set_bit_asc(X509 *x, char *str, int value); | |
d02b48c6 RE |
812 | |
813 | X509_REVOKED * X509_REVOKED_new(void); | |
814 | void X509_REVOKED_free(X509_REVOKED *a); | |
815 | int i2d_X509_REVOKED(X509_REVOKED *a,unsigned char **pp); | |
816 | X509_REVOKED * d2i_X509_REVOKED(X509_REVOKED **a,unsigned char **pp,long length); | |
817 | ||
818 | X509_CRL_INFO *X509_CRL_INFO_new(void); | |
819 | void X509_CRL_INFO_free(X509_CRL_INFO *a); | |
820 | int i2d_X509_CRL_INFO(X509_CRL_INFO *a,unsigned char **pp); | |
821 | X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a,unsigned char **pp, | |
822 | long length); | |
823 | ||
824 | X509_CRL * X509_CRL_new(void); | |
825 | void X509_CRL_free(X509_CRL *a); | |
826 | int i2d_X509_CRL(X509_CRL *a,unsigned char **pp); | |
827 | X509_CRL * d2i_X509_CRL(X509_CRL **a,unsigned char **pp,long length); | |
828 | ||
829 | X509_PKEY * X509_PKEY_new(void ); | |
830 | void X509_PKEY_free(X509_PKEY *a); | |
831 | int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp); | |
832 | X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,unsigned char **pp,long length); | |
833 | ||
834 | NETSCAPE_SPKI * NETSCAPE_SPKI_new(void ); | |
835 | void NETSCAPE_SPKI_free(NETSCAPE_SPKI *a); | |
836 | int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a,unsigned char **pp); | |
837 | NETSCAPE_SPKI * d2i_NETSCAPE_SPKI(NETSCAPE_SPKI **a,unsigned char **pp, | |
838 | long length); | |
839 | ||
840 | NETSCAPE_SPKAC *NETSCAPE_SPKAC_new(void ); | |
841 | void NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a); | |
842 | int i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC *a,unsigned char **pp); | |
843 | NETSCAPE_SPKAC *d2i_NETSCAPE_SPKAC(NETSCAPE_SPKAC **a,unsigned char **pp, | |
844 | long length); | |
845 | ||
92c046ca DSH |
846 | |
847 | int i2d_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE *a, unsigned char **pp); | |
848 | NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new(void); | |
849 | NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a, unsigned char **pp, long length); | |
850 | void NETSCAPE_CERT_SEQUENCE_free(NETSCAPE_CERT_SEQUENCE *a); | |
851 | ||
d02b48c6 RE |
852 | #ifdef HEADER_ENVELOPE_H |
853 | X509_INFO * X509_INFO_new(void); | |
854 | void X509_INFO_free(X509_INFO *a); | |
855 | char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); | |
856 | ||
857 | int ASN1_verify(int (*i2d)(), X509_ALGOR *algor1, | |
858 | ASN1_BIT_STRING *signature,char *data,EVP_PKEY *pkey); | |
859 | ||
860 | int ASN1_digest(int (*i2d)(),EVP_MD *type,char *data, | |
861 | unsigned char *md,unsigned int *len); | |
862 | ||
863 | int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, | |
864 | ASN1_BIT_STRING *signature, | |
e778802f | 865 | char *data,EVP_PKEY *pkey, const EVP_MD *type); |
d02b48c6 RE |
866 | #endif |
867 | ||
868 | int X509_set_version(X509 *x,long version); | |
869 | int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); | |
870 | ASN1_INTEGER * X509_get_serialNumber(X509 *x); | |
871 | int X509_set_issuer_name(X509 *x, X509_NAME *name); | |
872 | X509_NAME * X509_get_issuer_name(X509 *a); | |
873 | int X509_set_subject_name(X509 *x, X509_NAME *name); | |
874 | X509_NAME * X509_get_subject_name(X509 *a); | |
875 | int X509_set_notBefore(X509 *x, ASN1_UTCTIME *tm); | |
876 | int X509_set_notAfter(X509 *x, ASN1_UTCTIME *tm); | |
877 | int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); | |
878 | EVP_PKEY * X509_get_pubkey(X509 *x); | |
879 | int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */); | |
880 | ||
881 | int X509_REQ_set_version(X509_REQ *x,long version); | |
882 | int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name); | |
883 | int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); | |
884 | EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); | |
87c49f62 DSH |
885 | int X509_REQ_extension_nid(int nid); |
886 | int * X509_REQ_get_extesion_nids(void); | |
887 | void X509_REQ_set_extension_nids(int *nids); | |
888 | STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req); | |
fd520577 DSH |
889 | int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, |
890 | int nid); | |
891 | int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts); | |
d02b48c6 RE |
892 | |
893 | int X509_check_private_key(X509 *x509,EVP_PKEY *pkey); | |
894 | ||
895 | int X509_issuer_and_serial_cmp(X509 *a, X509 *b); | |
896 | unsigned long X509_issuer_and_serial_hash(X509 *a); | |
897 | ||
898 | int X509_issuer_name_cmp(X509 *a, X509 *b); | |
899 | unsigned long X509_issuer_name_hash(X509 *a); | |
900 | ||
901 | int X509_subject_name_cmp(X509 *a,X509 *b); | |
902 | unsigned long X509_subject_name_hash(X509 *x); | |
903 | ||
e947f396 | 904 | int X509_cmp (X509 *a, X509 *b); |
d02b48c6 RE |
905 | int X509_NAME_cmp (X509_NAME *a, X509_NAME *b); |
906 | unsigned long X509_NAME_hash(X509_NAME *x); | |
907 | ||
908 | int X509_CRL_cmp(X509_CRL *a,X509_CRL *b); | |
58964a49 | 909 | #ifndef NO_FP_API |
d02b48c6 | 910 | int X509_print_fp(FILE *bp,X509 *x); |
0ca5f8b1 | 911 | int X509_CRL_print_fp(FILE *bp,X509_CRL *x); |
d02b48c6 RE |
912 | int X509_REQ_print_fp(FILE *bp,X509_REQ *req); |
913 | #endif | |
914 | ||
915 | #ifdef HEADER_BIO_H | |
916 | int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); | |
917 | int X509_print(BIO *bp,X509 *x); | |
ce1b4fe1 | 918 | int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent); |
0ca5f8b1 | 919 | int X509_CRL_print(BIO *bp,X509_CRL *x); |
d02b48c6 RE |
920 | int X509_REQ_print(BIO *bp,X509_REQ *req); |
921 | #endif | |
922 | ||
923 | int X509_NAME_entry_count(X509_NAME *name); | |
924 | int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, | |
925 | char *buf,int len); | |
926 | int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, | |
927 | char *buf,int len); | |
928 | ||
58964a49 RE |
929 | /* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use |
930 | * lastpos, seach after that position on. */ | |
931 | int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos); | |
d02b48c6 | 932 | int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj, |
58964a49 | 933 | int lastpos); |
d02b48c6 RE |
934 | X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); |
935 | X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); | |
936 | int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne, | |
937 | int loc, int set); | |
74400f73 DSH |
938 | int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, |
939 | unsigned char *bytes, int len, int loc, int set); | |
940 | int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, | |
941 | unsigned char *bytes, int len, int loc, int set); | |
942 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, | |
943 | char *field, int type, unsigned char *bytes, int len); | |
d02b48c6 RE |
944 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, |
945 | int type,unsigned char *bytes, int len); | |
74400f73 DSH |
946 | int X509_NAME_add_entry_by_txt(X509_NAME *name, char *field, int type, |
947 | unsigned char *bytes, int len, int loc, int set); | |
d02b48c6 RE |
948 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, |
949 | ASN1_OBJECT *obj, int type,unsigned char *bytes, | |
950 | int len); | |
951 | int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, | |
952 | ASN1_OBJECT *obj); | |
953 | int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, | |
954 | unsigned char *bytes, int len); | |
955 | ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne); | |
956 | ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne); | |
957 | ||
0b3f827c BL |
958 | int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); |
959 | int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, | |
960 | int nid, int lastpos); | |
961 | int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, | |
962 | ASN1_OBJECT *obj,int lastpos); | |
963 | int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, | |
964 | int crit, int lastpos); | |
965 | X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc); | |
966 | X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc); | |
967 | STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, | |
968 | X509_EXTENSION *ex, int loc); | |
58964a49 | 969 | |
d02b48c6 | 970 | int X509_get_ext_count(X509 *x); |
58964a49 RE |
971 | int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); |
972 | int X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,int lastpos); | |
973 | int X509_get_ext_by_critical(X509 *x, int crit, int lastpos); | |
d02b48c6 RE |
974 | X509_EXTENSION *X509_get_ext(X509 *x, int loc); |
975 | X509_EXTENSION *X509_delete_ext(X509 *x, int loc); | |
976 | int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); | |
977 | ||
978 | int X509_CRL_get_ext_count(X509_CRL *x); | |
58964a49 RE |
979 | int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos); |
980 | int X509_CRL_get_ext_by_OBJ(X509_CRL *x,ASN1_OBJECT *obj,int lastpos); | |
981 | int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos); | |
d02b48c6 RE |
982 | X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc); |
983 | X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); | |
984 | int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); | |
985 | ||
986 | int X509_REVOKED_get_ext_count(X509_REVOKED *x); | |
58964a49 RE |
987 | int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos); |
988 | int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x,ASN1_OBJECT *obj,int lastpos); | |
989 | int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos); | |
d02b48c6 RE |
990 | X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc); |
991 | X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); | |
992 | int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); | |
993 | ||
994 | X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, | |
995 | int nid, int crit, ASN1_OCTET_STRING *data); | |
996 | X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, | |
997 | ASN1_OBJECT *obj,int crit,ASN1_OCTET_STRING *data); | |
998 | int X509_EXTENSION_set_object(X509_EXTENSION *ex,ASN1_OBJECT *obj); | |
999 | int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit); | |
1000 | int X509_EXTENSION_set_data(X509_EXTENSION *ex, | |
1001 | ASN1_OCTET_STRING *data); | |
1002 | ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex); | |
1003 | ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); | |
1004 | int X509_EXTENSION_get_critical(X509_EXTENSION *ex); | |
d02b48c6 RE |
1005 | |
1006 | int X509_verify_cert(X509_STORE_CTX *ctx); | |
1007 | ||
1008 | /* lookup a cert from a X509 STACK */ | |
f73e07cf BL |
1009 | X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name, |
1010 | ASN1_INTEGER *serial); | |
1011 | X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name); | |
d02b48c6 | 1012 | |
cfcefcbe DSH |
1013 | int i2d_PBEPARAM(PBEPARAM *a, unsigned char **pp); |
1014 | PBEPARAM *PBEPARAM_new(void); | |
1015 | PBEPARAM *d2i_PBEPARAM(PBEPARAM **a, unsigned char **pp, long length); | |
1016 | void PBEPARAM_free(PBEPARAM *a); | |
8d8c7266 | 1017 | X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, int saltlen); |
8eb57af5 DSH |
1018 | X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, |
1019 | unsigned char *salt, int saltlen); | |
cfcefcbe | 1020 | |
d2e26dcc DSH |
1021 | int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **pp); |
1022 | PBKDF2PARAM *PBKDF2PARAM_new(void); | |
1023 | PBKDF2PARAM *d2i_PBKDF2PARAM(PBKDF2PARAM **a, unsigned char **pp, long length); | |
1024 | void PBKDF2PARAM_free(PBKDF2PARAM *a); | |
1025 | ||
1026 | int i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **pp); | |
1027 | PBE2PARAM *PBE2PARAM_new(void); | |
1028 | PBE2PARAM *d2i_PBE2PARAM(PBE2PARAM **a, unsigned char **pp, long length); | |
1029 | void PBE2PARAM_free(PBE2PARAM *a); | |
1030 | ||
cfcefcbe DSH |
1031 | /* PKCS#8 utilities */ |
1032 | ||
1033 | int i2d_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO *a, unsigned char **pp); | |
1034 | PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new(void); | |
1035 | PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a, | |
1036 | unsigned char **pp, long length); | |
1037 | void PKCS8_PRIV_KEY_INFO_free(PKCS8_PRIV_KEY_INFO *a); | |
1038 | ||
1039 | EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8); | |
1040 | PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey); | |
1041 | PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken); | |
1042 | ||
d02b48c6 | 1043 | /* BEGIN ERROR CODES */ |
6d311938 DSH |
1044 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
1045 | * made after this point may be overwritten when the script is next run. | |
1046 | */ | |
1047 | ||
d02b48c6 RE |
1048 | /* Error codes for the X509 functions. */ |
1049 | ||
1050 | /* Function codes. */ | |
1051 | #define X509_F_ADD_CERT_DIR 100 | |
1052 | #define X509_F_BY_FILE_CTRL 101 | |
1053 | #define X509_F_DIR_CTRL 102 | |
1054 | #define X509_F_GET_CERT_BY_SUBJECT 103 | |
8ce97163 DSH |
1055 | #define X509_F_NETSCAPE_SPKI_B64_DECODE 129 |
1056 | #define X509_F_NETSCAPE_SPKI_B64_ENCODE 130 | |
d02b48c6 | 1057 | #define X509_F_X509V3_ADD_EXT 104 |
4004dbb7 | 1058 | #define X509_F_X509_CHECK_PRIVATE_KEY 128 |
d02b48c6 RE |
1059 | #define X509_F_X509_EXTENSION_CREATE_BY_NID 108 |
1060 | #define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109 | |
1061 | #define X509_F_X509_GET_PUBKEY_PARAMETERS 110 | |
52664f50 | 1062 | #define X509_F_X509_LOAD_CERT_CRL_FILE 132 |
d02b48c6 | 1063 | #define X509_F_X509_LOAD_CERT_FILE 111 |
58964a49 RE |
1064 | #define X509_F_X509_LOAD_CRL_FILE 112 |
1065 | #define X509_F_X509_NAME_ADD_ENTRY 113 | |
1066 | #define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114 | |
74400f73 | 1067 | #define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131 |
58964a49 RE |
1068 | #define X509_F_X509_NAME_ENTRY_SET_OBJECT 115 |
1069 | #define X509_F_X509_NAME_ONELINE 116 | |
1070 | #define X509_F_X509_NAME_PRINT 117 | |
1071 | #define X509_F_X509_PRINT_FP 118 | |
1072 | #define X509_F_X509_PUBKEY_GET 119 | |
1073 | #define X509_F_X509_PUBKEY_SET 120 | |
1074 | #define X509_F_X509_REQ_PRINT 121 | |
1075 | #define X509_F_X509_REQ_PRINT_FP 122 | |
1076 | #define X509_F_X509_REQ_TO_X509 123 | |
1077 | #define X509_F_X509_STORE_ADD_CERT 124 | |
1078 | #define X509_F_X509_STORE_ADD_CRL 125 | |
1079 | #define X509_F_X509_TO_X509_REQ 126 | |
1080 | #define X509_F_X509_VERIFY_CERT 127 | |
d02b48c6 RE |
1081 | |
1082 | /* Reason codes. */ | |
1083 | #define X509_R_BAD_X509_FILETYPE 100 | |
8ce97163 | 1084 | #define X509_R_BASE64_DECODE_ERROR 118 |
4004dbb7 | 1085 | #define X509_R_CANT_CHECK_DH_KEY 114 |
d02b48c6 RE |
1086 | #define X509_R_CERT_ALREADY_IN_HASH_TABLE 101 |
1087 | #define X509_R_ERR_ASN1_LIB 102 | |
fdc71ecc | 1088 | #define X509_R_INVALID_DIRECTORY 113 |
74400f73 | 1089 | #define X509_R_INVALID_FIELD_NAME 119 |
4004dbb7 BL |
1090 | #define X509_R_KEY_TYPE_MISMATCH 115 |
1091 | #define X509_R_KEY_VALUES_MISMATCH 116 | |
d02b48c6 RE |
1092 | #define X509_R_LOADING_CERT_DIR 103 |
1093 | #define X509_R_LOADING_DEFAULTS 104 | |
1094 | #define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 | |
1095 | #define X509_R_SHOULD_RETRY 106 | |
1096 | #define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107 | |
1097 | #define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108 | |
4004dbb7 | 1098 | #define X509_R_UNKNOWN_KEY_TYPE 117 |
d02b48c6 | 1099 | #define X509_R_UNKNOWN_NID 109 |
d02b48c6 | 1100 | #define X509_R_UNSUPPORTED_ALGORITHM 111 |
58964a49 | 1101 | #define X509_R_WRONG_LOOKUP_TYPE 112 |
6d311938 | 1102 | |
d02b48c6 RE |
1103 | #ifdef __cplusplus |
1104 | } | |
1105 | #endif | |
1106 | #endif | |
1107 |