os/ossrv/ssl/libcrypto/src/crypto/x509/x509.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/* crypto/x509/x509.h */
sl@0
     2
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
sl@0
     3
 * All rights reserved.
sl@0
     4
 *
sl@0
     5
 * This package is an SSL implementation written
sl@0
     6
 * by Eric Young (eay@cryptsoft.com).
sl@0
     7
 * The implementation was written so as to conform with Netscapes SSL.
sl@0
     8
 * 
sl@0
     9
 * This library is free for commercial and non-commercial use as long as
sl@0
    10
 * the following conditions are aheared to.  The following conditions
sl@0
    11
 * apply to all code found in this distribution, be it the RC4, RSA,
sl@0
    12
 * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
sl@0
    13
 * included with this distribution is covered by the same copyright terms
sl@0
    14
 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
sl@0
    15
 * 
sl@0
    16
 * Copyright remains Eric Young's, and as such any Copyright notices in
sl@0
    17
 * the code are not to be removed.
sl@0
    18
 * If this package is used in a product, Eric Young should be given attribution
sl@0
    19
 * as the author of the parts of the library used.
sl@0
    20
 * This can be in the form of a textual message at program startup or
sl@0
    21
 * in documentation (online or textual) provided with the package.
sl@0
    22
 * 
sl@0
    23
 * Redistribution and use in source and binary forms, with or without
sl@0
    24
 * modification, are permitted provided that the following conditions
sl@0
    25
 * are met:
sl@0
    26
 * 1. Redistributions of source code must retain the copyright
sl@0
    27
 *    notice, this list of conditions and the following disclaimer.
sl@0
    28
 * 2. Redistributions in binary form must reproduce the above copyright
sl@0
    29
 *    notice, this list of conditions and the following disclaimer in the
sl@0
    30
 *    documentation and/or other materials provided with the distribution.
sl@0
    31
 * 3. All advertising materials mentioning features or use of this software
sl@0
    32
 *    must display the following acknowledgement:
sl@0
    33
 *    "This product includes cryptographic software written by
sl@0
    34
 *     Eric Young (eay@cryptsoft.com)"
sl@0
    35
 *    The word 'cryptographic' can be left out if the rouines from the library
sl@0
    36
 *    being used are not cryptographic related :-).
sl@0
    37
 * 4. If you include any Windows specific code (or a derivative thereof) from 
sl@0
    38
 *    the apps directory (application code) you must include an acknowledgement:
sl@0
    39
 *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
sl@0
    40
 * 
sl@0
    41
 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
sl@0
    42
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
sl@0
    43
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
sl@0
    44
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
sl@0
    45
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
sl@0
    46
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
sl@0
    47
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
sl@0
    48
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
sl@0
    49
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
sl@0
    50
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
sl@0
    51
 * SUCH DAMAGE.
sl@0
    52
 * 
sl@0
    53
 * The licence and distribution terms for any publically available version or
sl@0
    54
 * derivative of this code cannot be changed.  i.e. this code cannot simply be
sl@0
    55
 * copied and put under another distribution licence
sl@0
    56
 * [including the GNU Public Licence.]
sl@0
    57
 */
sl@0
    58
/* ====================================================================
sl@0
    59
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
sl@0
    60
 * ECDH support in OpenSSL originally developed by 
sl@0
    61
 * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
sl@0
    62
 */
sl@0
    63
/*
sl@0
    64
 © Portions copyright (c) 2006, 2010 Nokia Corporation.  All rights reserved.
sl@0
    65
 */
sl@0
    66
sl@0
    67
#ifndef HEADER_X509_H
sl@0
    68
#define HEADER_X509_H
sl@0
    69
sl@0
    70
#if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
sl@0
    71
#define SYMBIAN
sl@0
    72
#endif
sl@0
    73
sl@0
    74
sl@0
    75
#ifdef SYMBIAN
sl@0
    76
#include <e32def.h>
sl@0
    77
#endif
sl@0
    78
#include <openssl/e_os2.h>
sl@0
    79
#include <openssl/symhacks.h>
sl@0
    80
#ifndef OPENSSL_NO_BUFFER
sl@0
    81
#include <openssl/buffer.h>
sl@0
    82
#endif
sl@0
    83
#ifndef OPENSSL_NO_EVP
sl@0
    84
#include <openssl/evp.h>
sl@0
    85
#endif
sl@0
    86
#ifndef OPENSSL_NO_BIO
sl@0
    87
#include <openssl/bio.h>
sl@0
    88
#endif
sl@0
    89
#include <openssl/stack.h>
sl@0
    90
#include <openssl/asn1.h>
sl@0
    91
#include <openssl/safestack.h>
sl@0
    92
sl@0
    93
#ifndef OPENSSL_NO_EC
sl@0
    94
#include <openssl/ec.h>
sl@0
    95
#endif
sl@0
    96
sl@0
    97
#ifndef OPENSSL_NO_ECDSA
sl@0
    98
#include <openssl/ecdsa.h>
sl@0
    99
#endif
sl@0
   100
sl@0
   101
#ifndef OPENSSL_NO_ECDH
sl@0
   102
#include <openssl/ecdh.h>
sl@0
   103
#endif
sl@0
   104
sl@0
   105
#ifndef OPENSSL_NO_DEPRECATED
sl@0
   106
#ifndef OPENSSL_NO_RSA
sl@0
   107
#include <openssl/rsa.h>
sl@0
   108
#endif
sl@0
   109
#ifndef OPENSSL_NO_DSA
sl@0
   110
#include <openssl/dsa.h>
sl@0
   111
#endif
sl@0
   112
#ifndef OPENSSL_NO_DH
sl@0
   113
#include <openssl/dh.h>
sl@0
   114
#endif
sl@0
   115
#endif
sl@0
   116
sl@0
   117
#ifndef OPENSSL_NO_SHA
sl@0
   118
#include <openssl/sha.h>
sl@0
   119
#endif
sl@0
   120
sl@0
   121
sl@0
   122
#include <openssl/ossl_typ.h>
sl@0
   123
sl@0
   124
#ifdef  __cplusplus
sl@0
   125
