2 /* crypto/x509/x509.h */
3 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
6 * This package is an SSL implementation written
7 * by Eric Young (eay@cryptsoft.com).
8 * The implementation was written so as to conform with Netscapes SSL.
10 * This library is free for commercial and non-commercial use as long as
11 * the following conditions are aheared to. The following conditions
12 * apply to all code found in this distribution, be it the RC4, RSA,
13 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
14 * included with this distribution is covered by the same copyright terms
15 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
17 * Copyright remains Eric Young's, and as such any Copyright notices in
18 * the code are not to be removed.
19 * If this package is used in a product, Eric Young should be given attribution
20 * as the author of the parts of the library used.
21 * This can be in the form of a textual message at program startup or
22 * in documentation (online or textual) provided with the package.
24 * Redistribution and use in source and binary forms, with or without
25 * modification, are permitted provided that the following conditions
27 * 1. Redistributions of source code must retain the copyright
28 * notice, this list of conditions and the following disclaimer.
29 * 2. Redistributions in binary form must reproduce the above copyright
30 * notice, this list of conditions and the following disclaimer in the
31 * documentation and/or other materials provided with the distribution.
32 * 3. All advertising materials mentioning features or use of this software
33 * must display the following acknowledgement:
34 * "This product includes cryptographic software written by
35 * Eric Young (eay@cryptsoft.com)"
36 * The word 'cryptographic' can be left out if the rouines from the library
37 * being used are not cryptographic related :-).
38 * 4. If you include any Windows specific code (or a derivative thereof) from
39 * the apps directory (application code) you must include an acknowledgement:
40 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
42 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
43 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
45 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
46 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
47 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
48 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
51 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * The licence and distribution terms for any publically available version or
55 * derivative of this code cannot be changed. i.e. this code cannot simply be
56 * copied and put under another distribution licence
57 * [including the GNU Public Licence.]
90 #define X509_FILETYPE_PEM 1
91 #define X509_FILETYPE_ASN1 2
92 #define X509_FILETYPE_DEFAULT 3
94 #define X509v3_KU_DIGITAL_SIGNATURE 0x0080
95 #define X509v3_KU_NON_REPUDIATION 0x0040
96 #define X509v3_KU_KEY_ENCIPHERMENT 0x0020
97 #define X509v3_KU_DATA_ENCIPHERMENT 0x0010
98 #define X509v3_KU_KEY_AGREEMENT 0x0008
99 #define X509v3_KU_KEY_CERT_SIGN 0x0004
100 #define X509v3_KU_CRL_SIGN 0x0002
101 #define X509v3_KU_ENCIPHER_ONLY 0x0001
102 #define X509v3_KU_DECIPHER_ONLY 0x8000
103 #define X509v3_KU_UNDEF 0xffff
105 typedef struct X509_objects_st
112 typedef struct X509_algor_st
114 ASN1_OBJECT
*algorithm
;
115 ASN1_TYPE
*parameter
;
118 typedef struct X509_val_st
120 ASN1_UTCTIME
*notBefore
;
121 ASN1_UTCTIME
*notAfter
;
124 typedef struct X509_pubkey_st
127 ASN1_BIT_STRING
*public_key
;
128 struct evp_pkey_st
/* EVP_PKEY*/ *pkey
;
131 typedef struct X509_sig_st
134 ASN1_OCTET_STRING
*digest
;
137 typedef struct X509_name_entry_st
142 int size
; /* temp variable */
145 /* we always keep X509_NAMEs in 2 forms. */
146 typedef struct X509_name_st
148 STACK
*entries
; /* of X509_NAME_ENTRY */
149 int modified
; /* true if 'bytes' needs to be built */
150 #ifdef HEADER_BUFFER_H
155 unsigned long hash
; /* Keep the hash around for lookups */
158 #define X509_EX_V_NETSCAPE_HACK 0x8000
159 #define X509_EX_V_INIT 0x0001
160 typedef struct X509_extension_st
165 ASN1_OCTET_STRING
*value
;
166 long argl
; /* used when decoding */
167 char *argp
; /* used when decoding */
168 void (*ex_free
)(); /* clear argp stuff */
172 typedef struct x509_extension_method_st
178 int (*ex_get_bool
)();
179 int (*ex_set_bool
)();
182 char *(*ex_get_struct
)();
183 int (*ex_set_struct
)();
186 } X509_EXTENSION_METHOD
;
189 typedef struct X509_req_info_st
191 ASN1_INTEGER
*version
;
194 /* d=2 hl=2 l= 0 cons: cont: 00 */
195 STACK
/* X509_ATTRIBUTE */ *attributes
; /* [ 0 ] */
199 typedef struct X509_req_st
201 X509_REQ_INFO
*req_info
;
203 ASN1_BIT_STRING
*signature
;
207 typedef struct x509_cinf_st
209 ASN1_INTEGER
*version
; /* [ 0 ] default of v1 */
210 ASN1_INTEGER
*serialNumber
;
211 X509_ALGOR
*signature
;
216 ASN1_BIT_STRING
*issuerUID
; /* [ 1 ] optional in v2 */
217 ASN1_BIT_STRING
*subjectUID
; /* [ 2 ] optional in v2 */
218 STACK
/* X509_EXTENSION */ *extensions
; /* [ 3 ] optional in v3 */
221 typedef struct x509_st
223 X509_CINF
*cert_info
;
225 ASN1_BIT_STRING
*signature
;
231 typedef struct X509_revoked_st
233 ASN1_INTEGER
*serialNumber
;
234 ASN1_UTCTIME
*revocationDate
;
235 STACK
/* optional X509_EXTENSION */ *extensions
;
236 int sequence
; /* load sequence */
239 typedef struct X509_crl_info_st
241 ASN1_INTEGER
*version
;
244 ASN1_UTCTIME
*lastUpdate
;
245 ASN1_UTCTIME
*nextUpdate
;
246 STACK
/* X509_REVOKED */ *revoked
;
247 STACK
/* [0] X509_EXTENSION */ *extensions
;
250 typedef struct X509_crl_st
252 /* actual signature */
255 ASN1_BIT_STRING
*signature
;
259 /* a sequence of these are used */
260 typedef struct x509_attributes_st
263 int set
; /* 1 for a set, 0 for a single item (which is wrong) */
266 /* 1 */ STACK
/* ASN1_TYPE */ *set
;
267 /* 0 */ ASN1_TYPE
*single
;
271 typedef struct private_key_st
274 /* The PKCS#8 data types */
275 X509_ALGOR
*enc_algor
;
276 ASN1_OCTET_STRING
*enc_pkey
; /* encrypted pub key */
278 /* When decrypted, the following will not be NULL */
281 /* used to encrypt and decrypt */
284 int key_free
; /* true if we should auto free key_data */
286 /* expanded version of 'enc_algor' */
287 EVP_CIPHER_INFO cipher
;
292 #ifdef HEADER_ENVELOPE_H
293 typedef struct X509_info_st
299 EVP_CIPHER_INFO enc_cipher
;
307 /* The next 2 structures and their 8 routines were sent to me by
308 * Pat Richard <patr@x509.com> and are used to manipulate
309 * Netscapes spki strucutres - usefull if you are writing a CA web page
311 typedef struct Netscape_spkac_st
314 ASN1_IA5STRING
*challenge
; /* challenge sent in atlas >= PR2 */
317 typedef struct Netscape_spki_st
319 NETSCAPE_SPKAC
*spkac
; /* signed public key and challenge */
320 X509_ALGOR
*sig_algor
;
321 ASN1_BIT_STRING
*signature
;
324 /* Netscape certificate sequence structure */
325 typedef struct Netscape_certificate_sequence
328 STACK
/* X509 */ *certs
;
329 } NETSCAPE_CERT_SEQUENCE
;
335 typedef struct CBCParameter_st
340 #include "x509_vfy.h"
344 #define X509_verify(a,r) ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg,\
345 a->signature,(char *)a->cert_info,r)
346 #define X509_REQ_verify(a,r) ASN1_verify((int (*)())i2d_X509_REQ_INFO, \
347 a->sig_alg,a->signature,(char *)a->req_info,r)
348 #define X509_CRL_verify(a,r) ASN1_verify((int (*)())i2d_X509_CRL_INFO, \
349 a->sig_alg, a->signature,(char *)a->crl,r)
351 #define X509_sign(x,pkey,md) \
352 ASN1_sign((int (*)())i2d_X509_CINF, x->cert_info->signature, \
353 x->sig_alg, x->signature, (char *)x->cert_info,pkey,md)
354 #define X509_REQ_sign(x,pkey,md) \
355 ASN1_sign((int (*)())i2d_X509_REQ_INFO,x->sig_alg, NULL, \
356 x->signature, (char *)x->req_info,pkey,md)
357 #define X509_CRL_sign(x,pkey,md) \
358 ASN1_sign((int (*)())i2d_X509_CRL_INFO,x->crl->sig_alg,x->sig_alg, \
359 x->signature, (char *)x->crl,pkey,md)
360 #define NETSCAPE_SPKI_sign(x,pkey,md) \
361 ASN1_sign((int (*)())i2d_NETSCAPE_SPKAC, x->sig_algor,NULL, \
362 x->signature, (char *)x->spkac,pkey,md)
364 #define X509_dup(x509) (X509 *)ASN1_dup((int (*)())i2d_X509, \
365 (char *(*)())d2i_X509,(char *)x509)
366 #define X509_ATTRIBUTE_dup(xa) (X509_ATTRIBUTE *)ASN1_dup(\
367 (int (*)())i2d_X509_ATTRIBUTE, \
368 (char *(*)())d2i_X509_ATTRIBUTE,(char *)xa)
369 #define X509_EXTENSION_dup(ex) (X509_EXTENSION *)ASN1_dup( \
370 (int (*)())i2d_X509_EXTENSION, \
371 (char *(*)())d2i_X509_EXTENSION,(char *)ex)
372 #define d2i_X509_fp(fp,x509) (X509 *)ASN1_d2i_fp((char *(*)())X509_new, \
373 (char *(*)())d2i_X509, (fp),(unsigned char **)(x509))
374 #define i2d_X509_fp(fp,x509) ASN1_i2d_fp(i2d_X509,fp,(unsigned char *)x509)
375 #define d2i_X509_bio(bp,x509) (X509 *)ASN1_d2i_bio((char *(*)())X509_new, \
376 (char *(*)())d2i_X509, (bp),(unsigned char **)(x509))
377 #define i2d_X509_bio(bp,x509) ASN1_i2d_bio(i2d_X509,bp,(unsigned char *)x509)
379 #define X509_CRL_dup(crl) (X509_CRL *)ASN1_dup((int (*)())i2d_X509_CRL, \
380 (char *(*)())d2i_X509_CRL,(char *)crl)
381 #define d2i_X509_CRL_fp(fp,crl) (X509_CRL *)ASN1_d2i_fp((char *(*)()) \
382 X509_CRL_new,(char *(*)())d2i_X509_CRL, (fp),\
383 (unsigned char **)(crl))
384 #define i2d_X509_CRL_fp(fp,crl) ASN1_i2d_fp(i2d_X509_CRL,fp,\
385 (unsigned char *)crl)
386 #define d2i_X509_CRL_bio(bp,crl) (X509_CRL *)ASN1_d2i_bio((char *(*)()) \
387 X509_CRL_new,(char *(*)())d2i_X509_CRL, (bp),\
388 (unsigned char **)(crl))
389 #define i2d_X509_CRL_bio(bp,crl) ASN1_i2d_bio(i2d_X509_CRL,bp,\
390 (unsigned char *)crl)
392 #define PKCS7_dup(p7) (PKCS7 *)ASN1_dup((int (*)())i2d_PKCS7, \
393 (char *(*)())d2i_PKCS7,(char *)p7)
394 #define d2i_PKCS7_fp(fp,p7) (PKCS7 *)ASN1_d2i_fp((char *(*)()) \
395 PKCS7_new,(char *(*)())d2i_PKCS7, (fp),\
396 (unsigned char **)(p7))
397 #define i2d_PKCS7_fp(fp,p7) ASN1_i2d_fp(i2d_PKCS7,fp,\
399 #define d2i_PKCS7_bio(bp,p7) (PKCS7 *)ASN1_d2i_bio((char *(*)()) \
400 PKCS7_new,(char *(*)())d2i_PKCS7, (bp),\
401 (unsigned char **)(p7))
402 #define i2d_PKCS7_bio(bp,p7) ASN1_i2d_bio(i2d_PKCS7,bp,\
405 #define X509_REQ_dup(req) (X509_REQ *)ASN1_dup((int (*)())i2d_X509_REQ, \
406 (char *(*)())d2i_X509_REQ,(char *)req)
407 #define d2i_X509_REQ_fp(fp,req) (X509_REQ *)ASN1_d2i_fp((char *(*)())\
408 X509_REQ_new, (char *(*)())d2i_X509_REQ, (fp),\
409 (unsigned char **)(req))
410 #define i2d_X509_REQ_fp(fp,req) ASN1_i2d_fp(i2d_X509_REQ,fp,\
411 (unsigned char *)req)
412 #define d2i_X509_REQ_bio(bp,req) (X509_REQ *)ASN1_d2i_bio((char *(*)())\
413 X509_REQ_new, (char *(*)())d2i_X509_REQ, (bp),\
414 (unsigned char **)(req))
415 #define i2d_X509_REQ_bio(bp,req) ASN1_i2d_bio(i2d_X509_REQ,bp,\
416 (unsigned char *)req)
418 #define RSAPublicKey_dup(rsa) (RSA *)ASN1_dup((int (*)())i2d_RSAPublicKey, \
419 (char *(*)())d2i_RSAPublicKey,(char *)rsa)
420 #define RSAPrivateKey_dup(rsa) (RSA *)ASN1_dup((int (*)())i2d_RSAPrivateKey, \
421 (char *(*)())d2i_RSAPrivateKey,(char *)rsa)
423 #define d2i_RSAPrivateKey_fp(fp,rsa) (RSA *)ASN1_d2i_fp((char *(*)())\
424 RSA_new,(char *(*)())d2i_RSAPrivateKey, (fp), \
425 (unsigned char **)(rsa))
426 #define i2d_RSAPrivateKey_fp(fp,rsa) ASN1_i2d_fp(i2d_RSAPrivateKey,fp, \
427 (unsigned char *)rsa)
428 #define d2i_RSAPrivateKey_bio(bp,rsa) (RSA *)ASN1_d2i_bio((char *(*)())\
429 RSA_new,(char *(*)())d2i_RSAPrivateKey, (bp), \
430 (unsigned char **)(rsa))
431 #define i2d_RSAPrivateKey_bio(bp,rsa) ASN1_i2d_bio(i2d_RSAPrivateKey,bp, \
432 (unsigned char *)rsa)
434 #define d2i_RSAPublicKey_fp(fp,rsa) (RSA *)ASN1_d2i_fp((char *(*)())\
435 RSA_new,(char *(*)())d2i_RSAPublicKey, (fp), \
436 (unsigned char **)(rsa))
437 #define i2d_RSAPublicKey_fp(fp,rsa) ASN1_i2d_fp(i2d_RSAPublicKey,fp, \
438 (unsigned char *)rsa)
439 #define d2i_RSAPublicKey_bio(bp,rsa) (RSA *)ASN1_d2i_bio((char *(*)())\
440 RSA_new,(char *(*)())d2i_RSAPublicKey, (bp), \
441 (unsigned char **)(rsa))
442 #define i2d_RSAPublicKey_bio(bp,rsa) ASN1_i2d_bio(i2d_RSAPublicKey,bp, \
443 (unsigned char *)rsa)
445 #define d2i_DSAPrivateKey_fp(fp,dsa) (DSA *)ASN1_d2i_fp((char *(*)())\
446 DSA_new,(char *(*)())d2i_DSAPrivateKey, (fp), \
447 (unsigned char **)(dsa))
448 #define i2d_DSAPrivateKey_fp(fp,dsa) ASN1_i2d_fp(i2d_DSAPrivateKey,fp, \
449 (unsigned char *)dsa)
450 #define d2i_DSAPrivateKey_bio(bp,dsa) (DSA *)ASN1_d2i_bio((char *(*)())\
451 DSA_new,(char *(*)())d2i_DSAPrivateKey, (bp), \
452 (unsigned char **)(dsa))
453 #define i2d_DSAPrivateKey_bio(bp,dsa) ASN1_i2d_bio(i2d_DSAPrivateKey,bp, \
454 (unsigned char *)dsa)
456 #define X509_ALGOR_dup(xn) (X509_ALGOR *)ASN1_dup((int (*)())i2d_X509_ALGOR,\
457 (char *(*)())d2i_X509_ALGOR,(char *)xn)
459 #define X509_NAME_dup(xn) (X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, \
460 (char *(*)())d2i_X509_NAME,(char *)xn)
461 #define X509_NAME_ENTRY_dup(ne) (X509_NAME_ENTRY *)ASN1_dup( \
462 (int (*)())i2d_X509_NAME_ENTRY, \
463 (char *(*)())d2i_X509_NAME_ENTRY,\
466 #define X509_digest(data,type,md,len) \
467 ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len)
468 #define X509_NAME_digest(data,type,md,len) \
469 ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len)
470 #ifndef PKCS7_ISSUER_AND_SERIAL_digest
471 #define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \
472 ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\
477 #define X509_EXT_PACK_UNKNOWN 1
478 #define X509_EXT_PACK_STRING 2
480 #define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version)
481 /* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */
482 #define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore)
483 #define X509_get_notAfter(x) ((x)->cert_info->validity->notAfter)
484 #define X509_extract_key(x) X509_get_pubkey(x) /*****/
485 #define X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version)
486 #define X509_REQ_get_subject_name(x) ((x)->req_info->subject)
487 #define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a)
488 #define X509_name_cmp(a,b) X509_NAME_cmp((a),(b))
489 #define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm))
491 #define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version)
492 #define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate)
493 #define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate)
494 #define X509_CRL_get_issuer(x) ((x)->crl->issuer)
495 #define X509_CRL_get_REVOKED(x) ((x)->crl->revoked)
497 /* This one is only used so that a binary form can output, as in
498 * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) */
499 #define X509_get_X509_PUBKEY(x) ((x)->cert_info->key)
503 #ifndef SSLEAY_MACROS
504 #ifdef HEADER_ENVELOPE_H
505 int X509_verify(X509
*a
, EVP_PKEY
*r
);
506 char *X509_verify_cert_error_string(long n
);
508 int X509_REQ_verify(X509_REQ
*a
, EVP_PKEY
*r
);
509 int X509_CRL_verify(X509_CRL
*a
, EVP_PKEY
*r
);
510 int NETSCAPE_SPKI_verify(NETSCAPE_SPKI
*a
, EVP_PKEY
*r
);
512 int X509_sign(X509
*x
, EVP_PKEY
*pkey
, EVP_MD
*md
);
513 int X509_REQ_sign(X509_REQ
*x
, EVP_PKEY
*pkey
, EVP_MD
*md
);
514 int X509_CRL_sign(X509_CRL
*x
, EVP_PKEY
*pkey
, EVP_MD
*md
);
515 int NETSCAPE_SPKI_sign(NETSCAPE_SPKI
*x
, EVP_PKEY
*pkey
, EVP_MD
*md
);
517 int X509_digest(X509
*data
,EVP_MD
*type
,unsigned char *md
,unsigned int *len
);
518 int X509_NAME_digest(X509_NAME
*data
,EVP_MD
*type
,
519 unsigned char *md
,unsigned int *len
);
523 X509
*d2i_X509_fp(FILE *fp
, X509
*x509
);
524 int i2d_X509_fp(FILE *fp
,X509
*x509
);
525 X509_CRL
*d2i_X509_CRL_fp(FILE *fp
,X509_CRL
*crl
);
526 int i2d_X509_CRL_fp(FILE *fp
,X509_CRL
*crl
);
527 X509_REQ
*d2i_X509_REQ_fp(FILE *fp
,X509_REQ
*req
);
528 int i2d_X509_REQ_fp(FILE *fp
,X509_REQ
*req
);
529 RSA
*d2i_RSAPrivateKey_fp(FILE *fp
,RSA
*rsa
);
530 int i2d_RSAPrivateKey_fp(FILE *fp
,RSA
*rsa
);
531 DSA
*d2i_DSAPrivateKey_fp(FILE *fp
, DSA
*dsa
);
532 int i2d_DSAPrivateKey_fp(FILE *fp
, DSA
*dsa
);
533 RSA
*d2i_RSAPublicKey_fp(FILE *fp
,RSA
*rsa
);
534 int i2d_RSAPublicKey_fp(FILE *fp
,RSA
*rsa
);
538 X509
*d2i_X509_bio(BIO
*bp
,X509
*x509
);
539 int i2d_X509_bio(BIO
*bp
,X509
*x509
);
540 X509_CRL
*d2i_X509_CRL_bio(BIO
*bp
,X509_CRL
*crl
);
541 int i2d_X509_CRL_bio(BIO
*bp
,X509_CRL
*crl
);
542 X509_REQ
*d2i_X509_REQ_bio(BIO
*bp
,X509_REQ
*req
);
543 int i2d_X509_REQ_bio(BIO
*bp
,X509_REQ
*req
);
544 RSA
*d2i_RSAPrivateKey_bio(BIO
*bp
,RSA
*rsa
);
545 int i2d_RSAPrivateKey_bio(BIO
*bp
,RSA
*rsa
);
546 DSA
*d2i_DSAPrivateKey_bio(BIO
*bp
, DSA
*dsa
);
547 int i2d_DSAPrivateKey_bio(BIO
*bp
, DSA
*dsa
);
548 RSA
*d2i_RSAPublicKey_bio(BIO
*bp
,RSA
*rsa
);
549 int i2d_RSAPublicKey_bio(BIO
*bp
,RSA
*rsa
);
552 X509
*X509_dup(X509
*x509
);
553 X509_ATTRIBUTE
*X509_ATTRIBUTE_dup(X509_ATTRIBUTE
*xa
);
554 X509_EXTENSION
*X509_EXTENSION_dup(X509_EXTENSION
*ex
);
555 X509_CRL
*X509_CRL_dup(X509_CRL
*crl
);
556 X509_REQ
*X509_REQ_dup(X509_REQ
*req
);
557 X509_ALGOR
*X509_ALGOR_dup(X509_ALGOR
*xn
);
558 X509_NAME
*X509_NAME_dup(X509_NAME
*xn
);
559 X509_NAME_ENTRY
*X509_NAME_ENTRY_dup(X509_NAME_ENTRY
*ne
);
560 RSA
*RSAPublicKey_dup(RSA
*rsa
);
561 RSA
*RSAPrivateKey_dup(RSA
*rsa
);
563 #endif /* !SSLEAY_MACROS */
565 int X509_cmp_current_time(ASN1_UTCTIME
*s
);
566 ASN1_UTCTIME
* X509_gmtime_adj(ASN1_UTCTIME
*s
, long adj
);
568 char * X509_get_default_cert_area(void );
569 char * X509_get_default_cert_dir(void );
570 char * X509_get_default_cert_file(void );
571 char * X509_get_default_cert_dir_env(void );
572 char * X509_get_default_cert_file_env(void );
573 char * X509_get_default_private_dir(void );
575 X509_REQ
* X509_to_X509_REQ(X509
*x
, EVP_PKEY
*pkey
, EVP_MD
*md
);
576 X509
* X509_REQ_to_X509(X509_REQ
*r
, int days
,EVP_PKEY
*pkey
);
577 void ERR_load_X509_strings(void );
579 X509_ALGOR
* X509_ALGOR_new(void );
580 void X509_ALGOR_free(X509_ALGOR
*a
);
581 int i2d_X509_ALGOR(X509_ALGOR
*a
,unsigned char **pp
);
582 X509_ALGOR
* d2i_X509_ALGOR(X509_ALGOR
**a
,unsigned char **pp
,
585 X509_VAL
* X509_VAL_new(void );
586 void X509_VAL_free(X509_VAL
*a
);
587 int i2d_X509_VAL(X509_VAL
*a
,unsigned char **pp
);
588 X509_VAL
* d2i_X509_VAL(X509_VAL
**a
,unsigned char **pp
,
591 X509_PUBKEY
* X509_PUBKEY_new(void );
592 void X509_PUBKEY_free(X509_PUBKEY
*a
);
593 int i2d_X509_PUBKEY(X509_PUBKEY
*a
,unsigned char **pp
);
594 X509_PUBKEY
* d2i_X509_PUBKEY(X509_PUBKEY
**a
,unsigned char **pp
,
596 int X509_PUBKEY_set(X509_PUBKEY
**x
, EVP_PKEY
*pkey
);
597 EVP_PKEY
* X509_PUBKEY_get(X509_PUBKEY
*key
);
598 int X509_get_pubkey_parameters(EVP_PKEY
*pkey
, STACK
*chain
);
601 X509_SIG
* X509_SIG_new(void );
602 void X509_SIG_free(X509_SIG
*a
);
603 int i2d_X509_SIG(X509_SIG
*a
,unsigned char **pp
);
604 X509_SIG
* d2i_X509_SIG(X509_SIG
**a
,unsigned char **pp
,long length
);
606 X509_REQ_INFO
*X509_REQ_INFO_new(void);
607 void X509_REQ_INFO_free(X509_REQ_INFO
*a
);
608 int i2d_X509_REQ_INFO(X509_REQ_INFO
*a
,unsigned char **pp
);
609 X509_REQ_INFO
*d2i_X509_REQ_INFO(X509_REQ_INFO
**a
,unsigned char **pp
,
612 X509_REQ
* X509_REQ_new(void);
613 void X509_REQ_free(X509_REQ
*a
);
614 int i2d_X509_REQ(X509_REQ
*a
,unsigned char **pp
);
615 X509_REQ
* d2i_X509_REQ(X509_REQ
**a
,unsigned char **pp
,long length
);
617 X509_ATTRIBUTE
*X509_ATTRIBUTE_new(void );
618 void X509_ATTRIBUTE_free(X509_ATTRIBUTE
*a
);
619 int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE
*a
,unsigned char **pp
);
620 X509_ATTRIBUTE
*d2i_X509_ATTRIBUTE(X509_ATTRIBUTE
**a
,unsigned char **pp
,
622 X509_ATTRIBUTE
*X509_ATTRIBUTE_create(int nid
, int atrtype
, char *value
);
625 X509_EXTENSION
*X509_EXTENSION_new(void );
626 void X509_EXTENSION_free(X509_EXTENSION
*a
);
627 int i2d_X509_EXTENSION(X509_EXTENSION
*a
,unsigned char **pp
);
628 X509_EXTENSION
*d2i_X509_EXTENSION(X509_EXTENSION
**a
,unsigned char **pp
,
631 X509_NAME_ENTRY
*X509_NAME_ENTRY_new(void);
632 void X509_NAME_ENTRY_free(X509_NAME_ENTRY
*a
);
633 int i2d_X509_NAME_ENTRY(X509_NAME_ENTRY
*a
,unsigned char **pp
);
634 X509_NAME_ENTRY
*d2i_X509_NAME_ENTRY(X509_NAME_ENTRY
**a
,unsigned char **pp
,
637 X509_NAME
* X509_NAME_new(void);
638 void X509_NAME_free(X509_NAME
*a
);
639 int i2d_X509_NAME(X509_NAME
*a
,unsigned char **pp
);
640 X509_NAME
* d2i_X509_NAME(X509_NAME
**a
,unsigned char **pp
,long length
);
641 int X509_NAME_set(X509_NAME
**xn
, X509_NAME
*name
);
644 X509_CINF
* X509_CINF_new(void);
645 void X509_CINF_free(X509_CINF
*a
);
646 int i2d_X509_CINF(X509_CINF
*a
,unsigned char **pp
);
647 X509_CINF
* d2i_X509_CINF(X509_CINF
**a
,unsigned char **pp
,long length
);
649 X509
* X509_new(void);
650 void X509_free(X509
*a
);
651 int i2d_X509(X509
*a
,unsigned char **pp
);
652 X509
* d2i_X509(X509
**a
,unsigned char **pp
,long length
);
654 X509_REVOKED
* X509_REVOKED_new(void);
655 void X509_REVOKED_free(X509_REVOKED
*a
);
656 int i2d_X509_REVOKED(X509_REVOKED
*a
,unsigned char **pp
);
657 X509_REVOKED
* d2i_X509_REVOKED(X509_REVOKED
**a
,unsigned char **pp
,long length
);
659 X509_CRL_INFO
*X509_CRL_INFO_new(void);
660 void X509_CRL_INFO_free(X509_CRL_INFO
*a
);
661 int i2d_X509_CRL_INFO(X509_CRL_INFO
*a
,unsigned char **pp
);
662 X509_CRL_INFO
*d2i_X509_CRL_INFO(X509_CRL_INFO
**a
,unsigned char **pp
,
665 X509_CRL
* X509_CRL_new(void);
666 void X509_CRL_free(X509_CRL
*a
);
667 int i2d_X509_CRL(X509_CRL
*a
,unsigned char **pp
);
668 X509_CRL
* d2i_X509_CRL(X509_CRL
**a
,unsigned char **pp
,long length
);
670 X509_PKEY
* X509_PKEY_new(void );
671 void X509_PKEY_free(X509_PKEY
*a
);
672 int i2d_X509_PKEY(X509_PKEY
*a
,unsigned char **pp
);
673 X509_PKEY
* d2i_X509_PKEY(X509_PKEY
**a
,unsigned char **pp
,long length
);
675 NETSCAPE_SPKI
* NETSCAPE_SPKI_new(void );
676 void NETSCAPE_SPKI_free(NETSCAPE_SPKI
*a
);
677 int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI
*a
,unsigned char **pp
);
678 NETSCAPE_SPKI
* d2i_NETSCAPE_SPKI(NETSCAPE_SPKI
**a
,unsigned char **pp
,
681 NETSCAPE_SPKAC
*NETSCAPE_SPKAC_new(void );
682 void NETSCAPE_SPKAC_free(NETSCAPE_SPKAC
*a
);
683 int i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC
*a
,unsigned char **pp
);
684 NETSCAPE_SPKAC
*d2i_NETSCAPE_SPKAC(NETSCAPE_SPKAC
**a
,unsigned char **pp
,
688 int i2d_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE
*a
, unsigned char **pp
);
689 NETSCAPE_CERT_SEQUENCE
*NETSCAPE_CERT_SEQUENCE_new(void);
690 NETSCAPE_CERT_SEQUENCE
*d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE
**a
, unsigned char **pp
, long length
);
691 void NETSCAPE_CERT_SEQUENCE_free(NETSCAPE_CERT_SEQUENCE
*a
);
693 #ifdef HEADER_ENVELOPE_H
694 X509_INFO
* X509_INFO_new(void);
695 void X509_INFO_free(X509_INFO
*a
);
696 char * X509_NAME_oneline(X509_NAME
*a
,char *buf
,int size
);
698 int ASN1_verify(int (*i2d
)(), X509_ALGOR
*algor1
,
699 ASN1_BIT_STRING
*signature
,char *data
,EVP_PKEY
*pkey
);
701 int ASN1_digest(int (*i2d
)(),EVP_MD
*type
,char *data
,
702 unsigned char *md
,unsigned int *len
);
704 int ASN1_sign(int (*i2d
)(), X509_ALGOR
*algor1
, X509_ALGOR
*algor2
,
705 ASN1_BIT_STRING
*signature
,
706 char *data
,EVP_PKEY
*pkey
, EVP_MD
*type
);
709 int X509_set_version(X509
*x
,long version
);
710 int X509_set_serialNumber(X509
*x
, ASN1_INTEGER
*serial
);
711 ASN1_INTEGER
* X509_get_serialNumber(X509
*x
);
712 int X509_set_issuer_name(X509
*x
, X509_NAME
*name
);
713 X509_NAME
* X509_get_issuer_name(X509
*a
);
714 int X509_set_subject_name(X509
*x
, X509_NAME
*name
);
715 X509_NAME
* X509_get_subject_name(X509
*a
);
716 int X509_set_notBefore(X509
*x
, ASN1_UTCTIME
*tm
);
717 int X509_set_notAfter(X509
*x
, ASN1_UTCTIME
*tm
);
718 int X509_set_pubkey(X509
*x
, EVP_PKEY
*pkey
);
719 EVP_PKEY
* X509_get_pubkey(X509
*x
);
720 int X509_certificate_type(X509
*x
,EVP_PKEY
*pubkey
/* optional */);
722 int X509_REQ_set_version(X509_REQ
*x
,long version
);
723 int X509_REQ_set_subject_name(X509_REQ
*req
,X509_NAME
*name
);
724 int X509_REQ_set_pubkey(X509_REQ
*x
, EVP_PKEY
*pkey
);
725 EVP_PKEY
* X509_REQ_get_pubkey(X509_REQ
*req
);
727 int X509_check_private_key(X509
*x509
,EVP_PKEY
*pkey
);
729 int X509_issuer_and_serial_cmp(X509
*a
, X509
*b
);
730 unsigned long X509_issuer_and_serial_hash(X509
*a
);
732 int X509_issuer_name_cmp(X509
*a
, X509
*b
);
733 unsigned long X509_issuer_name_hash(X509
*a
);
735 int X509_subject_name_cmp(X509
*a
,X509
*b
);
736 unsigned long X509_subject_name_hash(X509
*x
);
738 int X509_NAME_cmp (X509_NAME
*a
, X509_NAME
*b
);
739 unsigned long X509_NAME_hash(X509_NAME
*x
);
741 int X509_CRL_cmp(X509_CRL
*a
,X509_CRL
*b
);
743 int X509_print_fp(FILE *bp
,X509
*x
);
744 int X509_CRL_print_fp(FILE *bp
,X509_CRL
*x
);
745 int X509_REQ_print_fp(FILE *bp
,X509_REQ
*req
);
749 int X509_NAME_print(BIO
*bp
, X509_NAME
*name
, int obase
);
750 int X509_print(BIO
*bp
,X509
*x
);
751 int X509_CRL_print(BIO
*bp
,X509_CRL
*x
);
752 int X509_REQ_print(BIO
*bp
,X509_REQ
*req
);
755 int X509_NAME_entry_count(X509_NAME
*name
);
756 int X509_NAME_get_text_by_NID(X509_NAME
*name
, int nid
,
758 int X509_NAME_get_text_by_OBJ(X509_NAME
*name
, ASN1_OBJECT
*obj
,
761 /* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use
762 * lastpos, seach after that position on. */
763 int X509_NAME_get_index_by_NID(X509_NAME
*name
,int nid
,int lastpos
);
764 int X509_NAME_get_index_by_OBJ(X509_NAME
*name
,ASN1_OBJECT
*obj
,
766 X509_NAME_ENTRY
*X509_NAME_get_entry(X509_NAME
*name
, int loc
);
767 X509_NAME_ENTRY
*X509_NAME_delete_entry(X509_NAME
*name
, int loc
);
768 int X509_NAME_add_entry(X509_NAME
*name
,X509_NAME_ENTRY
*ne
,
770 X509_NAME_ENTRY
*X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY
**ne
, int nid
,
771 int type
,unsigned char *bytes
, int len
);
772 X509_NAME_ENTRY
*X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY
**ne
,
773 ASN1_OBJECT
*obj
, int type
,unsigned char *bytes
,
775 int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY
*ne
,
777 int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY
*ne
, int type
,
778 unsigned char *bytes
, int len
);
779 ASN1_OBJECT
* X509_NAME_ENTRY_get_object(X509_NAME_ENTRY
*ne
);
780 ASN1_STRING
* X509_NAME_ENTRY_get_data(X509_NAME_ENTRY
*ne
);
782 int X509v3_get_ext_count(STACK
*x
);
783 int X509v3_get_ext_by_NID(STACK
*x
, int nid
, int lastpos
);
784 int X509v3_get_ext_by_OBJ(STACK
*x
,ASN1_OBJECT
*obj
,int lastpos
);
785 int X509v3_get_ext_by_critical(STACK
*x
, int crit
, int lastpos
);
786 X509_EXTENSION
*X509v3_get_ext(STACK
*x
, int loc
);
787 X509_EXTENSION
*X509v3_delete_ext(STACK
*x
, int loc
);
788 STACK
* X509v3_add_ext(STACK
**x
, X509_EXTENSION
*ex
, int loc
);
790 int X509v3_data_type_by_OBJ(ASN1_OBJECT
*obj
);
791 int X509v3_data_type_by_NID(int nid
);
792 int X509v3_pack_type_by_OBJ(ASN1_OBJECT
*obj
);
793 int X509v3_pack_type_by_NID(int nid
);
795 int X509_get_ext_count(X509
*x
);
796 int X509_get_ext_by_NID(X509
*x
, int nid
, int lastpos
);
797 int X509_get_ext_by_OBJ(X509
*x
,ASN1_OBJECT
*obj
,int lastpos
);
798 int X509_get_ext_by_critical(X509
*x
, int crit
, int lastpos
);
799 X509_EXTENSION
*X509_get_ext(X509
*x
, int loc
);
800 X509_EXTENSION
*X509_delete_ext(X509
*x
, int loc
);
801 int X509_add_ext(X509
*x
, X509_EXTENSION
*ex
, int loc
);
803 int X509_CRL_get_ext_count(X509_CRL
*x
);
804 int X509_CRL_get_ext_by_NID(X509_CRL
*x
, int nid
, int lastpos
);
805 int X509_CRL_get_ext_by_OBJ(X509_CRL
*x
,ASN1_OBJECT
*obj
,int lastpos
);
806 int X509_CRL_get_ext_by_critical(X509_CRL
*x
, int crit
, int lastpos
);
807 X509_EXTENSION
*X509_CRL_get_ext(X509_CRL
*x
, int loc
);
808 X509_EXTENSION
*X509_CRL_delete_ext(X509_CRL
*x
, int loc
);
809 int X509_CRL_add_ext(X509_CRL
*x
, X509_EXTENSION
*ex
, int loc
);
811 int X509_REVOKED_get_ext_count(X509_REVOKED
*x
);
812 int X509_REVOKED_get_ext_by_NID(X509_REVOKED
*x
, int nid
, int lastpos
);
813 int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED
*x
,ASN1_OBJECT
*obj
,int lastpos
);
814 int X509_REVOKED_get_ext_by_critical(X509_REVOKED
*x
, int crit
, int lastpos
);
815 X509_EXTENSION
*X509_REVOKED_get_ext(X509_REVOKED
*x
, int loc
);
816 X509_EXTENSION
*X509_REVOKED_delete_ext(X509_REVOKED
*x
, int loc
);
817 int X509_REVOKED_add_ext(X509_REVOKED
*x
, X509_EXTENSION
*ex
, int loc
);
819 X509_EXTENSION
*X509_EXTENSION_create_by_NID(X509_EXTENSION
**ex
,
820 int nid
, int crit
, ASN1_OCTET_STRING
*data
);
821 X509_EXTENSION
*X509_EXTENSION_create_by_OBJ(X509_EXTENSION
**ex
,
822 ASN1_OBJECT
*obj
,int crit
,ASN1_OCTET_STRING
*data
);
823 int X509_EXTENSION_set_object(X509_EXTENSION
*ex
,ASN1_OBJECT
*obj
);
824 int X509_EXTENSION_set_critical(X509_EXTENSION
*ex
, int crit
);
825 int X509_EXTENSION_set_data(X509_EXTENSION
*ex
,
826 ASN1_OCTET_STRING
*data
);
827 ASN1_OBJECT
* X509_EXTENSION_get_object(X509_EXTENSION
*ex
);
828 ASN1_OCTET_STRING
*X509_EXTENSION_get_data(X509_EXTENSION
*ne
);
829 int X509_EXTENSION_get_critical(X509_EXTENSION
*ex
);
830 ASN1_OCTET_STRING
*X509v3_pack_string(ASN1_OCTET_STRING
**ex
,int type
,
831 unsigned char *bytes
, int len
);
832 ASN1_STRING
* X509v3_unpack_string(ASN1_STRING
**ex
,int type
,
833 ASN1_OCTET_STRING
*os
);
835 int X509_verify_cert(X509_STORE_CTX
*ctx
);
837 /* lookup a cert from a X509 STACK */
838 X509
*X509_find_by_issuer_and_serial(STACK
*sk
,X509_NAME
*name
,
839 ASN1_INTEGER
*serial
);
840 X509
*X509_find_by_subject(STACK
*sk
,X509_NAME
*name
);
844 #ifndef SSLEAY_MACROS
845 #ifdef HEADER_ENVELOPE_H
847 int X509_REQ_verify();
848 int X509_CRL_verify();
849 int NETSCAPE_SPKI_verify();
854 int NETSCAPE_SPKI_sign();
857 int X509_NAME_digest();
863 X509_CRL
*d2i_X509_CRL_fp();
864 int i2d_X509_CRL_fp();
865 X509_REQ
*d2i_X509_REQ_fp();
866 int i2d_X509_REQ_fp();
867 RSA
*d2i_RSAPrivateKey_fp();
868 int i2d_RSAPrivateKey_fp();
869 DSA
*d2i_DSAPrivateKey_fp();
870 int i2d_DSAPrivateKey_fp();
871 RSA
*d2i_RSAPublicKey_fp();
872 int i2d_RSAPublicKey_fp();
875 X509
*d2i_X509_bio();
877 X509_CRL
*d2i_X509_CRL_bio();
878 int i2d_X509_CRL_bio();
879 X509_REQ
*d2i_X509_REQ_bio();
880 int i2d_X509_REQ_bio();
881 RSA
*d2i_RSAPrivateKey_bio();
882 int i2d_RSAPrivateKey_bio();
883 DSA
*d2i_DSAPrivateKey_bio();
884 int i2d_DSAPrivateKey_bio();
885 RSA
*d2i_RSAPublicKey_bio();
886 int i2d_RSAPublicKey_bio();
889 X509_ATTRIBUTE
*X509_ATTRIBUTE_dup();
890 X509_EXTENSION
*X509_EXTENSION_dup();
891 X509_CRL
*X509_CRL_dup();
892 X509_REQ
*X509_REQ_dup();
893 X509_NAME
*X509_NAME_dup();
894 X509_NAME_ENTRY
*X509_NAME_ENTRY_dup();
895 RSA
*RSAPublicKey_dup();
896 RSA
*RSAPrivateKey_dup();
898 #endif /* !SSLEAY_MACROS */
900 int X509_cmp_current_time();
901 ASN1_UTCTIME
* X509_gmtime_adj();
903 char * X509_get_default_cert_area();
904 char * X509_get_default_cert_dir();
905 char * X509_get_default_cert_file();
906 char * X509_get_default_cert_dir_env();
907 char * X509_get_default_cert_file_env();
908 char * X509_get_default_private_dir();
910 X509_REQ
* X509_to_X509_REQ();
911 X509
* X509_REQ_to_X509();
912 void ERR_load_X509_strings();
914 X509_ALGOR
* X509_ALGOR_new();
915 void X509_ALGOR_free();
916 int i2d_X509_ALGOR();
917 X509_ALGOR
* d2i_X509_ALGOR();
919 X509_VAL
* X509_VAL_new();
920 void X509_VAL_free();
922 X509_VAL
* d2i_X509_VAL();
924 X509_PUBKEY
* X509_PUBKEY_new();
925 void X509_PUBKEY_free();
926 int i2d_X509_PUBKEY();
927 X509_PUBKEY
* d2i_X509_PUBKEY();
928 int X509_PUBKEY_set();
929 EVP_PKEY
* X509_PUBKEY_get();
930 int X509_get_pubkey_parameters();
932 X509_SIG
* X509_SIG_new();
933 void X509_SIG_free();
935 X509_SIG
* d2i_X509_SIG();
937 X509_REQ_INFO
*X509_REQ_INFO_new();
938 void X509_REQ_INFO_free();
939 int i2d_X509_REQ_INFO();
940 X509_REQ_INFO
*d2i_X509_REQ_INFO();
942 X509_REQ
* X509_REQ_new();
943 void X509_REQ_free();
945 X509_REQ
* d2i_X509_REQ();
947 X509_ATTRIBUTE
*X509_ATTRIBUTE_new();
948 void X509_ATTRIBUTE_free();
949 int i2d_X509_ATTRIBUTE();
950 X509_ATTRIBUTE
*d2i_X509_ATTRIBUTE();
951 X509_ATTRIBUTE
*X509_ATTRIBUTE_create();
953 X509_EXTENSION
*X509_EXTENSION_new();
954 void X509_EXTENSION_free();
955 int i2d_X509_EXTENSION();
956 X509_EXTENSION
*d2i_X509_EXTENSION();
958 X509_NAME_ENTRY
*X509_NAME_ENTRY_new();
959 void X509_NAME_ENTRY_free();
960 int i2d_X509_NAME_ENTRY();
961 X509_NAME_ENTRY
*d2i_X509_NAME_ENTRY();
963 X509_NAME
* X509_NAME_new();
964 void X509_NAME_free();
966 X509_NAME
* d2i_X509_NAME();
970 X509_CINF
* X509_CINF_new();
971 void X509_CINF_free();
973 X509_CINF
* d2i_X509_CINF();
980 X509_REVOKED
* X509_REVOKED_new();
981 void X509_REVOKED_free();
982 int i2d_X509_REVOKED();
983 X509_REVOKED
* d2i_X509_REVOKED();
985 X509_CRL_INFO
*X509_CRL_INFO_new();
986 void X509_CRL_INFO_free();
987 int i2d_X509_CRL_INFO();
988 X509_CRL_INFO
*d2i_X509_CRL_INFO();
990 X509_CRL
* X509_CRL_new();
991 void X509_CRL_free();
993 X509_CRL
* d2i_X509_CRL();
995 X509_PKEY
* X509_PKEY_new();
996 void X509_PKEY_free();
998 X509_PKEY
* d2i_X509_PKEY();
1000 NETSCAPE_SPKI
* NETSCAPE_SPKI_new();
1001 void NETSCAPE_SPKI_free();
1002 int i2d_NETSCAPE_SPKI();
1003 NETSCAPE_SPKI
* d2i_NETSCAPE_SPKI();
1005 NETSCAPE_SPKAC
*NETSCAPE_SPKAC_new();
1006 void NETSCAPE_SPKAC_free();
1007 int i2d_NETSCAPE_SPKAC();
1008 NETSCAPE_SPKAC
*d2i_NETSCAPE_SPKAC();
1010 int i2d_NETSCAPE_CERT_SEQUENCE();
1011 NETSCAPE_CERT_SEQUENCE
*NETSCAPE_CERT_SEQUENCE_new();
1012 NETSCAPE_CERT_SEQUENCE
*d2i_NETSCAPE_CERT_SEQUENCE();
1013 void NETSCAPE_CERT_SEQUENCE_free();
1015 #ifdef HEADER_ENVELOPE_H
1016 X509_INFO
* X509_INFO_new();
1017 void X509_INFO_free();
1020 char * X509_NAME_oneline();
1026 int X509_set_version();
1027 int X509_set_serialNumber();
1028 ASN1_INTEGER
* X509_get_serialNumber();
1029 int X509_set_issuer_name();
1030 X509_NAME
* X509_get_issuer_name();
1031 int X509_set_subject_name();
1032 X509_NAME
* X509_get_subject_name();
1033 int X509_set_notBefore();
1034 int X509_set_notAfter();
1035 int X509_set_pubkey();
1036 EVP_PKEY
* X509_get_pubkey();
1037 int X509_certificate_type();
1039 int X509_REQ_set_version();
1040 int X509_REQ_set_subject_name();
1041 int X509_REQ_set_pubkey();
1042 EVP_PKEY
* X509_REQ_get_pubkey();
1044 int X509_check_private_key();
1046 int X509_issuer_and_serial_cmp();
1047 unsigned long X509_issuer_and_serial_hash();
1049 int X509_issuer_name_cmp();
1050 unsigned long X509_issuer_name_hash();
1052 int X509_subject_name_cmp();
1053 unsigned long X509_subject_name_hash();
1055 int X509_NAME_cmp ();
1056 unsigned long X509_NAME_hash();
1060 int X509_print_fp();
1061 int X509_CRL_print_fp();
1062 int X509_REQ_print_fp();
1065 int X509_NAME_print();
1067 int X509_CRL_print();
1068 int X509_REQ_print();
1070 int X509_NAME_entry_count();
1071 int X509_NAME_get_text_by_NID();
1072 int X509_NAME_get_text_by_OBJ();
1074 int X509_NAME_get_index_by_NID();
1075 int X509_NAME_get_index_by_OBJ();
1076 X509_NAME_ENTRY
*X509_NAME_get_entry();
1077 X509_NAME_ENTRY
*X509_NAME_delete_entry();
1078 int X509_NAME_add_entry();
1079 X509_NAME_ENTRY
*X509_NAME_ENTRY_create_by_NID();
1080 X509_NAME_ENTRY
*X509_NAME_ENTRY_create_by_OBJ();
1081 int X509_NAME_ENTRY_set_object();
1082 int X509_NAME_ENTRY_set_data();
1083 ASN1_OBJECT
* X509_NAME_ENTRY_get_object();
1084 ASN1_STRING
* X509_NAME_ENTRY_get_data();
1086 int X509v3_get_ext_count();
1087 int X509v3_get_ext_by_NID();
1088 int X509v3_get_ext_by_OBJ();
1089 int X509v3_get_ext_by_critical();
1090 X509_EXTENSION
*X509v3_get_ext();
1091 X509_EXTENSION
*X509v3_delete_ext();
1092 STACK
* X509v3_add_ext();
1094 int X509v3_data_type_by_OBJ();
1095 int X509v3_data_type_by_NID();
1096 int X509v3_pack_type_by_OBJ();
1097 int X509v3_pack_type_by_NID();
1099 int X509_get_ext_count();
1100 int X509_get_ext_by_NID();
1101 int X509_get_ext_by_OBJ();
1102 int X509_get_ext_by_critical();
1103 X509_EXTENSION
*X509_get_ext();
1104 X509_EXTENSION
*X509_delete_ext();
1107 int X509_CRL_get_ext_count();
1108 int X509_CRL_get_ext_by_NID();
1109 int X509_CRL_get_ext_by_OBJ();
1110 int X509_CRL_get_ext_by_critical();
1111 X509_EXTENSION
*X509_CRL_get_ext();
1112 X509_EXTENSION
*X509_CRL_delete_ext();
1113 int X509_CRL_add_ext();
1115 int X509_REVOKED_get_ext_count();
1116 int X509_REVOKED_get_ext_by_NID();
1117 int X509_REVOKED_get_ext_by_OBJ();
1118 int X509_REVOKED_get_ext_by_critical();
1119 X509_EXTENSION
*X509_REVOKED_get_ext();
1120 X509_EXTENSION
*X509_REVOKED_delete_ext();
1121 int X509_REVOKED_add_ext();
1123 X509_EXTENSION
*X509_EXTENSION_create_by_NID();
1124 X509_EXTENSION
*X509_EXTENSION_create_by_OBJ();
1125 int X509_EXTENSION_set_object();
1126 int X509_EXTENSION_set_critical();
1127 int X509_EXTENSION_set_data();
1128 ASN1_OBJECT
* X509_EXTENSION_get_object();
1129 ASN1_OCTET_STRING
*X509_EXTENSION_get_data();
1130 int X509_EXTENSION_get_critical();
1131 ASN1_OCTET_STRING
*X509v3_pack_string();
1132 ASN1_STRING
* X509v3_unpack_string();
1134 int X509_verify_cert();
1135 char * X509_verify_cert_error_string();
1137 /* lookup a cert from a X509 STACK */
1138 X509
*X509_find_by_issuer_and_serial();
1139 X509
*X509_find_by_subject();
1143 /* BEGIN ERROR CODES */
1144 /* Error codes for the X509 functions. */
1146 /* Function codes. */
1147 #define X509_F_ADD_CERT_DIR 100
1148 #define X509_F_BY_FILE_CTRL 101
1149 #define X509_F_DIR_CTRL 102
1150 #define X509_F_GET_CERT_BY_SUBJECT 103
1151 #define X509_F_X509V3_ADD_EXT 104
1152 #define X509_F_X509V3_ADD_EXTENSION 105
1153 #define X509_F_X509V3_PACK_STRING 106
1154 #define X509_F_X509V3_UNPACK_STRING 107
1155 #define X509_F_X509_EXTENSION_CREATE_BY_NID 108
1156 #define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109
1157 #define X509_F_X509_GET_PUBKEY_PARAMETERS 110
1158 #define X509_F_X509_LOAD_CERT_FILE 111
1159 #define X509_F_X509_LOAD_CRL_FILE 112
1160 #define X509_F_X509_NAME_ADD_ENTRY 113
1161 #define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114
1162 #define X509_F_X509_NAME_ENTRY_SET_OBJECT 115
1163 #define X509_F_X509_NAME_ONELINE 116
1164 #define X509_F_X509_NAME_PRINT 117
1165 #define X509_F_X509_PRINT_FP 118
1166 #define X509_F_X509_PUBKEY_GET 119
1167 #define X509_F_X509_PUBKEY_SET 120
1168 #define X509_F_X509_REQ_PRINT 121
1169 #define X509_F_X509_REQ_PRINT_FP 122
1170 #define X509_F_X509_REQ_TO_X509 123
1171 #define X509_F_X509_STORE_ADD_CERT 124
1172 #define X509_F_X509_STORE_ADD_CRL 125
1173 #define X509_F_X509_TO_X509_REQ 126
1174 #define X509_F_X509_VERIFY_CERT 127
1177 #define X509_R_BAD_X509_FILETYPE 100
1178 #define X509_R_CERT_ALREADY_IN_HASH_TABLE 101
1179 #define X509_R_ERR_ASN1_LIB 102
1180 #define X509_R_INVALID_DIRECTORY 113
1181 #define X509_R_LOADING_CERT_DIR 103
1182 #define X509_R_LOADING_DEFAULTS 104
1183 #define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105
1184 #define X509_R_SHOULD_RETRY 106
1185 #define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107
1186 #define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108
1187 #define X509_R_UNKNOWN_NID 109
1188 #define X509_R_UNKNOWN_STRING_TYPE 110
1189 #define X509_R_UNSUPPORTED_ALGORITHM 111
1190 #define X509_R_WRONG_LOOKUP_TYPE 112