extern "C" {
sl@0
   126
#endif
sl@0
   127
sl@0
   128
#ifdef OPENSSL_SYS_WIN32
sl@0
   129
/* Under Win32 these are defined in wincrypt.h */
sl@0
   130
#undef X509_NAME
sl@0
   131
#undef X509_CERT_PAIR
sl@0
   132
#endif
sl@0
   133
sl@0
   134
#define X509_FILETYPE_PEM	1
sl@0
   135
#define X509_FILETYPE_ASN1	2
sl@0
   136
#define X509_FILETYPE_DEFAULT	3
sl@0
   137
sl@0
   138
#define X509v3_KU_DIGITAL_SIGNATURE	0x0080
sl@0
   139
#define X509v3_KU_NON_REPUDIATION	0x0040
sl@0
   140
#define X509v3_KU_KEY_ENCIPHERMENT	0x0020
sl@0
   141
#define X509v3_KU_DATA_ENCIPHERMENT	0x0010
sl@0
   142
#define X509v3_KU_KEY_AGREEMENT		0x0008
sl@0
   143
#define X509v3_KU_KEY_CERT_SIGN		0x0004
sl@0
   144
#define X509v3_KU_CRL_SIGN		0x0002
sl@0
   145
#define X509v3_KU_ENCIPHER_ONLY		0x0001
sl@0
   146
#define X509v3_KU_DECIPHER_ONLY		0x8000
sl@0
   147
#define X509v3_KU_UNDEF			0xffff
sl@0
   148
sl@0
   149
typedef struct X509_objects_st
sl@0
   150
	{
sl@0
   151
	int nid;
sl@0
   152
	int (*a2i)(void);
sl@0
   153
	int (*i2a)(void);
sl@0
   154
	} X509_OBJECTS;
sl@0
   155
sl@0
   156
struct X509_algor_st
sl@0
   157
	{
sl@0
   158
	ASN1_OBJECT *algorithm;
sl@0
   159
	ASN1_TYPE *parameter;
sl@0
   160
	} /* X509_ALGOR */;
sl@0
   161
sl@0
   162
DECLARE_STACK_OF(X509_ALGOR)
sl@0
   163
DECLARE_ASN1_SET_OF(X509_ALGOR)
sl@0
   164
sl@0
   165
typedef struct X509_val_st
sl@0
   166
	{
sl@0
   167
	ASN1_TIME *notBefore;
sl@0
   168
	ASN1_TIME *notAfter;
sl@0
   169
	} X509_VAL;
sl@0
   170
sl@0
   171
typedef struct X509_pubkey_st
sl@0
   172
	{
sl@0
   173
	X509_ALGOR *algor;
sl@0
   174
	ASN1_BIT_STRING *public_key;
sl@0
   175
	EVP_PKEY *pkey;
sl@0
   176
	} X509_PUBKEY;
sl@0
   177
sl@0
   178
typedef struct X509_sig_st
sl@0
   179
	{
sl@0
   180
	X509_ALGOR *algor;
sl@0
   181
	ASN1_OCTET_STRING *digest;
sl@0
   182
	} X509_SIG;
sl@0
   183
sl@0
   184
typedef struct X509_name_entry_st
sl@0
   185
	{
sl@0
   186
	ASN1_OBJECT *object;
sl@0
   187
	ASN1_STRING *value;
sl@0
   188
	int set;
sl@0
   189
	int size; 	/* temp variable */
sl@0
   190
	} X509_NAME_ENTRY;
sl@0
   191
sl@0
   192
DECLARE_STACK_OF(X509_NAME_ENTRY)
sl@0
   193
DECLARE_ASN1_SET_OF(X509_NAME_ENTRY)
sl@0
   194
sl@0
   195
/* we always keep X509_NAMEs in 2 forms. */
sl@0
   196
struct X509_name_st
sl@0
   197
	{
sl@0
   198
	STACK_OF(X509_NAME_ENTRY) *entries;
sl@0
   199
	int modified;	/* true if 'bytes' needs to be built */
sl@0
   200
#ifndef OPENSSL_NO_BUFFER
sl@0
   201
	BUF_MEM *bytes;
sl@0
   202
#else
sl@0
   203
	char *bytes;
sl@0
   204
#endif
sl@0
   205
	unsigned long hash; /* Keep the hash around for lookups */
sl@0
   206
	} /* X509_NAME */;
sl@0
   207
sl@0
   208
DECLARE_STACK_OF(X509_NAME)
sl@0
   209
sl@0
   210
#define X509_EX_V_NETSCAPE_HACK		0x8000
sl@0
   211
#define X509_EX_V_INIT			0x0001
sl@0
   212
typedef struct X509_extension_st
sl@0
   213
	{
sl@0
   214
	ASN1_OBJECT *object;
sl@0
   215
	ASN1_BOOLEAN critical;
sl@0
   216
	ASN1_OCTET_STRING *value;
sl@0
   217
	} X509_EXTENSION;
sl@0
   218
sl@0
   219
DECLARE_STACK_OF(X509_EXTENSION)
sl@0
   220
DECLARE_ASN1_SET_OF(X509_EXTENSION)
sl@0
   221
sl@0
   222
/* a sequence of these are used */
sl@0
   223
typedef struct x509_attributes_st
sl@0
   224
	{
sl@0
   225
	ASN1_OBJECT *object;
sl@0
   226
	int single; /* 0 for a set, 1 for a single item (which is wrong) */
sl@0
   227
	union	{
sl@0
   228
		char		*ptr;
sl@0
   229
/* 0 */		STACK_OF(ASN1_TYPE) *set;
sl@0
   230
/* 1 */		ASN1_TYPE	*single;
sl@0
   231
		} value;
sl@0
   232
	} X509_ATTRIBUTE;
sl@0
   233
sl@0
   234
DECLARE_STACK_OF(X509_ATTRIBUTE)
sl@0
   235
DECLARE_ASN1_SET_OF(X509_ATTRIBUTE)
sl@0
   236
sl@0
   237
sl@0
   238
typedef struct X509_req_info_st
sl@0
   239
	{
sl@0
   240
	ASN1_ENCODING enc;
sl@0
   241
	ASN1_INTEGER *version;
sl@0
   242
	X509_NAME *subject;
sl@0
   243
	X509_PUBKEY *pubkey;
sl@0
   244
	/*  d=2 hl=2 l=  0 cons: cont: 00 */
sl@0
   245
	STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
sl@0
   246
	} X509_REQ_INFO;
sl@0
   247
sl@0
   248
typedef struct X509_req_st
sl@0
   249
	{
sl@0
   250
	X509_REQ_INFO *req_info;
sl@0
   251
	X509_ALGOR *sig_alg;
sl@0
   252
	ASN1_BIT_STRING *signature;
sl@0
   253
	int references;
sl@0
   254
	} X509_REQ;
sl@0
   255
sl@0
   256
typedef struct x509_cinf_st
sl@0
   257
	{
sl@0
   258
	ASN1_INTEGER *version;		/* [ 0 ] default of v1 */
sl@0
   259
	ASN1_INTEGER *serialNumber;
sl@0
   260
	X509_ALGOR *signature;
sl@0
   261
	X509_NAME *issuer;
sl@0
   262
	X509_VAL *validity;
sl@0
   263
	X509_NAME *subject;
sl@0
   264
	X509_PUBKEY *key;
sl@0
   265
	ASN1_BIT_STRING *issuerUID;		/* [ 1 ] optional in v2 */
sl@0
   266
	ASN1_BIT_STRING *subjectUID;		/* [ 2 ] optional in v2 */
sl@0
   267
	STACK_OF(X509_EXTENSION) *extensions;	/* [ 3 ] optional in v3 */
sl@0
   268
	} X509_CINF;
sl@0
   269
sl@0
   270
/* This stuff is certificate "auxiliary info"
sl@0
   271
 * it contains details which are useful in certificate
sl@0
   272
 * stores and databases. When used this is tagged onto
sl@0
   273
 * the end of the certificate itself
sl@0
   274
 */
sl@0
   275
sl@0
   276
typedef struct x509_cert_aux_st
sl@0
   277
	{
sl@0
   278
	STACK_OF(ASN1_OBJECT) *trust;		/* trusted uses */
sl@0
   279
	STACK_OF(ASN1_OBJECT) *reject;		/* rejected uses */
sl@0
   280
	ASN1_UTF8STRING *alias;			/* "friendly name" */
sl@0
   281
	ASN1_OCTET_STRING *keyid;		/* key id of private key */
sl@0
   282
	STACK_OF(X509_ALGOR) *other;		/* other unspecified info */
sl@0
   283
	} X509_CERT_AUX;
sl@0
   284
sl@0
   285
struct x509_st
sl@0
   286
	{
sl@0
   287
	X509_CINF *cert_info;
sl@0
   288
	X509_ALGOR *sig_alg;
sl@0
   289
	ASN1_BIT_STRING *signature;
sl@0
   290
	int valid;
sl@0
   291
	int references;
sl@0
   292
	char *name;
sl@0
   293
	CRYPTO_EX_DATA ex_data;
sl@0
   294
	/* These contain copies of various extension values */
sl@0
   295
	long ex_pathlen;
sl@0
   296
	long ex_pcpathlen;
sl@0
   297
	unsigned long ex_flags;
sl@0
   298
	unsigned long ex_kusage;
sl@0
   299
	unsigned long ex_xkusage;
sl@0
   300
	unsigned long ex_nscert;
sl@0
   301
	ASN1_OCTET_STRING *skid;
sl@0
   302
	struct AUTHORITY_KEYID_st *akid;
sl@0
   303
	X509_POLICY_CACHE *policy_cache;
sl@0
   304
#ifndef OPENSSL_NO_SHA
sl@0
   305
	unsigned char sha1_hash[SHA_DIGEST_LENGTH];
sl@0
   306
#endif
sl@0
   307
	X509_CERT_AUX *aux;
sl@0
   308
	} /* X509 */;
sl@0
   309
sl@0
   310
DECLARE_STACK_OF(X509)
sl@0
   311
DECLARE_ASN1_SET_OF(X509)
sl@0
   312
sl@0
   313
/* This is used for a table of trust checking functions */
sl@0
   314
sl@0
   315
typedef struct x509_trust_st {
sl@0
   316
	int trust;
sl@0
   317
	int flags;
sl@0
   318
	int (*check_trust)(struct x509_trust_st *, X509 *, int);
sl@0
   319
	char *name;
sl@0
   320
	int arg1;
sl@0
   321
	void *arg2;
sl@0
   322
} X509_TRUST;
sl@0
   323
sl@0
   324
DECLARE_STACK_OF(X509_TRUST)
sl@0
   325
sl@0
   326
typedef struct x509_cert_pair_st {
sl@0
   327
	X509 *forward;
sl@0
   328
	X509 *reverse;
sl@0
   329
} X509_CERT_PAIR;
sl@0
   330
sl@0
   331
/* standard trust ids */
sl@0
   332
sl@0
   333
#define X509_TRUST_DEFAULT	-1	/* Only valid in purpose settings */
sl@0
   334
sl@0
   335
#define X509_TRUST_COMPAT	1
sl@0
   336
#define X509_TRUST_SSL_CLIENT	2
sl@0
   337
#define X509_TRUST_SSL_SERVER	3
sl@0
   338
#define X509_TRUST_EMAIL	4
sl@0
   339
#define X509_TRUST_OBJECT_SIGN	5
sl@0
   340
#define X509_TRUST_OCSP_SIGN	6
sl@0
   341
#define X509_TRUST_OCSP_REQUEST	7
sl@0
   342
sl@0
   343
/* Keep these up to date! */
sl@0
   344
#define X509_TRUST_MIN		1
sl@0
   345
#define X509_TRUST_MAX		7
sl@0
   346
sl@0
   347
sl@0
   348
/* trust_flags values */
sl@0
   349
#define	X509_TRUST_DYNAMIC 	1
sl@0
   350
#define	X509_TRUST_DYNAMIC_NAME	2
sl@0
   351
sl@0
   352
/* check_trust return codes */
sl@0
   353
sl@0
   354
#define X509_TRUST_TRUSTED	1
sl@0
   355
#define X509_TRUST_REJECTED	2
sl@0
   356
#define X509_TRUST_UNTRUSTED	3
sl@0
   357
sl@0
   358
/* Flags for X509_print_ex() */
sl@0
   359
sl@0
   360
#define	X509_FLAG_COMPAT		0
sl@0
   361
#define	X509_FLAG_NO_HEADER		1L
sl@0
   362
#define	X509_FLAG_NO_VERSION		(1L << 1)
sl@0
   363
#define	X509_FLAG_NO_SERIAL		(1L << 2)
sl@0
   364
#define	X509_FLAG_NO_SIGNAME		(1L << 3)
sl@0
   365
#define	X509_FLAG_NO_ISSUER		(1L << 4)
sl@0
   366
#define	X509_FLAG_NO_VALIDITY		(1L << 5)
sl@0
   367
#define	X509_FLAG_NO_SUBJECT		(1L << 6)
sl@0
   368
#define	X509_FLAG_NO_PUBKEY		(1L << 7)
sl@0
   369
#define	X509_FLAG_NO_EXTENSIONS		(1L << 8)
sl@0
   370
#define	X509_FLAG_NO_SIGDUMP		(1L << 9)
sl@0
   371
#define	X509_FLAG_NO_AUX		(1L << 10)
sl@0
   372
#define	X509_FLAG_NO_ATTRIBUTES		(1L << 11)
sl@0
   373
sl@0
   374
/* Flags specific to X509_NAME_print_ex() */	
sl@0
   375
sl@0
   376
/* The field separator information */
sl@0
   377
sl@0
   378
#define XN_FLAG_SEP_MASK	(0xf << 16)
sl@0
   379
sl@0
   380
#define XN_FLAG_COMPAT		0		/* Traditional SSLeay: use old X509_NAME_print */
sl@0
   381
#define XN_FLAG_SEP_COMMA_PLUS	(1 << 16)	/* RFC2253 ,+ */
sl@0
   382
#define XN_FLAG_SEP_CPLUS_SPC	(2 << 16)	/* ,+ spaced: more readable */
sl@0
   383
#define XN_FLAG_SEP_SPLUS_SPC	(3 << 16)	/* ;+ spaced */
sl@0
   384
#define XN_FLAG_SEP_MULTILINE	(4 << 16)	/* One line per field */
sl@0
   385
sl@0
   386
#define XN_FLAG_DN_REV		(1 << 20)	/* Reverse DN order */
sl@0
   387
sl@0
   388
/* How the field name is shown */
sl@0
   389
sl@0
   390
#define XN_FLAG_FN_MASK		(0x3 << 21)
sl@0
   391
sl@0
   392
#define XN_FLAG_FN_SN		0		/* Object short name */
sl@0
   393
#define XN_FLAG_FN_LN		(1 << 21)	/* Object long name */
sl@0
   394
#define XN_FLAG_FN_OID		(2 << 21)	/* Always use OIDs */
sl@0
   395
#define XN_FLAG_FN_NONE		(3 << 21)	/* No field names */
sl@0
   396
sl@0
   397
#define XN_FLAG_SPC_EQ		(1 << 23)	/* Put spaces round '=' */
sl@0
   398
sl@0
   399
/* This determines if we dump fields we don't recognise:
sl@0
   400
 * RFC2253 requires this.
sl@0
   401
 */
sl@0
   402
sl@0
   403
#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
sl@0
   404
sl@0
   405
#define XN_FLAG_FN_ALIGN	(1 << 25)	/* Align field names to 20 characters */
sl@0
   406
sl@0
   407
/* Complete set of RFC2253 flags */
sl@0
   408
sl@0
   409
#define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \
sl@0
   410
			XN_FLAG_SEP_COMMA_PLUS | \
sl@0
   411
			XN_FLAG_DN_REV | \
sl@0
   412
			XN_FLAG_FN_SN | \
sl@0
   413
			XN_FLAG_DUMP_UNKNOWN_FIELDS)
sl@0
   414
sl@0
   415
/* readable oneline form */
sl@0
   416
sl@0
   417
#define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
sl@0
   418
			ASN1_STRFLGS_ESC_QUOTE | \
sl@0
   419
			XN_FLAG_SEP_CPLUS_SPC | \
sl@0
   420
			XN_FLAG_SPC_EQ | \
sl@0
   421
			XN_FLAG_FN_SN)
sl@0
   422
sl@0
   423
/* readable multiline form */
sl@0
   424
sl@0
   425
#define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \
sl@0
   426
			ASN1_STRFLGS_ESC_MSB | \
sl@0
   427
			XN_FLAG_SEP_MULTILINE | \
sl@0
   428
			XN_FLAG_SPC_EQ | \
sl@0
   429
			XN_FLAG_FN_LN | \
sl@0
   430
			XN_FLAG_FN_ALIGN)
sl@0
   431
sl@0
   432
typedef struct X509_revoked_st
sl@0
   433
	{
sl@0
   434
	ASN1_INTEGER *serialNumber;
sl@0
   435
	ASN1_TIME *revocationDate;
sl@0
   436
	STACK_OF(X509_EXTENSION) /* optional */ *extensions;
sl@0
   437
	int sequence; /* load sequence */
sl@0
   438
	} X509_REVOKED;
sl@0
   439
sl@0
   440
DECLARE_STACK_OF(X509_REVOKED)
sl@0
   441
DECLARE_ASN1_SET_OF(X509_REVOKED)
sl@0
   442
sl@0
   443
typedef struct X509_crl_info_st
sl@0
   444
	{
sl@0
   445
	ASN1_INTEGER *version;
sl@0
   446
	X509_ALGOR *sig_alg;
sl@0
   447
	X509_NAME *issuer;
sl@0
   448
	ASN1_TIME *lastUpdate;
sl@0
   449
	ASN1_TIME *nextUpdate;
sl@0
   450
	STACK_OF(X509_REVOKED) *revoked;
sl@0
   451
	STACK_OF(X509_EXTENSION) /* [0] */ *extensions;
sl@0
   452
	ASN1_ENCODING enc;
sl@0
   453
	} X509_CRL_INFO;
sl@0
   454
sl@0
   455
struct X509_crl_st
sl@0
   456
	{
sl@0
   457
	/* actual signature */
sl@0
   458
	X509_CRL_INFO *crl;
sl@0
   459
	X509_ALGOR *sig_alg;
sl@0
   460
	ASN1_BIT_STRING *signature;
sl@0
   461
	int references;
sl@0
   462
	} /* X509_CRL */;
sl@0
   463
sl@0
   464
DECLARE_STACK_OF(X509_CRL)
sl@0
   465
DECLARE_ASN1_SET_OF(X509_CRL)
sl@0
   466
sl@0
   467
typedef struct private_key_st
sl@0
   468
	{
sl@0
   469
	int version;
sl@0
   470
	/* The PKCS#8 data types */
sl@0
   471
	X509_ALGOR *enc_algor;
sl@0
   472
	ASN1_OCTET_STRING *enc_pkey;	/* encrypted pub key */
sl@0
   473
sl@0
   474
	/* When decrypted, the following will not be NULL */
sl@0
   475
	EVP_PKEY *dec_pkey;
sl@0
   476
sl@0
   477
	/* used to encrypt and decrypt */
sl@0
   478
	int key_length;
sl@0
   479
	char *key_data;
sl@0
   480
	int key_free;	/* true if we should auto free key_data */
sl@0
   481
sl@0
   482
	/* expanded version of 'enc_algor' */
sl@0
   483
	EVP_CIPHER_INFO cipher;
sl@0
   484
sl@0
   485
	int references;
sl@0
   486
	} X509_PKEY;
sl@0
   487
sl@0
   488
#ifndef OPENSSL_NO_EVP
sl@0
   489
typedef struct X509_info_st
sl@0
   490
	{
sl@0
   491
	X509 *x509;
sl@0
   492
	X509_CRL *crl;
sl@0
   493
	X509_PKEY *x_pkey;
sl@0
   494
sl@0
   495
	EVP_CIPHER_INFO enc_cipher;
sl@0
   496
	int enc_len;
sl@0
   497
	char *enc_data;
sl@0
   498
sl@0
   499
	int references;
sl@0
   500
	} X509_INFO;
sl@0
   501
sl@0
   502
DECLARE_STACK_OF(X509_INFO)
sl@0
   503
#endif
sl@0
   504
sl@0
   505
/* The next 2 structures and their 8 routines were sent to me by
sl@0
   506
 * Pat Richard <patr@x509.com> and are used to manipulate
sl@0
   507
 * Netscapes spki structures - useful if you are writing a CA web page
sl@0
   508
 */
sl@0
   509
typedef struct Netscape_spkac_st
sl@0
   510
	{
sl@0
   511
	X509_PUBKEY *pubkey;
sl@0
   512
	ASN1_IA5STRING *challenge;	/* challenge sent in atlas >= PR2 */
sl@0
   513
	} NETSCAPE_SPKAC;
sl@0
   514
sl@0
   515
typedef struct Netscape_spki_st
sl@0
   516
	{
sl@0
   517
	NETSCAPE_SPKAC *spkac;	/* signed public key and challenge */
sl@0
   518
	X509_ALGOR *sig_algor;
sl@0
   519
	ASN1_BIT_STRING *signature;
sl@0
   520
	} NETSCAPE_SPKI;
sl@0
   521
sl@0
   522
/* Netscape certificate sequence structure */
sl@0
   523
typedef struct Netscape_certificate_sequence
sl@0
   524
	{
sl@0
   525
	ASN1_OBJECT *type;
sl@0
   526
	STACK_OF(X509) *certs;
sl@0
   527
	} NETSCAPE_CERT_SEQUENCE;
sl@0
   528
sl@0
   529
/* Unused (and iv length is wrong)
sl@0
   530
typedef struct CBCParameter_st
sl@0
   531
	{
sl@0
   532
	unsigned char iv[8];
sl@0
   533
	} CBC_PARAM;
sl@0
   534
*/
sl@0
   535
sl@0
   536
/* Password based encryption structure */
sl@0
   537
sl@0
   538
typedef struct PBEPARAM_st {
sl@0
   539
ASN1_OCTET_STRING *salt;
sl@0
   540
ASN1_INTEGER *iter;
sl@0
   541
} PBEPARAM;
sl@0
   542
sl@0
   543
/* Password based encryption V2 structures */
sl@0
   544
sl@0
   545
typedef struct PBE2PARAM_st {
sl@0
   546
X509_ALGOR *keyfunc;
sl@0
   547
X509_ALGOR *encryption;
sl@0
   548
} PBE2PARAM;
sl@0
   549
sl@0
   550
typedef struct PBKDF2PARAM_st {
sl@0
   551
ASN1_TYPE *salt;	/* Usually OCTET STRING but could be anything */
sl@0
   552
ASN1_INTEGER *iter;
sl@0
   553
ASN1_INTEGER *keylength;
sl@0
   554
X509_ALGOR *prf;
sl@0
   555
} PBKDF2PARAM;
sl@0
   556
sl@0
   557
sl@0
   558
/* PKCS#8 private key info structure */
sl@0
   559
sl@0
   560
typedef struct pkcs8_priv_key_info_st
sl@0
   561
        {
sl@0
   562
        int broken;     /* Flag for various broken formats */
sl@0
   563
#define PKCS8_OK		0
sl@0
   564
#define PKCS8_NO_OCTET		1
sl@0
   565
#define PKCS8_EMBEDDED_PARAM	2
sl@0
   566
#define PKCS8_NS_DB		3
sl@0
   567
        ASN1_INTEGER *version;
sl@0
   568
        X509_ALGOR *pkeyalg;
sl@0
   569
        ASN1_TYPE *pkey; /* Should be OCTET STRING but some are broken */
sl@0
   570
        STACK_OF(X509_ATTRIBUTE) *attributes;
sl@0
   571
        } PKCS8_PRIV_KEY_INFO;
sl@0
   572
sl@0
   573
#ifdef  __cplusplus
sl@0
   574
}
sl@0
   575
#endif
sl@0
   576
sl@0
   577
#include <openssl/x509_vfy.h>
sl@0
   578
#include <openssl/pkcs7.h>
sl@0
   579
sl@0
   580
#ifdef  __cplusplus
sl@0
   581
extern "C" {
sl@0
   582
#endif
sl@0
   583
sl@0
   584
#ifdef SSLEAY_MACROS
sl@0
   585
#define X509_verify(a,r) ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg,\
sl@0
   586
	a->signature,(char *)a->cert_info,r)
sl@0
   587
#define X509_REQ_verify(a,r) ASN1_verify((int (*)())i2d_X509_REQ_INFO, \
sl@0
   588
	a->sig_alg,a->signature,(char *)a->req_info,r)
sl@0
   589
#define X509_CRL_verify(a,r) ASN1_verify((int (*)())i2d_X509_CRL_INFO, \
sl@0
   590
	a->sig_alg, a->signature,(char *)a->crl,r)
sl@0
   591
sl@0
   592
#define X509_sign(x,pkey,md) \
sl@0
   593
	ASN1_sign((int (*)())i2d_X509_CINF, x->cert_info->signature, \
sl@0
   594
		x->sig_alg, x->signature, (char *)x->cert_info,pkey,md)
sl@0
   595
#define X509_REQ_sign(x,pkey,md) \
sl@0
   596
	ASN1_sign((int (*)())i2d_X509_REQ_INFO,x->sig_alg, NULL, \
sl@0
   597
		x->signature, (char *)x->req_info,pkey,md)
sl@0
   598
#define X509_CRL_sign(x,pkey,md) \
sl@0
   599
	ASN1_sign((int (*)())i2d_X509_CRL_INFO,x->crl->sig_alg,x->sig_alg, \
sl@0
   600
		x->signature, (char *)x->crl,pkey,md)
sl@0
   601
#define NETSCAPE_SPKI_sign(x,pkey,md) \
sl@0
   602
	ASN1_sign((int (*)())i2d_NETSCAPE_SPKAC, x->sig_algor,NULL, \
sl@0
   603
		x->signature, (char *)x->spkac,pkey,md)
sl@0
   604
sl@0
   605
#define X509_dup(x509) (X509 *)ASN1_dup((int (*)())i2d_X509, \
sl@0
   606
		(char *(*)())d2i_X509,(char *)x509)
sl@0
   607
#define X509_ATTRIBUTE_dup(xa) (X509_ATTRIBUTE *)ASN1_dup(\
sl@0
   608
		(int (*)())i2d_X509_ATTRIBUTE, \
sl@0
   609
		(char *(*)())d2i_X509_ATTRIBUTE,(char *)xa)
sl@0
   610
#define X509_EXTENSION_dup(ex) (X509_EXTENSION *)ASN1_dup( \
sl@0
   611
		(int (*)())i2d_X509_EXTENSION, \
sl@0
   612
		(char *(*)())d2i_X509_EXTENSION,(char *)ex)
sl@0
   613
#define d2i_X509_fp(fp,x509) (X509 *)ASN1_d2i_fp((char *(*)())X509_new, \
sl@0
   614
		(char *(*)())d2i_X509, (fp),(unsigned char **)(x509))
sl@0
   615
#define i2d_X509_fp(fp,x509) ASN1_i2d_fp(i2d_X509,fp,(unsigned char *)x509)
sl@0
   616
#define d2i_X509_bio(bp,x509) (X509 *)ASN1_d2i_bio((char *(*)())X509_new, \
sl@0
   617
		(char *(*)())d2i_X509, (bp),(unsigned char **)(x509))
sl@0
   618
#define i2d_X509_bio(bp,x509) ASN1_i2d_bio(i2d_X509,bp,(unsigned char *)x509)
sl@0
   619
sl@0
   620
#define X509_CRL_dup(crl) (X509_CRL *)ASN1_dup((int (*)())i2d_X509_CRL, \
sl@0
   621
		(char *(*)())d2i_X509_CRL,(char *)crl)
sl@0
   622
#define d2i_X509_CRL_fp(fp,crl) (X509_CRL *)ASN1_d2i_fp((char *(*)()) \
sl@0
   623
		X509_CRL_new,(char *(*)())d2i_X509_CRL, (fp),\
sl@0
   624
		(unsigned char **)(crl))
sl@0
   625
#define i2d_X509_CRL_fp(fp,crl) ASN1_i2d_fp(i2d_X509_CRL,fp,\
sl@0
   626
		(unsigned char *)crl)
sl@0
   627
#define d2i_X509_CRL_bio(bp,crl) (X509_CRL *)ASN1_d2i_bio((char *(*)()) \
sl@0
   628
		X509_CRL_new,(char *(*)())d2i_X509_CRL, (bp),\
sl@0
   629
		(unsigned char **)(crl))
sl@0
   630
#define i2d_X509_CRL_bio(bp,crl) ASN1_i2d_bio(i2d_X509_CRL,bp,\
sl@0
   631
		(unsigned char *)crl)
sl@0
   632
sl@0
   633
#define PKCS7_dup(p7) (PKCS7 *)ASN1_dup((int (*)())i2d_PKCS7, \
sl@0
   634
		(char *(*)())d2i_PKCS7,(char *)p7)
sl@0
   635
#define d2i_PKCS7_fp(fp,p7) (PKCS7 *)ASN1_d2i_fp((char *(*)()) \
sl@0
   636
		PKCS7_new,(char *(*)())d2i_PKCS7, (fp),\
sl@0
   637
		(unsigned char **)(p7))
sl@0
   638
#define i2d_PKCS7_fp(fp,p7) ASN1_i2d_fp(i2d_PKCS7,fp,\
sl@0
   639
		(unsigned char *)p7)
sl@0
   640
#define d2i_PKCS7_bio(bp,p7) (PKCS7 *)ASN1_d2i_bio((char *(*)()) \
sl@0
   641
		PKCS7_new,(char *(*)())d2i_PKCS7, (bp),\
sl@0
   642
		(unsigned char **)(p7))
sl@0
   643
#define i2d_PKCS7_bio(bp,p7) ASN1_i2d_bio(i2d_PKCS7,bp,\
sl@0
   644
		(unsigned char *)p7)
sl@0
   645
sl@0
   646
#define X509_REQ_dup(req) (X509_REQ *)ASN1_dup((int (*)())i2d_X509_REQ, \
sl@0
   647
		(char *(*)())d2i_X509_REQ,(char *)req)
sl@0
   648
#define d2i_X509_REQ_fp(fp,req) (X509_REQ *)ASN1_d2i_fp((char *(*)())\
sl@0
   649
		X509_REQ_new, (char *(*)())d2i_X509_REQ, (fp),\
sl@0
   650
		(unsigned char **)(req))
sl@0
   651
#define i2d_X509_REQ_fp(fp,req) ASN1_i2d_fp(i2d_X509_REQ,fp,\
sl@0
   652
		(unsigned char *)req)
sl@0
   653
#define d2i_X509_REQ_bio(bp,req) (X509_REQ *)ASN1_d2i_bio((char *(*)())\
sl@0
   654
		X509_REQ_new, (char *(*)())d2i_X509_REQ, (bp),\
sl@0
   655
		(unsigned char **)(req))
sl@0
   656
#define i2d_X509_REQ_bio(bp,req) ASN1_i2d_bio(i2d_X509_REQ,bp,\
sl@0
   657
		(unsigned char *)req)
sl@0
   658
sl@0
   659
#define RSAPublicKey_dup(rsa) (RSA *)ASN1_dup((int (*)())i2d_RSAPublicKey, \
sl@0
   660
		(char *(*)())d2i_RSAPublicKey,(char *)rsa)
sl@0
   661
#define RSAPrivateKey_dup(rsa) (RSA *)ASN1_dup((int (*)())i2d_RSAPrivateKey, \
sl@0
   662
		(char *(*)())d2i_RSAPrivateKey,(char *)rsa)
sl@0
   663
sl@0
   664
#define d2i_RSAPrivateKey_fp(fp,rsa) (RSA *)ASN1_d2i_fp((char *(*)())\
sl@0
   665
		RSA_new,(char *(*)())d2i_RSAPrivateKey, (fp), \
sl@0
   666
		(unsigned char **)(rsa))
sl@0
   667
#define i2d_RSAPrivateKey_fp(fp,rsa) ASN1_i2d_fp(i2d_RSAPrivateKey,fp, \
sl@0
   668
		(unsigned char *)rsa)
sl@0
   669
#define d2i_RSAPrivateKey_bio(bp,rsa) (RSA *)ASN1_d2i_bio((char *(*)())\
sl@0
   670
		RSA_new,(char *(*)())d2i_RSAPrivateKey, (bp), \
sl@0
   671
		(unsigned char **)(rsa))
sl@0
   672
#define i2d_RSAPrivateKey_bio(bp,rsa) ASN1_i2d_bio(i2d_RSAPrivateKey,bp, \
sl@0
   673
		(unsigned char *)rsa)
sl@0
   674
sl@0
   675
#define d2i_RSAPublicKey_fp(fp,rsa) (RSA *)ASN1_d2i_fp((char *(*)())\
sl@0
   676
		RSA_new,(char *(*)())d2i_RSAPublicKey, (fp), \
sl@0
   677
		(unsigned char **)(rsa))
sl@0
   678
#define i2d_RSAPublicKey_fp(fp,rsa) ASN1_i2d_fp(i2d_RSAPublicKey,fp, \
sl@0
   679
		(unsigned char *)rsa)
sl@0
   680
#define d2i_RSAPublicKey_bio(bp,rsa) (RSA *)ASN1_d2i_bio((char *(*)())\
sl@0
   681
		RSA_new,(char *(*)())d2i_RSAPublicKey, (bp), \
sl@0
   682
		(unsigned char **)(rsa))
sl@0
   683
#define i2d_RSAPublicKey_bio(bp,rsa) ASN1_i2d_bio(i2d_RSAPublicKey,bp, \
sl@0
   684
		(unsigned char *)rsa)
sl@0
   685
sl@0
   686
#define d2i_DSAPrivateKey_fp(fp,dsa) (DSA *)ASN1_d2i_fp((char *(*)())\
sl@0
   687
		DSA_new,(char *(*)())d2i_DSAPrivateKey, (fp), \
sl@0
   688
		(unsigned char **)(dsa))
sl@0
   689
#define i2d_DSAPrivateKey_fp(fp,dsa) ASN1_i2d_fp(i2d_DSAPrivateKey,fp, \
sl@0
   690
		(unsigned char *)dsa)
sl@0
   691
#define d2i_DSAPrivateKey_bio(bp,dsa) (DSA *)ASN1_d2i_bio((char *(*)())\
sl@0
   692
		DSA_new,(char *(*)())d2i_DSAPrivateKey, (bp), \
sl@0
   693
		(unsigned char **)(dsa))
sl@0
   694
#define i2d_DSAPrivateKey_bio(bp,dsa) ASN1_i2d_bio(i2d_DSAPrivateKey,bp, \
sl@0
   695
		(unsigned char *)dsa)
sl@0
   696
sl@0
   697
#define d2i_ECPrivateKey_fp(fp,ecdsa) (EC_KEY *)ASN1_d2i_fp((char *(*)())\
sl@0
   698
		EC_KEY_new,(char *(*)())d2i_ECPrivateKey, (fp), \
sl@0
   699
		(unsigned char **)(ecdsa))
sl@0
   700
#define i2d_ECPrivateKey_fp(fp,ecdsa) ASN1_i2d_fp(i2d_ECPrivateKey,fp, \
sl@0
   701
		(unsigned char *)ecdsa)
sl@0
   702
#define d2i_ECPrivateKey_bio(bp,ecdsa) (EC_KEY *)ASN1_d2i_bio((char *(*)())\
sl@0
   703
		EC_KEY_new,(char *(*)())d2i_ECPrivateKey, (bp), \
sl@0
   704
		(unsigned char **)(ecdsa))
sl@0
   705
#define i2d_ECPrivateKey_bio(bp,ecdsa) ASN1_i2d_bio(i2d_ECPrivateKey,bp, \
sl@0
   706
		(unsigned char *)ecdsa)
sl@0
   707
sl@0
   708
#define X509_ALGOR_dup(xn) (X509_ALGOR *)ASN1_dup((int (*)())i2d_X509_ALGOR,\
sl@0
   709
		(char *(*)())d2i_X509_ALGOR,(char *)xn)
sl@0
   710
sl@0
   711
#define X509_NAME_dup(xn) (X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, \
sl@0
   712
		(char *(*)())d2i_X509_NAME,(char *)xn)
sl@0
   713
#define X509_NAME_ENTRY_dup(ne) (X509_NAME_ENTRY *)ASN1_dup( \
sl@0
   714
		(int (*)())i2d_X509_NAME_ENTRY, \
sl@0
   715
		(char *(*)())d2i_X509_NAME_ENTRY,\
sl@0
   716
		(char *)ne)
sl@0
   717
sl@0
   718
#define X509_digest(data,type,md,len) \
sl@0
   719
	ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len)
sl@0
   720
#define X509_NAME_digest(data,type,md,len) \
sl@0
   721
	ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len)
sl@0
   722
#ifndef PKCS7_ISSUER_AND_SERIAL_digest
sl@0
   723
#define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \
sl@0
   724
	ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\
sl@0
   725
		(char *)data,md,len)
sl@0
   726
#endif
sl@0
   727
#endif
sl@0
   728
sl@0
   729
#define X509_EXT_PACK_UNKNOWN	1
sl@0
   730
#define X509_EXT_PACK_STRING	2
sl@0
   731
sl@0
   732
#define		X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version)
sl@0
   733
/* #define	X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */
sl@0
   734
#define		X509_get_notBefore(x) ((x)->cert_info->validity->notBefore)
sl@0
   735
#define		X509_get_notAfter(x) ((x)->cert_info->validity->notAfter)
sl@0
   736
#define		X509_extract_key(x)	X509_get_pubkey(x) /*****/
sl@0
   737
#define		X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version)
sl@0
   738
#define		X509_REQ_get_subject_name(x) ((x)->req_info->subject)
sl@0
   739
#define		X509_REQ_extract_key(a)	X509_REQ_get_pubkey(a)
sl@0
   740
#define		X509_name_cmp(a,b)	X509_NAME_cmp((a),(b))
sl@0
   741
#define		X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm))
sl@0
   742
sl@0
   743
#define		X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version)
sl@0
   744
#define 	X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate)
sl@0
   745
#define 	X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate)
sl@0
   746
#define		X509_CRL_get_issuer(x) ((x)->crl->issuer)
sl@0
   747
#define		X509_CRL_get_REVOKED(x) ((x)->crl->revoked)
sl@0
   748
sl@0
   749
/* This one is only used so that a binary form can output, as in
sl@0
   750
 * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) */
sl@0
   751
#define 	X509_get_X509_PUBKEY(x) ((x)->cert_info->key)
sl@0
   752
sl@0
   753
sl@0
   754
IMPORT_C const char *X509_verify_cert_error_string(long n);
sl@0
   755
sl@0
   756
#ifndef SSLEAY_MACROS
sl@0
   757
#ifndef OPENSSL_NO_EVP
sl@0
   758
IMPORT_C int X509_verify(X509 *a, EVP_PKEY *r);
sl@0
   759
sl@0
   760
IMPORT_C int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
sl@0
   761
IMPORT_C int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r);
sl@0
   762
IMPORT_C int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r);
sl@0
   763
sl@0
   764
IMPORT_C NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len);
sl@0
   765
IMPORT_C char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x);
sl@0
   766
IMPORT_C EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x);
sl@0
   767
IMPORT_C int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey);
sl@0
   768
sl@0
   769
IMPORT_C int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki);
sl@0
   770
sl@0
   771
IMPORT_C int X509_signature_print(BIO *bp,X509_ALGOR *alg, ASN1_STRING *sig);
sl@0
   772
sl@0
   773
IMPORT_C int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
sl@0
   774
IMPORT_C int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
sl@0
   775
IMPORT_C int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
sl@0
   776
IMPORT_C int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md);
sl@0
   777
sl@0
   778
IMPORT_C int X509_pubkey_digest(const X509 *data,const EVP_MD *type,
sl@0
   779
		unsigned char *md, unsigned int *len);
sl@0
   780
IMPORT_C int X509_digest(const X509 *data,const EVP_MD *type,
sl@0
   781
		unsigned char *md, unsigned int *len);
sl@0
   782
IMPORT_C int X509_CRL_digest(const X509_CRL *data,const EVP_MD *type,
sl@0
   783
		unsigned char *md, unsigned int *len);
sl@0
   784
IMPORT_C int X509_REQ_digest(const X509_REQ *data,const EVP_MD *type,
sl@0
   785
		unsigned char *md, unsigned int *len);
sl@0
   786
IMPORT_C int X509_NAME_digest(const X509_NAME *data,const EVP_MD *type,
sl@0
   787
		unsigned char *md, unsigned int *len);
sl@0
   788
#endif
sl@0
   789
sl@0
   790
#ifndef OPENSSL_NO_FP_API
sl@0
   791
IMPORT_C X509 *d2i_X509_fp(FILE *fp, X509 **x509);
sl@0
   792
IMPORT_C int i2d_X509_fp(FILE *fp,X509 *x509);
sl@0
   793
IMPORT_C X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl);
sl@0
   794
IMPORT_C int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl);
sl@0
   795
X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req);
sl@0
   796
IMPORT_C int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req);
sl@0
   797
#ifndef OPENSSL_NO_RSA
sl@0
   798
IMPORT_C RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa);
sl@0
   799
IMPORT_C int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa);
sl@0
   800
IMPORT_C RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA **rsa);
sl@0
   801
IMPORT_C int i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa);
sl@0
   802
IMPORT_C RSA *d2i_RSA_PUBKEY_fp(FILE *fp,RSA **rsa);
sl@0
   803
IMPORT_C int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa);
sl@0
   804
#endif
sl@0
   805
#ifndef OPENSSL_NO_DSA
sl@0
   806
IMPORT_C DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa);
sl@0
   807
IMPORT_C int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa);
sl@0
   808
IMPORT_C DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa);
sl@0
   809
IMPORT_C int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa);
sl@0
   810
#endif
sl@0
   811
IMPORT_C X509_SIG *d2i_PKCS8_fp(FILE *fp,X509_SIG **p8);
sl@0
   812
IMPORT_C int i2d_PKCS8_fp(FILE *fp,X509_SIG *p8);
sl@0
   813
IMPORT_C PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
sl@0
   814
						PKCS8_PRIV_KEY_INFO **p8inf);
sl@0
   815
IMPORT_C int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,PKCS8_PRIV_KEY_INFO *p8inf);
sl@0
   816
IMPORT_C int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key);
sl@0
   817
IMPORT_C int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey);
sl@0
   818
IMPORT_C EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a);
sl@0
   819
IMPORT_C int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey);
sl@0
   820
IMPORT_C EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a);
sl@0
   821
#endif
sl@0
   822
sl@0
   823
#ifndef OPENSSL_NO_BIO
sl@0
   824
IMPORT_C X509 *d2i_X509_bio(BIO *bp,X509 **x509);
sl@0
   825
IMPORT_C int i2d_X509_bio(BIO *bp,X509 *x509);
sl@0
   826
IMPORT_C X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl);
sl@0
   827
IMPORT_C int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl);
sl@0
   828
IMPORT_C X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req);
sl@0
   829
IMPORT_C int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req);
sl@0
   830
#ifndef OPENSSL_NO_RSA
sl@0
   831
IMPORT_C RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa);
sl@0
   832
IMPORT_C int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa);
sl@0
   833
IMPORT_C RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA **rsa);
sl@0
   834
IMPORT_C int i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa);
sl@0
   835
IMPORT_C RSA *d2i_RSA_PUBKEY_bio(BIO *bp,RSA **rsa);
sl@0
   836
IMPORT_C int i2d_RSA_PUBKEY_bio(BIO *bp,RSA *rsa);
sl@0
   837
#endif
sl@0
   838
#ifndef OPENSSL_NO_DSA
sl@0
   839
IMPORT_C DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa);
sl@0
   840
IMPORT_C int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa);
sl@0
   841
IMPORT_C DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa);
sl@0
   842
IMPORT_C int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa);
sl@0
   843
#endif
sl@0
   844
IMPORT_C X509_SIG *d2i_PKCS8_bio(BIO *bp,X509_SIG **p8);
sl@0
   845
IMPORT_C int i2d_PKCS8_bio(BIO *bp,X509_SIG *p8);
sl@0
   846
IMPORT_C PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
sl@0
   847
						PKCS8_PRIV_KEY_INFO **p8inf);
sl@0
   848
IMPORT_C int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,PKCS8_PRIV_KEY_INFO *p8inf);
sl@0
   849
IMPORT_C int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key);
sl@0
   850
IMPORT_C int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey);
sl@0
   851
IMPORT_C EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a);
sl@0
   852
IMPORT_C int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey);
sl@0
   853
IMPORT_C EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a);
sl@0
   854
#endif
sl@0
   855
sl@0
   856
IMPORT_C X509 *X509_dup(X509 *x509);
sl@0
   857
IMPORT_C X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa);
sl@0
   858
IMPORT_C X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex);
sl@0
   859
IMPORT_C X509_CRL *X509_CRL_dup(X509_CRL *crl);
sl@0
   860
IMPORT_C X509_REQ *X509_REQ_dup(X509_REQ *req);
sl@0
   861
IMPORT_C X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn);
sl@0
   862
IMPORT_C X509_NAME *X509_NAME_dup(X509_NAME *xn);
sl@0
   863
IMPORT_C X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne);
sl@0
   864
sl@0
   865
#endif /* !SSLEAY_MACROS */
sl@0
   866
sl@0
   867
IMPORT_C int		X509_cmp_time(ASN1_TIME *s, time_t *t);
sl@0
   868
IMPORT_C int		X509_cmp_current_time(ASN1_TIME *s);
sl@0
   869
IMPORT_C ASN1_TIME *	X509_time_adj(ASN1_TIME *s, long adj, time_t *t);
sl@0
   870
IMPORT_C ASN1_TIME *	X509_gmtime_adj(ASN1_TIME *s, long adj);
sl@0
   871
sl@0
   872
IMPORT_C const char *	X509_get_default_cert_area(void );
sl@0
   873
IMPORT_C const char *	X509_get_default_cert_dir(void );
sl@0
   874
IMPORT_C const char *	X509_get_default_cert_file(void );
sl@0
   875
IMPORT_C const char *	X509_get_default_cert_dir_env(void );
sl@0
   876
IMPORT_C const char *	X509_get_default_cert_file_env(void );
sl@0
   877
IMPORT_C const char *	X509_get_default_private_dir(void );
sl@0
   878
sl@0
   879
IMPORT_C X509_REQ *	X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
sl@0
   880
IMPORT_C X509 *		X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey);
sl@0
   881
sl@0
   882
DECLARE_ASN1_FUNCTIONS(X509_ALGOR)
sl@0
   883
DECLARE_ASN1_FUNCTIONS(X509_VAL)
sl@0
   884
sl@0
   885
DECLARE_ASN1_FUNCTIONS(X509_PUBKEY)
sl@0
   886
sl@0
   887
IMPORT_C int		X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);
sl@0
   888
IMPORT_C EVP_PKEY *	X509_PUBKEY_get(X509_PUBKEY *key);
sl@0
   889
IMPORT_C int		X509_get_pubkey_parameters(EVP_PKEY *pkey,
sl@0
   890
					   STACK_OF(X509) *chain);
sl@0
   891
IMPORT_C int		i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp);
sl@0
   892
IMPORT_C EVP_PKEY *	d2i_PUBKEY(EVP_PKEY **a,const unsigned char **pp,
sl@0
   893
			long length);
sl@0
   894
#ifndef OPENSSL_NO_RSA
sl@0
   895
IMPORT_C int		i2d_RSA_PUBKEY(RSA *a,unsigned char **pp);
sl@0
   896
IMPORT_C RSA *		d2i_RSA_PUBKEY(RSA **a,const unsigned char **pp,
sl@0
   897
			long length);
sl@0
   898
#endif
sl@0
   899
#ifndef OPENSSL_NO_DSA
sl@0
   900
IMPORT_C int		i2d_DSA_PUBKEY(DSA *a,unsigned char **pp);
sl@0
   901
IMPORT_C DSA *		d2i_DSA_PUBKEY(DSA **a,const unsigned char **pp,
sl@0
   902
			long length);
sl@0
   903
#endif
sl@0
   904
#ifndef OPENSSL_NO_EC
sl@0
   905
IMPORT_C int		i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp);
sl@0
   906
EC_KEY 		*d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp,
sl@0
   907
			long length);
sl@0
   908
#endif
sl@0
   909
sl@0
   910
DECLARE_ASN1_FUNCTIONS(X509_SIG)
sl@0
   911
DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO)
sl@0
   912
DECLARE_ASN1_FUNCTIONS(X509_REQ)
sl@0
   913
sl@0
   914
DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE)
sl@0
   915
IMPORT_C X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value);
sl@0
   916
sl@0
   917
DECLARE_ASN1_FUNCTIONS(X509_EXTENSION)
sl@0
   918
sl@0
   919
DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY)
sl@0
   920
sl@0
   921
DECLARE_ASN1_FUNCTIONS(X509_NAME)
sl@0
   922
sl@0
   923
IMPORT_C int X509_NAME_set(X509_NAME **xn, X509_NAME *name);
sl@0
   924
sl@0
   925
DECLARE_ASN1_FUNCTIONS(X509_CINF)
sl@0
   926
sl@0
   927
DECLARE_ASN1_FUNCTIONS(X509)
sl@0
   928
DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX)
sl@0
   929
sl@0
   930
DECLARE_ASN1_FUNCTIONS(X509_CERT_PAIR)
sl@0
   931
sl@0
   932
IMPORT_C int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
sl@0
   933
	     CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
sl@0
   934
IMPORT_C int X509_set_ex_data(X509 *r, int idx, void *arg);
sl@0
   935
IMPORT_C void *X509_get_ex_data(X509 *r, int idx);
sl@0
   936
IMPORT_C int		i2d_X509_AUX(X509 *a,unsigned char **pp);
sl@0
   937
IMPORT_C X509 *		d2i_X509_AUX(X509 **a,const unsigned char **pp,long length);
sl@0
   938
sl@0
   939
IMPORT_C int X509_alias_set1(X509 *x, unsigned char *name, int len);
sl@0
   940
IMPORT_C int X509_keyid_set1(X509 *x, unsigned char *id, int len);
sl@0
   941
IMPORT_C unsigned char * X509_alias_get0(X509 *x, int *len);
sl@0
   942
IMPORT_C unsigned char * X509_keyid_get0(X509 *x, int *len);
sl@0
   943
IMPORT_C int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int);
sl@0
   944
IMPORT_C int X509_TRUST_set(int *t, int trust);
sl@0
   945
IMPORT_C int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj);
sl@0
   946
IMPORT_C int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj);
sl@0
   947
IMPORT_C void X509_trust_clear(X509 *x);
sl@0
   948
IMPORT_C void X509_reject_clear(X509 *x);
sl@0
   949
sl@0
   950
DECLARE_ASN1_FUNCTIONS(X509_REVOKED)
sl@0
   951
DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO)
sl@0
   952
DECLARE_ASN1_FUNCTIONS(X509_CRL)
sl@0
   953
sl@0
   954
IMPORT_C int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
sl@0
   955
sl@0
   956
IMPORT_C X509_PKEY *	X509_PKEY_new(void );
sl@0
   957
IMPORT_C void		X509_PKEY_free(X509_PKEY *a);
sl@0
   958
IMPORT_C int		i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp);
sl@0
   959
IMPORT_C X509_PKEY *	d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length);
sl@0
   960
sl@0
   961
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
sl@0
   962
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
sl@0
   963
DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE)
sl@0
   964
sl@0
   965
#ifndef OPENSSL_NO_EVP
sl@0
   966
IMPORT_C X509_INFO *	X509_INFO_new(void);
sl@0
   967
IMPORT_C void X509_INFO_free(X509_INFO *a);
sl@0
   968
IMPORT_C char* X509_NAME_oneline(X509_NAME *a,char *buf,int size);
sl@0
   969
sl@0
   970
IMPORT_C int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1,
sl@0
   971
		ASN1_BIT_STRING *signature,char *data,EVP_PKEY *pkey);
sl@0
   972
sl@0
   973
IMPORT_C int ASN1_digest(i2d_of_void *i2d,const EVP_MD *type,char *data,
sl@0
   974
		unsigned char *md,unsigned int *len);
sl@0
   975
sl@0
   976
IMPORT_C int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1,
sl@0
   977
	      X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
sl@0
   978
	      char *data,EVP_PKEY *pkey, const EVP_MD *type);
sl@0
   979
sl@0
   980
IMPORT_C int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data,
sl@0
   981
	unsigned char *md,unsigned int *len);
sl@0
   982
sl@0
   983
IMPORT_C int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1,
sl@0
   984
	ASN1_BIT_STRING *signature,void *data,EVP_PKEY *pkey);
sl@0
   985
sl@0
   986
IMPORT_C int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
sl@0
   987
	ASN1_BIT_STRING *signature,
sl@0
   988
	void *data, EVP_PKEY *pkey, const EVP_MD *type);
sl@0
   989
#endif
sl@0
   990
sl@0
   991
IMPORT_C int 		X509_set_version(X509 *x,long version);
sl@0
   992
IMPORT_C int 		X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
sl@0
   993
IMPORT_C ASN1_INTEGER *	X509_get_serialNumber(X509 *x);
sl@0
   994
IMPORT_C int 		X509_set_issuer_name(X509 *x, X509_NAME *name);
sl@0
   995
IMPORT_C X509_NAME *	X509_get_issuer_name(X509 *a);
sl@0
   996
IMPORT_C int 		X509_set_subject_name(X509 *x, X509_NAME *name);
sl@0
   997
IMPORT_C X509_NAME *	X509_get_subject_name(X509 *a);
sl@0
   998
IMPORT_C int 		X509_set_notBefore(X509 *x, ASN1_TIME *tm);
sl@0
   999
IMPORT_C int 		X509_set_notAfter(X509 *x, ASN1_TIME *tm);
sl@0
  1000
IMPORT_C int 		X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
sl@0
  1001
IMPORT_C EVP_PKEY *	X509_get_pubkey(X509 *x);
sl@0
  1002
IMPORT_C ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x);
sl@0
  1003
IMPORT_C int		X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */);
sl@0
  1004
sl@0
  1005
IMPORT_C int		X509_REQ_set_version(X509_REQ *x,long version);
sl@0
  1006
IMPORT_C int		X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name);
sl@0
  1007
IMPORT_C int		X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
sl@0
  1008
IMPORT_C EVP_PKEY *	X509_REQ_get_pubkey(X509_REQ *req);
sl@0
  1009
IMPORT_C int		X509_REQ_extension_nid(int nid);
sl@0
  1010
IMPORT_C int *		X509_REQ_get_extension_nids(void);
sl@0
  1011
IMPORT_C void		X509_REQ_set_extension_nids(int *nids);
sl@0
  1012
IMPORT_C STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);
sl@0
  1013
IMPORT_C int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
sl@0
  1014
				int nid);
sl@0
  1015
IMPORT_C int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts);
sl@0
  1016
IMPORT_C int X509_REQ_get_attr_count(const X509_REQ *req);
sl@0
  1017
IMPORT_C int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid,
sl@0
  1018
			  int lastpos);
sl@0
  1019
IMPORT_C int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj,
sl@0
  1020
			  int lastpos);
sl@0
  1021
IMPORT_C X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc);
sl@0
  1022
IMPORT_C X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc);
sl@0
  1023
IMPORT_C int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);
sl@0
  1024
IMPORT_C int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
sl@0
  1025
			const ASN1_OBJECT *obj, int type,
sl@0
  1026
			const unsigned char *bytes, int len);
sl@0
  1027
IMPORT_C int X509_REQ_add1_attr_by_NID(X509_REQ *req,
sl@0
  1028
			int nid, int type,
sl@0
  1029
			const unsigned char *bytes, int len);
sl@0
  1030
IMPORT_C int X509_REQ_add1_attr_by_txt(X509_REQ *req,
sl@0
  1031
			const char *attrname, int type,
sl@0
  1032
			const unsigned char *bytes, int len);
sl@0
  1033
sl@0
  1034
IMPORT_C int X509_CRL_set_version(X509_CRL *x, long version);
sl@0
  1035
IMPORT_C int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
sl@0
  1036
IMPORT_C int X509_CRL_set_lastUpdate(X509_CRL *x, ASN1_TIME *tm);
sl@0
  1037
IMPORT_C int X509_CRL_set_nextUpdate(X509_CRL *x, ASN1_TIME *tm);
sl@0
  1038
IMPORT_C int X509_CRL_sort(X509_CRL *crl);
sl@0
  1039
sl@0
  1040
IMPORT_C int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial);
sl@0
  1041
IMPORT_C int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm);
sl@0
  1042
sl@0
  1043
IMPORT_C int		X509_REQ_check_private_key(X509_REQ *x509,EVP_PKEY *pkey);
sl@0
  1044
sl@0
  1045
IMPORT_C int		X509_check_private_key(X509 *x509,EVP_PKEY *pkey);
sl@0
  1046
sl@0
  1047
IMPORT_C int		X509_issuer_and_serial_cmp(const X509 *a, const X509 *b);
sl@0
  1048
IMPORT_C unsigned long	X509_issuer_and_serial_hash(X509 *a);
sl@0
  1049
sl@0
  1050
IMPORT_C int		X509_issuer_name_cmp(const X509 *a, const X509 *b);
sl@0
  1051
IMPORT_C unsigned long	X509_issuer_name_hash(X509 *a);
sl@0
  1052
sl@0
  1053
IMPORT_C int		X509_subject_name_cmp(const X509 *a, const X509 *b);
sl@0
  1054
IMPORT_C unsigned long	X509_subject_name_hash(X509 *x);
sl@0
  1055
sl@0
  1056
IMPORT_C int		X509_cmp(const X509 *a, const X509 *b);
sl@0
  1057
IMPORT_C int		X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
sl@0
  1058
IMPORT_C unsigned long	X509_NAME_hash(X509_NAME *x);
sl@0
  1059
sl@0
  1060
IMPORT_C int		X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
sl@0
  1061
#ifndef OPENSSL_NO_FP_API
sl@0
  1062
IMPORT_C int		X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
sl@0
  1063
IMPORT_C int		X509_print_fp(FILE *bp,X509 *x);
sl@0
  1064
IMPORT_C int		X509_CRL_print_fp(FILE *bp,X509_CRL *x);
sl@0
  1065
IMPORT_C int		X509_REQ_print_fp(FILE *bp,X509_REQ *req);
sl@0
  1066
IMPORT_C int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags);
sl@0
  1067
#endif
sl@0
  1068
sl@0
  1069
#ifndef OPENSSL_NO_BIO
sl@0
  1070
IMPORT_C int		X509_NAME_print(BIO *bp, X509_NAME *name, int obase);
sl@0
  1071
IMPORT_C int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags);
sl@0
  1072
IMPORT_C int		X509_print_ex(BIO *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
sl@0
  1073
IMPORT_C int		X509_print(BIO *bp,X509 *x);
sl@0
  1074
IMPORT_C int		X509_ocspid_print(BIO *bp,X509 *x);
sl@0
  1075
IMPORT_C int		X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent);
sl@0
  1076
IMPORT_C int		X509_CRL_print(BIO *bp,X509_CRL *x);
sl@0
  1077
IMPORT_C int		X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long cflag);
sl@0
  1078
IMPORT_C int		X509_REQ_print(BIO *bp,X509_REQ *req);
sl@0
  1079
#endif
sl@0
  1080
sl@0
  1081
IMPORT_C int 		X509_NAME_entry_count(X509_NAME *name);
sl@0
  1082
IMPORT_C int 		X509_NAME_get_text_by_NID(X509_NAME *name, int nid,
sl@0
  1083
			char *buf,int len);
sl@0
  1084
IMPORT_C int		X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj,
sl@0
  1085
			char *buf,int len);
sl@0
  1086
sl@0
  1087
/* NOTE: you should be passsing -1, not 0 as lastpos.  The functions that use
sl@0
  1088
 * lastpos, search after that position on. */
sl@0
  1089
IMPORT_C int 		X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos);
sl@0
  1090
IMPORT_C int 		X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj,
sl@0
  1091
			int lastpos);
sl@0
  1092
IMPORT_C X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc);
sl@0
  1093
IMPORT_C X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc);
sl@0
  1094
IMPORT_C int 		X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne,
sl@0
  1095
			int loc, int set);
sl@0
  1096
IMPORT_C int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type,
sl@0
  1097
			unsigned char *bytes, int len, int loc, int set);
sl@0
  1098
IMPORT_C int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
sl@0
  1099
			unsigned char *bytes, int len, int loc, int set);
sl@0
  1100
IMPORT_C X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
sl@0
  1101
		const char *field, int type, const unsigned char *bytes, int len);
sl@0
  1102
IMPORT_C X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
sl@0
  1103
			int type,unsigned char *bytes, int len);
sl@0
  1104
IMPORT_C int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type,
sl@0
  1105
			const unsigned char *bytes, int len, int loc, int set);
sl@0
  1106
IMPORT_C X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
sl@0
  1107
			ASN1_OBJECT *obj, int type,const unsigned char *bytes,
sl@0
  1108
			int len);
sl@0
  1109
IMPORT_C int 		X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne,
sl@0
  1110
			ASN1_OBJECT *obj);
sl@0
  1111
IMPORT_C int 		X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
sl@0
  1112
			const unsigned char *bytes, int len);
sl@0
  1113
IMPORT_C ASN1_OBJECT *	X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne);
sl@0
  1114
IMPORT_C ASN1_STRING *	X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne);
sl@0
  1115
sl@0
  1116
IMPORT_C int		X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x);
sl@0
  1117
IMPORT_C int		X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x,
sl@0
  1118
				      int nid, int lastpos);
sl@0
  1119
IMPORT_C int		X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x,
sl@0
  1120
				      ASN1_OBJECT *obj,int lastpos);
sl@0
  1121
IMPORT_C int		X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x,
sl@0
  1122
					   int crit, int lastpos);
sl@0
  1123
IMPORT_C X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc);
sl@0
  1124
IMPORT_C X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);
sl@0
  1125
IMPORT_C STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
sl@0
  1126
					 X509_EXTENSION *ex, int loc);
sl@0
  1127
sl@0
  1128
IMPORT_C int		X509_get_ext_count(X509 *x);
sl@0
  1129
IMPORT_C int		X509_get_ext_by_NID(X509 *x, int nid, int lastpos);
sl@0
  1130
IMPORT_C int		X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,int lastpos);
sl@0
  1131
IMPORT_C int		X509_get_ext_by_critical(X509 *x, int crit, int lastpos);
sl@0
  1132
IMPORT_C X509_EXTENSION *X509_get_ext(X509 *x, int loc);
sl@0
  1133
IMPORT_C X509_EXTENSION *X509_delete_ext(X509 *x, int loc);
sl@0
  1134
IMPORT_C int		X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
sl@0
  1135
IMPORT_C void	*	X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx);
sl@0
  1136
IMPORT_C int		X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
sl@0
  1137
							unsigned long flags);
sl@0
  1138
sl@0
  1139
IMPORT_C int		X509_CRL_get_ext_count(X509_CRL *x);
sl@0
  1140
IMPORT_C int		X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos);
sl@0
  1141
IMPORT_C int		X509_CRL_get_ext_by_OBJ(X509_CRL *x,ASN1_OBJECT *obj,int lastpos);
sl@0
  1142
IMPORT_C int		X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos);
sl@0
  1143
IMPORT_C X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc);
sl@0
  1144
IMPORT_C X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);
sl@0
  1145
IMPORT_C int		X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
sl@0
  1146
IMPORT_C void	*	X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx);
sl@0
  1147
IMPORT_C int		X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
sl@0
  1148
							unsigned long flags);
sl@0
  1149
sl@0
  1150
IMPORT_C int		X509_REVOKED_get_ext_count(X509_REVOKED *x);
sl@0
  1151
IMPORT_C int		X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos);
sl@0
  1152
IMPORT_C int		X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x,ASN1_OBJECT *obj,int lastpos);
sl@0
  1153
IMPORT_C int		X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos);
sl@0
  1154
IMPORT_C X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc);
sl@0
  1155
IMPORT_C X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc);
sl@0
  1156
IMPORT_C int		X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc);
sl@0
  1157
IMPORT_C void	*	X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx);
sl@0
  1158
IMPORT_C int		X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
sl@0
  1159
							unsigned long flags);
sl@0
  1160
sl@0
  1161
IMPORT_C X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
sl@0
  1162
			int nid, int crit, ASN1_OCTET_STRING *data);
sl@0
  1163
IMPORT_C X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
sl@0
  1164
			ASN1_OBJECT *obj,int crit,ASN1_OCTET_STRING *data);
sl@0
  1165
IMPORT_C int		X509_EXTENSION_set_object(X509_EXTENSION *ex,ASN1_OBJECT *obj);
sl@0
  1166
IMPORT_C int		X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
sl@0
  1167
IMPORT_C int		X509_EXTENSION_set_data(X509_EXTENSION *ex,
sl@0
  1168
			ASN1_OCTET_STRING *data);
sl@0
  1169
IMPORT_C ASN1_OBJECT *	X509_EXTENSION_get_object(X509_EXTENSION *ex);
sl@0
  1170
IMPORT_C ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
sl@0
  1171
IMPORT_C int		X509_EXTENSION_get_critical(X509_EXTENSION *ex);
sl@0
  1172
sl@0
  1173
IMPORT_C int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x);
sl@0
  1174
IMPORT_C int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid,
sl@0
  1175
			  int lastpos);
sl@0
  1176
IMPORT_C int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, ASN1_OBJECT *obj,
sl@0
  1177
			  int lastpos);
sl@0
  1178
IMPORT_C X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc);
sl@0
  1179
IMPORT_C X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc);
sl@0
  1180
IMPORT_C STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
sl@0
  1181
					 X509_ATTRIBUTE *attr);
sl@0
  1182
IMPORT_C STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x,
sl@0
  1183
			const ASN1_OBJECT *obj, int type,
sl@0
  1184
			const unsigned char *bytes, int len);
sl@0
  1185
IMPORT_C STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x,
sl@0
  1186
			int nid, int type,
sl@0
  1187
			const unsigned char *bytes, int len);
sl@0
  1188
IMPORT_C STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x,
sl@0
  1189
			const char *attrname, int type,
sl@0
  1190
			const unsigned char *bytes, int len);
sl@0
  1191
IMPORT_C X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
sl@0
  1192
	     int atrtype, const void *data, int len);
sl@0
  1193
IMPORT_C X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
sl@0
  1194
	     const ASN1_OBJECT *obj, int atrtype, const void *data, int len);
sl@0
  1195
IMPORT_C X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
sl@0
  1196
		const char *atrname, int type, const unsigned char *bytes, int len);
sl@0
  1197
IMPORT_C int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj);
sl@0
  1198
IMPORT_C int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len);
sl@0
  1199
IMPORT_C void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx,
sl@0
  1200
					int atrtype, void *data);
sl@0
  1201
IMPORT_C int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr);
sl@0
  1202
IMPORT_C ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr);
sl@0
  1203
IMPORT_C ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx);
sl@0
  1204
sl@0
  1205
IMPORT_C int EVP_PKEY_get_attr_count(const EVP_PKEY *key);
sl@0
  1206
IMPORT_C int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid,
sl@0
  1207
			  int lastpos);
sl@0
  1208
IMPORT_C int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj,
sl@0
  1209
			  int lastpos);
sl@0
  1210
IMPORT_C X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc);
sl@0
  1211
IMPORT_C X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc);
sl@0
  1212
IMPORT_C int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr);
sl@0
  1213
IMPORT_C int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key,
sl@0
  1214
			const ASN1_OBJECT *obj, int type,
sl@0
  1215
			const unsigned char *bytes, int len);
sl@0
  1216
IMPORT_C int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key,
sl@0
  1217
			int nid, int type,
sl@0
  1218
			const unsigned char *bytes, int len);
sl@0
  1219
IMPORT_C int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key,
sl@0
  1220
			const char *attrname, int type,
sl@0
  1221
			const unsigned char *bytes, int len);
sl@0
  1222
sl@0
  1223
IMPORT_C int		X509_verify_cert(X509_STORE_CTX *ctx);
sl@0
  1224
sl@0
  1225
/* lookup a cert from a X509 STACK */
sl@0
  1226
IMPORT_C X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name,
sl@0
  1227
				     ASN1_INTEGER *serial);
sl@0
  1228
IMPORT_C X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name);
sl@0
  1229
sl@0
  1230
DECLARE_ASN1_FUNCTIONS(PBEPARAM)
sl@0
  1231
DECLARE_ASN1_FUNCTIONS(PBE2PARAM)
sl@0
  1232
DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM)
sl@0
  1233
sl@0
  1234
IMPORT_C X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, int saltlen);
sl@0
  1235
IMPORT_C X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
sl@0
  1236
					 unsigned char *salt, int saltlen);
sl@0
  1237
sl@0
  1238
/* PKCS#8 utilities */
sl@0
  1239
sl@0
  1240
DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO)
sl@0
  1241
sl@0
  1242
IMPORT_C EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8);
sl@0
  1243
IMPORT_C PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey);
sl@0
  1244
IMPORT_C PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken);
sl@0
  1245
IMPORT_C PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken);
sl@0
  1246
sl@0
  1247
IMPORT_C int X509_check_trust(X509 *x, int id, int flags);
sl@0
  1248
IMPORT_C int X509_TRUST_get_count(void);
sl@0
  1249
IMPORT_C X509_TRUST * X509_TRUST_get0(int idx);
sl@0
  1250
IMPORT_C int X509_TRUST_get_by_id(int id);
sl@0
  1251
IMPORT_C int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),
sl@0
  1252
					char *name, int arg1, void *arg2);
sl@0
  1253
IMPORT_C void X509_TRUST_cleanup(void);
sl@0
  1254
IMPORT_C int X509_TRUST_get_flags(X509_TRUST *xp);
sl@0
  1255
IMPORT_C char *X509_TRUST_get0_name(X509_TRUST *xp);
sl@0
  1256
IMPORT_C int X509_TRUST_get_trust(X509_TRUST *xp);
sl@0
  1257
sl@0
  1258
/* BEGIN ERROR CODES */
sl@0
  1259
/* The following lines are auto generated by the script mkerr.pl. Any changes
sl@0
  1260
 * made after this point may be overwritten when the script is next run.
sl@0
  1261
 */
sl@0
  1262
IMPORT_C void ERR_load_X509_strings(void);
sl@0
  1263
sl@0
  1264
/* Error codes for the X509 functions. */
sl@0
  1265
sl@0
  1266
/* Function codes. */
sl@0
  1267
#define X509_F_ADD_CERT_DIR				 100
sl@0
  1268
#define X509_F_BY_FILE_CTRL				 101
sl@0
  1269
#define X509_F_CHECK_POLICY				 145
sl@0
  1270
#define X509_F_DIR_CTRL					 102
sl@0
  1271
#define X509_F_GET_CERT_BY_SUBJECT			 103
sl@0
  1272
#define X509_F_NETSCAPE_SPKI_B64_DECODE			 129
sl@0
  1273
#define X509_F_NETSCAPE_SPKI_B64_ENCODE			 130
sl@0
  1274
#define X509_F_X509AT_ADD1_ATTR				 135
sl@0
  1275
#define X509_F_X509V3_ADD_EXT				 104
sl@0
  1276
#define X509_F_X509_ATTRIBUTE_CREATE_BY_NID		 136
sl@0
  1277
#define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ		 137
sl@0
  1278
#define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT		 140
sl@0
  1279
#define X509_F_X509_ATTRIBUTE_GET0_DATA			 139
sl@0
  1280
#define X509_F_X509_ATTRIBUTE_SET1_DATA			 138
sl@0
  1281
#define X509_F_X509_CHECK_PRIVATE_KEY			 128
sl@0
  1282
#define X509_F_X509_CRL_PRINT_FP			 147
sl@0
  1283
#define X509_F_X509_EXTENSION_CREATE_BY_NID		 108
sl@0
  1284
#define X509_F_X509_EXTENSION_CREATE_BY_OBJ		 109
sl@0
  1285
#define X509_F_X509_GET_PUBKEY_PARAMETERS		 110
sl@0
  1286
#define X509_F_X509_LOAD_CERT_CRL_FILE			 132
sl@0
  1287
#define X509_F_X509_LOAD_CERT_FILE			 111
sl@0
  1288
#define X509_F_X509_LOAD_CRL_FILE			 112
sl@0
  1289
#define X509_F_X509_NAME_ADD_ENTRY			 113
sl@0
  1290
#define X509_F_X509_NAME_ENTRY_CREATE_BY_NID		 114
sl@0
  1291
#define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT		 131
sl@0
  1292
#define X509_F_X509_NAME_ENTRY_SET_OBJECT		 115
sl@0
  1293
#define X509_F_X509_NAME_ONELINE			 116
sl@0
  1294
#define X509_F_X509_NAME_PRINT				 117
sl@0
  1295
#define X509_F_X509_PRINT_EX_FP				 118
sl@0
  1296
#define X509_F_X509_PUBKEY_GET				 119
sl@0
  1297
#define X509_F_X509_PUBKEY_SET				 120
sl@0
  1298
#define X509_F_X509_REQ_CHECK_PRIVATE_KEY		 144
sl@0
  1299
#define X509_F_X509_REQ_PRINT_EX			 121
sl@0
  1300
#define X509_F_X509_REQ_PRINT_FP			 122
sl@0
  1301
#define X509_F_X509_REQ_TO_X509				 123
sl@0
  1302
#define X509_F_X509_STORE_ADD_CERT			 124
sl@0
  1303
#define X509_F_X509_STORE_ADD_CRL			 125
sl@0
  1304
#define X509_F_X509_STORE_CTX_GET1_ISSUER		 146
sl@0
  1305
#define X509_F_X509_STORE_CTX_INIT			 143
sl@0
  1306
#define X509_F_X509_STORE_CTX_NEW			 142
sl@0
  1307
#define X509_F_X509_STORE_CTX_PURPOSE_INHERIT		 134
sl@0
  1308
#define X509_F_X509_TO_X509_REQ				 126
sl@0
  1309
#define X509_F_X509_TRUST_ADD				 133
sl@0
  1310
#define X509_F_X509_TRUST_SET				 141
sl@0
  1311
#define X509_F_X509_VERIFY_CERT				 127
sl@0
  1312
sl@0
  1313
/* Reason codes. */
sl@0
  1314
#define X509_R_BAD_X509_FILETYPE			 100
sl@0
  1315
#define X509_R_BASE64_DECODE_ERROR			 118
sl@0
  1316
#define X509_R_CANT_CHECK_DH_KEY			 114
sl@0
  1317
#define X509_R_CERT_ALREADY_IN_HASH_TABLE		 101
sl@0
  1318
#define X509_R_ERR_ASN1_LIB				 102
sl@0
  1319
#define X509_R_INVALID_DIRECTORY			 113
sl@0
  1320
#define X509_R_INVALID_FIELD_NAME			 119
sl@0
  1321
#define X509_R_INVALID_TRUST				 123
sl@0
  1322
#define X509_R_KEY_TYPE_MISMATCH			 115
sl@0
  1323
#define X509_R_KEY_VALUES_MISMATCH			 116
sl@0
  1324
#define X509_R_LOADING_CERT_DIR				 103
sl@0
  1325
#define X509_R_LOADING_DEFAULTS				 104
sl@0
  1326
#define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY		 105
sl@0
  1327
#define X509_R_SHOULD_RETRY				 106
sl@0
  1328
#define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN	 107
sl@0
  1329
#define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY		 108
sl@0
  1330
#define X509_R_UNKNOWN_KEY_TYPE				 117
sl@0
  1331
#define X509_R_UNKNOWN_NID				 109
sl@0
  1332
#define X509_R_UNKNOWN_PURPOSE_ID			 121
sl@0
  1333
#define X509_R_UNKNOWN_TRUST_ID				 120
sl@0
  1334
#define X509_R_UNSUPPORTED_ALGORITHM			 111
sl@0
  1335
#define X509_R_WRONG_LOOKUP_TYPE			 112
sl@0
  1336
#define X509_R_WRONG_TYPE				 122
sl@0
  1337
sl@0
  1338
#ifdef  __cplusplus
sl@0
  1339
}
sl@0
  1340
#endif
sl@0
  1341
#endif