1656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* crypto/x509/x509.h */
2656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * All rights reserved.
4656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *
5656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * This package is an SSL implementation written
6656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * by Eric Young (eay@cryptsoft.com).
7656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * The implementation was written so as to conform with Netscapes SSL.
8656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *
9656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * This library is free for commercial and non-commercial use as long as
10656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * the following conditions are aheared to.  The following conditions
11656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * apply to all code found in this distribution, be it the RC4, RSA,
12656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
13656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * included with this distribution is covered by the same copyright terms
14656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *
16656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * Copyright remains Eric Young's, and as such any Copyright notices in
17656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * the code are not to be removed.
18656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * If this package is used in a product, Eric Young should be given attribution
19656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * as the author of the parts of the library used.
20656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * This can be in the form of a textual message at program startup or
21656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * in documentation (online or textual) provided with the package.
22656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *
23656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * Redistribution and use in source and binary forms, with or without
24656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * modification, are permitted provided that the following conditions
25656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * are met:
26656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * 1. Redistributions of source code must retain the copyright
27656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *    notice, this list of conditions and the following disclaimer.
28656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * 2. Redistributions in binary form must reproduce the above copyright
29656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *    notice, this list of conditions and the following disclaimer in the
30656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *    documentation and/or other materials provided with the distribution.
31656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * 3. All advertising materials mentioning features or use of this software
32656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *    must display the following acknowledgement:
33656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *    "This product includes cryptographic software written by
34656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *     Eric Young (eay@cryptsoft.com)"
35656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *    The word 'cryptographic' can be left out if the rouines from the library
36656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *    being used are not cryptographic related :-).
37656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * 4. If you include any Windows specific code (or a derivative thereof) from
38656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *    the apps directory (application code) you must include an acknowledgement:
39656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *
41656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * SUCH DAMAGE.
52656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project *
53656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * The licence and distribution terms for any publically available version or
54656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * derivative of this code cannot be changed.  i.e. this code cannot simply be
55656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * copied and put under another distribution licence
56656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * [including the GNU Public Licence.]
57656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project */
58656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* ====================================================================
59656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
60656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * ECDH support in OpenSSL originally developed by
61656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
62656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project */
63656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
64656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef HEADER_X509_H
65656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define HEADER_X509_H
66656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
67656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/e_os2.h>
68656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/symhacks.h>
69656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_BUFFER
70656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/buffer.h>
71656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
72656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_EVP
73656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/evp.h>
74656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
75656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_BIO
76656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/bio.h>
77656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
78656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/stack.h>
79656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/asn1.h>
80656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/safestack.h>
81656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
82656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_EC
83656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/ec.h>
84656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
85656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
86656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_ECDSA
87656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/ecdsa.h>
88656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
89656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
90656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_ECDH
91656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/ecdh.h>
92656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
93656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
94656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_DEPRECATED
95656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_RSA
96656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/rsa.h>
97656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
98656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_DSA
99656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/dsa.h>
100656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
101656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_DH
102656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/dh.h>
103656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
104656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
105656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
106656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_SHA
107656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/sha.h>
108656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
109656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/ossl_typ.h>
110656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
111656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifdef  __cplusplus
112656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectextern "C" {
113656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
114656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
115656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifdef OPENSSL_SYS_WIN32
116656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* Under Win32 these are defined in wincrypt.h */
117656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#undef X509_NAME
118656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#undef X509_CERT_PAIR
11998d58bb80c64b02a33662f0ea80351d4a1535267Brian Carlstrom#undef X509_EXTENSIONS
120656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
121656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
122656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_FILETYPE_PEM	1
123656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_FILETYPE_ASN1	2
124656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_FILETYPE_DEFAULT	3
125656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
126656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509v3_KU_DIGITAL_SIGNATURE	0x0080
127656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509v3_KU_NON_REPUDIATION	0x0040
128656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509v3_KU_KEY_ENCIPHERMENT	0x0020
129656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509v3_KU_DATA_ENCIPHERMENT	0x0010
130656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509v3_KU_KEY_AGREEMENT		0x0008
131656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509v3_KU_KEY_CERT_SIGN		0x0004
132656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509v3_KU_CRL_SIGN		0x0002
133656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509v3_KU_ENCIPHER_ONLY		0x0001
134656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509v3_KU_DECIPHER_ONLY		0x8000
135656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509v3_KU_UNDEF			0xffff
136656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
137656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct X509_objects_st
138656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
139656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int nid;
140656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int (*a2i)(void);
141656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int (*i2a)(void);
142656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} X509_OBJECTS;
143656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
144656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectstruct X509_algor_st
145656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
146656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_OBJECT *algorithm;
147656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_TYPE *parameter;
148656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} /* X509_ALGOR */;
149656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
150656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_SET_OF(X509_ALGOR)
151656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
152656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef STACK_OF(X509_ALGOR) X509_ALGORS;
153656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
154656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct X509_val_st
155656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
156656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_TIME *notBefore;
157656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_TIME *notAfter;
158656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} X509_VAL;
159656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
160221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromstruct X509_pubkey_st
161656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
162656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_ALGOR *algor;
163656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_BIT_STRING *public_key;
164656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	EVP_PKEY *pkey;
165221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	};
166656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
167656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct X509_sig_st
168656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
169656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_ALGOR *algor;
170656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_OCTET_STRING *digest;
171656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} X509_SIG;
172656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
173656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct X509_name_entry_st
174656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
175656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_OBJECT *object;
176656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_STRING *value;
177656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int set;
178656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int size; 	/* temp variable */
179656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} X509_NAME_ENTRY;
180656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
181656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_STACK_OF(X509_NAME_ENTRY)
182656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_SET_OF(X509_NAME_ENTRY)
183656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
184656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* we always keep X509_NAMEs in 2 forms. */
185656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectstruct X509_name_st
186656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
187656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	STACK_OF(X509_NAME_ENTRY) *entries;
188656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int modified;	/* true if 'bytes' needs to be built */
189656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_BUFFER
190656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	BUF_MEM *bytes;
191656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#else
192656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	char *bytes;
193656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
194221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom/*	unsigned long hash; Keep the hash around for lookups */
195221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	unsigned char *canon_enc;
196221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	int canon_enclen;
197656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} /* X509_NAME */;
198656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
199656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_STACK_OF(X509_NAME)
200656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
201656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_EX_V_NETSCAPE_HACK		0x8000
202656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_EX_V_INIT			0x0001
203656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct X509_extension_st
204656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
205656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_OBJECT *object;
206656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_BOOLEAN critical;
207656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_OCTET_STRING *value;
208656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} X509_EXTENSION;
209656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
210656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
211656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
212656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_STACK_OF(X509_EXTENSION)
213656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_SET_OF(X509_EXTENSION)
214656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
215656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* a sequence of these are used */
216656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct x509_attributes_st
217656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
218656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_OBJECT *object;
219656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int single; /* 0 for a set, 1 for a single item (which is wrong) */
220656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	union	{
221656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project		char		*ptr;
222656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* 0 */		STACK_OF(ASN1_TYPE) *set;
223656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* 1 */		ASN1_TYPE	*single;
224656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project		} value;
225656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} X509_ATTRIBUTE;
226656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
227656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_STACK_OF(X509_ATTRIBUTE)
228656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_SET_OF(X509_ATTRIBUTE)
229656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
230656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
231656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct X509_req_info_st
232656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
233656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_ENCODING enc;
234656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_INTEGER *version;
235656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_NAME *subject;
236656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_PUBKEY *pubkey;
237656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	/*  d=2 hl=2 l=  0 cons: cont: 00 */
238656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
239656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} X509_REQ_INFO;
240656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
241656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct X509_req_st
242656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
243656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_REQ_INFO *req_info;
244656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_ALGOR *sig_alg;
245656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_BIT_STRING *signature;
246656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int references;
247656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} X509_REQ;
248656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
249656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct x509_cinf_st
250656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
251656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_INTEGER *version;		/* [ 0 ] default of v1 */
252656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_INTEGER *serialNumber;
253656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_ALGOR *signature;
254656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_NAME *issuer;
255656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_VAL *validity;
256656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_NAME *subject;
257656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_PUBKEY *key;
258656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_BIT_STRING *issuerUID;		/* [ 1 ] optional in v2 */
259656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_BIT_STRING *subjectUID;		/* [ 2 ] optional in v2 */
260656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	STACK_OF(X509_EXTENSION) *extensions;	/* [ 3 ] optional in v3 */
26143c12e3d4f9bbbbd4a8ba7b149686437514bc6b6Brian Carlstrom	ASN1_ENCODING enc;
262656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} X509_CINF;
263656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
264656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* This stuff is certificate "auxiliary info"
265656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * it contains details which are useful in certificate
266656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * stores and databases. When used this is tagged onto
267656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * the end of the certificate itself
268656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project */
269656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
270656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct x509_cert_aux_st
271656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
272656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	STACK_OF(ASN1_OBJECT) *trust;		/* trusted uses */
273656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	STACK_OF(ASN1_OBJECT) *reject;		/* rejected uses */
274656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_UTF8STRING *alias;			/* "friendly name" */
275656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_OCTET_STRING *keyid;		/* key id of private key */
276656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	STACK_OF(X509_ALGOR) *other;		/* other unspecified info */
277656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} X509_CERT_AUX;
278656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
279656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectstruct x509_st
280656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
281656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_CINF *cert_info;
282656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_ALGOR *sig_alg;
283656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_BIT_STRING *signature;
284656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int valid;
285656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int references;
286656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	char *name;
287656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	CRYPTO_EX_DATA ex_data;
288656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	/* These contain copies of various extension values */
289656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	long ex_pathlen;
290656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	long ex_pcpathlen;
291656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	unsigned long ex_flags;
292656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	unsigned long ex_kusage;
293656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	unsigned long ex_xkusage;
294656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	unsigned long ex_nscert;
295656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_OCTET_STRING *skid;
296221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	AUTHORITY_KEYID *akid;
297656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_POLICY_CACHE *policy_cache;
298221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	STACK_OF(DIST_POINT) *crldp;
299221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	STACK_OF(GENERAL_NAME) *altname;
300221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	NAME_CONSTRAINTS *nc;
301656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_RFC3779
302656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	STACK_OF(IPAddressFamily) *rfc3779_addr;
303656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	struct ASIdentifiers_st *rfc3779_asid;
304656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
305656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_SHA
306656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	unsigned char sha1_hash[SHA_DIGEST_LENGTH];
307656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
308656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_CERT_AUX *aux;
309656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} /* X509 */;
310656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
311656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_STACK_OF(X509)
312656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_SET_OF(X509)
313656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
314656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* This is used for a table of trust checking functions */
315656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
316656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct x509_trust_st {
317656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int trust;
318656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int flags;
319656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int (*check_trust)(struct x509_trust_st *, X509 *, int);
320656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	char *name;
321656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int arg1;
322656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	void *arg2;
323656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project} X509_TRUST;
324656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
325656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_STACK_OF(X509_TRUST)
326656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
327656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct x509_cert_pair_st {
328656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509 *forward;
329656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509 *reverse;
330656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project} X509_CERT_PAIR;
331656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
332656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* standard trust ids */
333656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
334656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_TRUST_DEFAULT	-1	/* Only valid in purpose settings */
335656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
336656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_TRUST_COMPAT	1
337656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_TRUST_SSL_CLIENT	2
338656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_TRUST_SSL_SERVER	3
339656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_TRUST_EMAIL	4
340656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_TRUST_OBJECT_SIGN	5
341656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_TRUST_OCSP_SIGN	6
342656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_TRUST_OCSP_REQUEST	7
343221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom#define X509_TRUST_TSA		8
344656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
345656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* Keep these up to date! */
346656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_TRUST_MIN		1
347221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom#define X509_TRUST_MAX		8
348656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
349656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
350656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* trust_flags values */
351656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_TRUST_DYNAMIC 	1
352656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_TRUST_DYNAMIC_NAME	2
353656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
354656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* check_trust return codes */
355656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
356656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_TRUST_TRUSTED	1
357656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_TRUST_REJECTED	2
358656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_TRUST_UNTRUSTED	3
359656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
360656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* Flags for X509_print_ex() */
361656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
362656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_FLAG_COMPAT		0
363656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_FLAG_NO_HEADER		1L
364656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_FLAG_NO_VERSION		(1L << 1)
365656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_FLAG_NO_SERIAL		(1L << 2)
366656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_FLAG_NO_SIGNAME		(1L << 3)
367656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_FLAG_NO_ISSUER		(1L << 4)
368656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_FLAG_NO_VALIDITY		(1L << 5)
369656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_FLAG_NO_SUBJECT		(1L << 6)
370656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_FLAG_NO_PUBKEY		(1L << 7)
371656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_FLAG_NO_EXTENSIONS		(1L << 8)
372656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_FLAG_NO_SIGDUMP		(1L << 9)
373656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_FLAG_NO_AUX		(1L << 10)
374656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define	X509_FLAG_NO_ATTRIBUTES		(1L << 11)
375656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
376656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* Flags specific to X509_NAME_print_ex() */
377656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
378656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* The field separator information */
379656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
380656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_SEP_MASK	(0xf << 16)
381656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
382656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_COMPAT		0		/* Traditional SSLeay: use old X509_NAME_print */
383656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_SEP_COMMA_PLUS	(1 << 16)	/* RFC2253 ,+ */
384656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_SEP_CPLUS_SPC	(2 << 16)	/* ,+ spaced: more readable */
385656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_SEP_SPLUS_SPC	(3 << 16)	/* ;+ spaced */
386656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_SEP_MULTILINE	(4 << 16)	/* One line per field */
387656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
388656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_DN_REV		(1 << 20)	/* Reverse DN order */
389656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
390656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* How the field name is shown */
391656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
392656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_FN_MASK		(0x3 << 21)
393656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
394656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_FN_SN		0		/* Object short name */
395656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_FN_LN		(1 << 21)	/* Object long name */
396656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_FN_OID		(2 << 21)	/* Always use OIDs */
397656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_FN_NONE		(3 << 21)	/* No field names */
398656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
399656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_SPC_EQ		(1 << 23)	/* Put spaces round '=' */
400656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
401656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* This determines if we dump fields we don't recognise:
402656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * RFC2253 requires this.
403656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project */
404656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
405656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
406656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
407656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_FN_ALIGN	(1 << 25)	/* Align field names to 20 characters */
408656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
409656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* Complete set of RFC2253 flags */
410656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
411656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \
412656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			XN_FLAG_SEP_COMMA_PLUS | \
413656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			XN_FLAG_DN_REV | \
414656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			XN_FLAG_FN_SN | \
415656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			XN_FLAG_DUMP_UNKNOWN_FIELDS)
416656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
417656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* readable oneline form */
418656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
419656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
420656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			ASN1_STRFLGS_ESC_QUOTE | \
421656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			XN_FLAG_SEP_CPLUS_SPC | \
422656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			XN_FLAG_SPC_EQ | \
423656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			XN_FLAG_FN_SN)
424656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
425656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* readable multiline form */
426656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
427656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \
428656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			ASN1_STRFLGS_ESC_MSB | \
429656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			XN_FLAG_SEP_MULTILINE | \
430656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			XN_FLAG_SPC_EQ | \
431656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			XN_FLAG_FN_LN | \
432656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			XN_FLAG_FN_ALIGN)
433656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
434221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromstruct x509_revoked_st
435656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
436656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_INTEGER *serialNumber;
437656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_TIME *revocationDate;
438656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	STACK_OF(X509_EXTENSION) /* optional */ *extensions;
439221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	/* Set up if indirect CRL */
440221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	STACK_OF(GENERAL_NAME) *issuer;
441221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	/* Revocation reason */
442221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	int reason;
443656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int sequence; /* load sequence */
444221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	};
445656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
446656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_STACK_OF(X509_REVOKED)
447656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_SET_OF(X509_REVOKED)
448656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
449656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct X509_crl_info_st
450656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
451656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_INTEGER *version;
452656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_ALGOR *sig_alg;
453656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_NAME *issuer;
454656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_TIME *lastUpdate;
455656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_TIME *nextUpdate;
456656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	STACK_OF(X509_REVOKED) *revoked;
457656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	STACK_OF(X509_EXTENSION) /* [0] */ *extensions;
458656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_ENCODING enc;
459656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} X509_CRL_INFO;
460656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
461656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectstruct X509_crl_st
462656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
463656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	/* actual signature */
464656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_CRL_INFO *crl;
465656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_ALGOR *sig_alg;
466656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_BIT_STRING *signature;
467656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int references;
468221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	int flags;
469221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	/* Copies of various extensions */
470221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	AUTHORITY_KEYID *akid;
471221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	ISSUING_DIST_POINT *idp;
472221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	/* Convenient breakdown of IDP */
473221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	int idp_flags;
474221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	int idp_reasons;
475221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	/* CRL and base CRL numbers for delta processing */
476221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	ASN1_INTEGER *crl_number;
477221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	ASN1_INTEGER *base_crl_number;
478221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom#ifndef OPENSSL_NO_SHA
479221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	unsigned char sha1_hash[SHA_DIGEST_LENGTH];
480221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom#endif
481221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	STACK_OF(GENERAL_NAMES) *issuers;
482221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	const X509_CRL_METHOD *meth;
483221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	void *meth_data;
484656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} /* X509_CRL */;
485656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
486656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_STACK_OF(X509_CRL)
487656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_SET_OF(X509_CRL)
488656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
489656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct private_key_st
490656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
491656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int version;
492656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	/* The PKCS#8 data types */
493656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_ALGOR *enc_algor;
494656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_OCTET_STRING *enc_pkey;	/* encrypted pub key */
495656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
496656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	/* When decrypted, the following will not be NULL */
497656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	EVP_PKEY *dec_pkey;
498656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
499656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	/* used to encrypt and decrypt */
500656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int key_length;
501656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	char *key_data;
502656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int key_free;	/* true if we should auto free key_data */
503656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
504656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	/* expanded version of 'enc_algor' */
505656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	EVP_CIPHER_INFO cipher;
506656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
507656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int references;
508656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} X509_PKEY;
509656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
510656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_EVP
511656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct X509_info_st
512656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
513656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509 *x509;
514656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_CRL *crl;
515656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_PKEY *x_pkey;
516656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
517656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	EVP_CIPHER_INFO enc_cipher;
518656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int enc_len;
519656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	char *enc_data;
520656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
521656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	int references;
522656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} X509_INFO;
523656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
524656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_STACK_OF(X509_INFO)
525656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
526656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
527656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* The next 2 structures and their 8 routines were sent to me by
528656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * Pat Richard <patr@x509.com> and are used to manipulate
529656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * Netscapes spki structures - useful if you are writing a CA web page
530656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project */
531656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct Netscape_spkac_st
532656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
533656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_PUBKEY *pubkey;
534656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_IA5STRING *challenge;	/* challenge sent in atlas >= PR2 */
535656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} NETSCAPE_SPKAC;
536656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
537656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct Netscape_spki_st
538656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
539656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	NETSCAPE_SPKAC *spkac;	/* signed public key and challenge */
540656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	X509_ALGOR *sig_algor;
541656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_BIT_STRING *signature;
542656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} NETSCAPE_SPKI;
543656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
544656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* Netscape certificate sequence structure */
545656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct Netscape_certificate_sequence
546656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
547656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_OBJECT *type;
548656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	STACK_OF(X509) *certs;
549656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} NETSCAPE_CERT_SEQUENCE;
550656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
551656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* Unused (and iv length is wrong)
552656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct CBCParameter_st
553656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	{
554656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	unsigned char iv[8];
555656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	} CBC_PARAM;
556656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project*/
557656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
558656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* Password based encryption structure */
559656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
560656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct PBEPARAM_st {
561656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_OCTET_STRING *salt;
562656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_INTEGER *iter;
563656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project} PBEPARAM;
564656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
565656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* Password based encryption V2 structures */
566656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
567656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct PBE2PARAM_st {
568656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ALGOR *keyfunc;
569656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ALGOR *encryption;
570656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project} PBE2PARAM;
571656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
572656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projecttypedef struct PBKDF2PARAM_st {
573656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_TYPE *salt;	/* Usually OCTET STRING but could be anything */
574656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_INTEGER *iter;
575656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_INTEGER *keylength;
576656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ALGOR *prf;
577656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project} PBKDF2PARAM;
578656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
579656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
580656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* PKCS#8 private key info structure */
581656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
582221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromstruct pkcs8_priv_key_info_st
583656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project        {
584656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project        int broken;     /* Flag for various broken formats */
585656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define PKCS8_OK		0
586656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define PKCS8_NO_OCTET		1
587656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define PKCS8_EMBEDDED_PARAM	2
588656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define PKCS8_NS_DB		3
589221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom#define PKCS8_NEG_PRIVKEY	4
590656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project        ASN1_INTEGER *version;
591656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project        X509_ALGOR *pkeyalg;
592656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project        ASN1_TYPE *pkey; /* Should be OCTET STRING but some are broken */
593656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project        STACK_OF(X509_ATTRIBUTE) *attributes;
594221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom        };
595656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
596656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifdef  __cplusplus
597656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project}
598656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
599656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
600656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/x509_vfy.h>
601656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#include <openssl/pkcs7.h>
602656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
603656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifdef  __cplusplus
604656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectextern "C" {
605656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
606656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
607656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_EXT_PACK_UNKNOWN	1
608656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_EXT_PACK_STRING	2
609656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
610656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define		X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version)
611656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* #define	X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */
612656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define		X509_get_notBefore(x) ((x)->cert_info->validity->notBefore)
613656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define		X509_get_notAfter(x) ((x)->cert_info->validity->notAfter)
614656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define		X509_extract_key(x)	X509_get_pubkey(x) /*****/
615656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define		X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version)
616656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define		X509_REQ_get_subject_name(x) ((x)->req_info->subject)
617656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define		X509_REQ_extract_key(a)	X509_REQ_get_pubkey(a)
618656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define		X509_name_cmp(a,b)	X509_NAME_cmp((a),(b))
619656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define		X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm))
620656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
621656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define		X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version)
622656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define 	X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate)
623656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define 	X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate)
624656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define		X509_CRL_get_issuer(x) ((x)->crl->issuer)
625656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define		X509_CRL_get_REVOKED(x) ((x)->crl->revoked)
626656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
627221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromvoid X509_CRL_set_default_method(const X509_CRL_METHOD *meth);
628221304ee937bc0910948a8be1320cb8cc4eb6d36Brian CarlstromX509_CRL_METHOD *X509_CRL_METHOD_new(
629221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	int (*crl_init)(X509_CRL *crl),
630221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	int (*crl_free)(X509_CRL *crl),
631221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	int (*crl_lookup)(X509_CRL *crl, X509_REVOKED **ret,
632221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom				ASN1_INTEGER *ser, X509_NAME *issuer),
633221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom	int (*crl_verify)(X509_CRL *crl, EVP_PKEY *pk));
634221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromvoid X509_CRL_METHOD_free(X509_CRL_METHOD *m);
635221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom
636221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromvoid X509_CRL_set_meth_data(X509_CRL *crl, void *dat);
637221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromvoid *X509_CRL_get_meth_data(X509_CRL *crl);
638221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom
639656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* This one is only used so that a binary form can output, as in
640656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) */
641656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define 	X509_get_X509_PUBKEY(x) ((x)->cert_info->key)
642656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
643656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
644656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectconst char *X509_verify_cert_error_string(long n);
645656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
646656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_EVP
647656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_verify(X509 *a, EVP_PKEY *r);
648656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
649656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
650656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_CRL_verify(X509_CRL *a, EVP_PKEY *r);
651656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r);
652656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
653656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectNETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len);
654656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectchar * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x);
655656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x);
656656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey);
657656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
658656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki);
659656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
660392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstromint X509_signature_dump(BIO *bp,const ASN1_STRING *sig, int indent);
661656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_signature_print(BIO *bp,X509_ALGOR *alg, ASN1_STRING *sig);
662656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
663656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
664392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstromint X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx);
665656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
666392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstromint X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx);
667656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
668392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstromint X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx);
669656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md);
670656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
671656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_pubkey_digest(const X509 *data,const EVP_MD *type,
672656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project		unsigned char *md, unsigned int *len);
673656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_digest(const X509 *data,const EVP_MD *type,
674656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project		unsigned char *md, unsigned int *len);
675656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_CRL_digest(const X509_CRL *data,const EVP_MD *type,
676656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project		unsigned char *md, unsigned int *len);
677656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REQ_digest(const X509_REQ *data,const EVP_MD *type,
678656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project		unsigned char *md, unsigned int *len);
679656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_NAME_digest(const X509_NAME *data,const EVP_MD *type,
680656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project		unsigned char *md, unsigned int *len);
681656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
682656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
683656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_FP_API
684656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509 *d2i_X509_fp(FILE *fp, X509 **x509);
685656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_X509_fp(FILE *fp,X509 *x509);
686656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl);
687656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl);
688656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req);
689656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_X509_REQ_fp(FILE *fp,X509_REQ *req);
690656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_RSA
691656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectRSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa);
692656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa);
693656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectRSA *d2i_RSAPublicKey_fp(FILE *fp,RSA **rsa);
694656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa);
695656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectRSA *d2i_RSA_PUBKEY_fp(FILE *fp,RSA **rsa);
696656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa);
697656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
698656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_DSA
699656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa);
700656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa);
701656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa);
702656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa);
703656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
704656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_EC
705656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey);
706656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint   i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey);
707656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey);
708656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint   i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey);
709656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
710656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_SIG *d2i_PKCS8_fp(FILE *fp,X509_SIG **p8);
711656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_PKCS8_fp(FILE *fp,X509_SIG *p8);
712656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectPKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
713656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project						PKCS8_PRIV_KEY_INFO **p8inf);
714656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,PKCS8_PRIV_KEY_INFO *p8inf);
715656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key);
716656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey);
717656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a);
718656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey);
719656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a);
720656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
721656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
722656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_BIO
723656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509 *d2i_X509_bio(BIO *bp,X509 **x509);
724656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_X509_bio(BIO *bp,X509 *x509);
725656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl);
726656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl);
727656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req);
728656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_X509_REQ_bio(BIO *bp,X509_REQ *req);
729656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_RSA
730656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectRSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa);
731656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa);
732656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectRSA *d2i_RSAPublicKey_bio(BIO *bp,RSA **rsa);
733656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa);
734656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectRSA *d2i_RSA_PUBKEY_bio(BIO *bp,RSA **rsa);
735656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_RSA_PUBKEY_bio(BIO *bp,RSA *rsa);
736656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
737656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_DSA
738656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa);
739656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa);
740656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa);
741656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa);
742656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
743656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_EC
744656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey);
745656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint   i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *eckey);
746656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey);
747656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint   i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey);
748656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
749656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_SIG *d2i_PKCS8_bio(BIO *bp,X509_SIG **p8);
750656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_PKCS8_bio(BIO *bp,X509_SIG *p8);
751656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectPKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
752656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project						PKCS8_PRIV_KEY_INFO **p8inf);
753656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,PKCS8_PRIV_KEY_INFO *p8inf);
754656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key);
755656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey);
756656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a);
757656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey);
758656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a);
759656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
760656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
761656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509 *X509_dup(X509 *x509);
762656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa);
763656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex);
764656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_CRL *X509_CRL_dup(X509_CRL *crl);
765656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_REQ *X509_REQ_dup(X509_REQ *req);
766656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn);
767656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval);
768656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,
769656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project						X509_ALGOR *algor);
770392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstromvoid X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);
771656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
772656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_NAME *X509_NAME_dup(X509_NAME *xn);
773656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne);
774656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
775221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint		X509_cmp_time(const ASN1_TIME *s, time_t *t);
776221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint		X509_cmp_current_time(const ASN1_TIME *s);
777656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_TIME *	X509_time_adj(ASN1_TIME *s, long adj, time_t *t);
778221304ee937bc0910948a8be1320cb8cc4eb6d36Brian CarlstromASN1_TIME *	X509_time_adj_ex(ASN1_TIME *s,
779221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom				int offset_day, long offset_sec, time_t *t);
780656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_TIME *	X509_gmtime_adj(ASN1_TIME *s, long adj);
781656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
782656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectconst char *	X509_get_default_cert_area(void );
783656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectconst char *	X509_get_default_cert_dir(void );
784656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectconst char *	X509_get_default_cert_file(void );
785656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectconst char *	X509_get_default_cert_dir_env(void );
786656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectconst char *	X509_get_default_cert_file_env(void );
787656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectconst char *	X509_get_default_private_dir(void );
788656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
789656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_REQ *	X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
790656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509 *		X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey);
791656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
792656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_ALGOR)
793656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS)
794656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_VAL)
795656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
796656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_PUBKEY)
797656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
798656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);
799656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEVP_PKEY *	X509_PUBKEY_get(X509_PUBKEY *key);
800656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_get_pubkey_parameters(EVP_PKEY *pkey,
801656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project					   STACK_OF(X509) *chain);
802656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp);
803656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEVP_PKEY *	d2i_PUBKEY(EVP_PKEY **a,const unsigned char **pp,
804656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			long length);
805656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_RSA
806656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		i2d_RSA_PUBKEY(RSA *a,unsigned char **pp);
807656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectRSA *		d2i_RSA_PUBKEY(RSA **a,const unsigned char **pp,
808656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			long length);
809656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
810656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_DSA
811656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		i2d_DSA_PUBKEY(DSA *a,unsigned char **pp);
812656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDSA *		d2i_DSA_PUBKEY(DSA **a,const unsigned char **pp,
813656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			long length);
814656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
815656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_EC
816656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp);
817656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEC_KEY 		*d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp,
818656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			long length);
819656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
820656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
821656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_SIG)
822656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_REQ_INFO)
823656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_REQ)
824656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
825656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE)
826656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value);
827656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
828656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_EXTENSION)
829656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS)
830656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
831656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY)
832656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
833656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_NAME)
834656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
835656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_NAME_set(X509_NAME **xn, X509_NAME *name);
836656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
837656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_CINF)
838656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
839656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509)
840656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_CERT_AUX)
841656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
842656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_CERT_PAIR)
843656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
844656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
845656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	     CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
846656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_set_ex_data(X509 *r, int idx, void *arg);
847656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid *X509_get_ex_data(X509 *r, int idx);
848656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		i2d_X509_AUX(X509 *a,unsigned char **pp);
849656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509 *		d2i_X509_AUX(X509 **a,const unsigned char **pp,long length);
850656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
851656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_alias_set1(X509 *x, unsigned char *name, int len);
852656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_keyid_set1(X509 *x, unsigned char *id, int len);
853656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectunsigned char * X509_alias_get0(X509 *x, int *len);
854656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectunsigned char * X509_keyid_get0(X509 *x, int *len);
855656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int);
856656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_TRUST_set(int *t, int trust);
857656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj);
858656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj);
859656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid X509_trust_clear(X509 *x);
860656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid X509_reject_clear(X509 *x);
861656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
862656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_REVOKED)
863656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_CRL_INFO)
864656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(X509_CRL)
865656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
866656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
867221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint X509_CRL_get0_by_serial(X509_CRL *crl,
868221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom		X509_REVOKED **ret, ASN1_INTEGER *serial);
869221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x);
870656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
871656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_PKEY *	X509_PKEY_new(void );
872656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid		X509_PKEY_free(X509_PKEY *a);
873656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp);
874656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_PKEY *	d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length);
875656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
876656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
877656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
878656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE)
879656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
880656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_EVP
881656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_INFO *	X509_INFO_new(void);
882656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid		X509_INFO_free(X509_INFO *a);
883656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectchar *		X509_NAME_oneline(X509_NAME *a,char *buf,int size);
884656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
885656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1,
886656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project		ASN1_BIT_STRING *signature,char *data,EVP_PKEY *pkey);
887656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
888656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint ASN1_digest(i2d_of_void *i2d,const EVP_MD *type,char *data,
889656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project		unsigned char *md,unsigned int *len);
890656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
891656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1,
892656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	      X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
893656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	      char *data,EVP_PKEY *pkey, const EVP_MD *type);
894656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
895656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data,
896656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	unsigned char *md,unsigned int *len);
897656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
898656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1,
899656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_BIT_STRING *signature,void *data,EVP_PKEY *pkey);
900656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
901656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
902656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	ASN1_BIT_STRING *signature,
903656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	void *data, EVP_PKEY *pkey, const EVP_MD *type);
904392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstromint ASN1_item_sign_ctx(const ASN1_ITEM *it,
905392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom		X509_ALGOR *algor1, X509_ALGOR *algor2,
906392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom	     	ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx);
907656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
908656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
909656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint 		X509_set_version(X509 *x,long version);
910656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint 		X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
911656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_INTEGER *	X509_get_serialNumber(X509 *x);
912656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint 		X509_set_issuer_name(X509 *x, X509_NAME *name);
913656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_NAME *	X509_get_issuer_name(X509 *a);
914656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint 		X509_set_subject_name(X509 *x, X509_NAME *name);
915656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_NAME *	X509_get_subject_name(X509 *a);
916221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint 		X509_set_notBefore(X509 *x, const ASN1_TIME *tm);
917221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint 		X509_set_notAfter(X509 *x, const ASN1_TIME *tm);
918656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint 		X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
919656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEVP_PKEY *	X509_get_pubkey(X509 *x);
920656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x);
921656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */);
922656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
923656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REQ_set_version(X509_REQ *x,long version);
924656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name);
925656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
926656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEVP_PKEY *	X509_REQ_get_pubkey(X509_REQ *req);
927656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REQ_extension_nid(int nid);
928656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint *		X509_REQ_get_extension_nids(void);
929656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid		X509_REQ_set_extension_nids(int *nids);
930656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectSTACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);
931656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
932656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project				int nid);
933656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts);
934656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REQ_get_attr_count(const X509_REQ *req);
935656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid,
936656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			  int lastpos);
937656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj,
938656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			  int lastpos);
939656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc);
940656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc);
941656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);
942656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
943656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const ASN1_OBJECT *obj, int type,
944656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const unsigned char *bytes, int len);
945656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REQ_add1_attr_by_NID(X509_REQ *req,
946656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			int nid, int type,
947656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const unsigned char *bytes, int len);
948656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REQ_add1_attr_by_txt(X509_REQ *req,
949656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const char *attrname, int type,
950656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const unsigned char *bytes, int len);
951656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
952656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_CRL_set_version(X509_CRL *x, long version);
953656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
954221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm);
955221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm);
956656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_CRL_sort(X509_CRL *crl);
957656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
958656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial);
959656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm);
960656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
961656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REQ_check_private_key(X509_REQ *x509,EVP_PKEY *pkey);
962656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
963656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_check_private_key(X509 *x509,EVP_PKEY *pkey);
964656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
965656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_issuer_and_serial_cmp(const X509 *a, const X509 *b);
966656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectunsigned long	X509_issuer_and_serial_hash(X509 *a);
967656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
968656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_issuer_name_cmp(const X509 *a, const X509 *b);
969656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectunsigned long	X509_issuer_name_hash(X509 *a);
970656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
971656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_subject_name_cmp(const X509 *a, const X509 *b);
972656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectunsigned long	X509_subject_name_hash(X509 *x);
973656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
974221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom#ifndef OPENSSL_NO_MD5
975221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromunsigned long	X509_issuer_name_hash_old(X509 *a);
976221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromunsigned long	X509_subject_name_hash_old(X509 *x);
977221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom#endif
978221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom
979656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_cmp(const X509 *a, const X509 *b);
980656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
981656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectunsigned long	X509_NAME_hash(X509_NAME *x);
982221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromunsigned long	X509_NAME_hash_old(X509_NAME *x);
983656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
984656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
985221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint		X509_CRL_match(const X509_CRL *a, const X509_CRL *b);
986656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_FP_API
987656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
988656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_print_fp(FILE *bp,X509 *x);
989656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_CRL_print_fp(FILE *bp,X509_CRL *x);
990656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REQ_print_fp(FILE *bp,X509_REQ *req);
991656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags);
992656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
993656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
994656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifndef OPENSSL_NO_BIO
995656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_NAME_print(BIO *bp, X509_NAME *name, int obase);
996656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags);
997656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_print_ex(BIO *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
998656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_print(BIO *bp,X509 *x);
999656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_ocspid_print(BIO *bp,X509 *x);
1000656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent);
1001656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_CRL_print(BIO *bp,X509_CRL *x);
1002656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long cflag);
1003656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REQ_print(BIO *bp,X509_REQ *req);
1004656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
1005656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1006656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint 		X509_NAME_entry_count(X509_NAME *name);
1007656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint 		X509_NAME_get_text_by_NID(X509_NAME *name, int nid,
1008656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			char *buf,int len);
1009656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj,
1010656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			char *buf,int len);
1011656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1012656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* NOTE: you should be passsing -1, not 0 as lastpos.  The functions that use
1013656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * lastpos, search after that position on. */
1014656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint 		X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos);
1015656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint 		X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj,
1016656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			int lastpos);
1017656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc);
1018656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc);
1019656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint 		X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne,
1020656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			int loc, int set);
1021656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type,
1022656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			unsigned char *bytes, int len, int loc, int set);
1023656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
1024656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			unsigned char *bytes, int len, int loc, int set);
1025656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
1026656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project		const char *field, int type, const unsigned char *bytes, int len);
1027656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
1028656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			int type,unsigned char *bytes, int len);
1029656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type,
1030656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const unsigned char *bytes, int len, int loc, int set);
1031656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
1032656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			ASN1_OBJECT *obj, int type,const unsigned char *bytes,
1033656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			int len);
1034656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint 		X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne,
1035656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			ASN1_OBJECT *obj);
1036656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint 		X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
1037656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const unsigned char *bytes, int len);
1038656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_OBJECT *	X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne);
1039656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_STRING *	X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne);
1040656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1041656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x);
1042656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x,
1043656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project				      int nid, int lastpos);
1044656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x,
1045656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project				      ASN1_OBJECT *obj,int lastpos);
1046656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x,
1047656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project					   int crit, int lastpos);
1048656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc);
1049656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);
1050656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectSTACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
1051656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project					 X509_EXTENSION *ex, int loc);
1052656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1053656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_get_ext_count(X509 *x);
1054656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_get_ext_by_NID(X509 *x, int nid, int lastpos);
1055656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,int lastpos);
1056656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_get_ext_by_critical(X509 *x, int crit, int lastpos);
1057656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_EXTENSION *X509_get_ext(X509 *x, int loc);
1058656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_EXTENSION *X509_delete_ext(X509 *x, int loc);
1059656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
1060656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid	*	X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx);
1061656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
1062656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project							unsigned long flags);
1063656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1064656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_CRL_get_ext_count(X509_CRL *x);
1065656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos);
1066656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_CRL_get_ext_by_OBJ(X509_CRL *x,ASN1_OBJECT *obj,int lastpos);
1067656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos);
1068656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc);
1069656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);
1070656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
1071656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid	*	X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx);
1072656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
1073656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project							unsigned long flags);
1074656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1075656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REVOKED_get_ext_count(X509_REVOKED *x);
1076656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos);
1077656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x,ASN1_OBJECT *obj,int lastpos);
1078656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos);
1079656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc);
1080656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc);
1081656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc);
1082656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid	*	X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx);
1083656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
1084656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project							unsigned long flags);
1085656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1086656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
1087656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			int nid, int crit, ASN1_OCTET_STRING *data);
1088656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
1089656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			ASN1_OBJECT *obj,int crit,ASN1_OCTET_STRING *data);
1090656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_EXTENSION_set_object(X509_EXTENSION *ex,ASN1_OBJECT *obj);
1091656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
1092656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_EXTENSION_set_data(X509_EXTENSION *ex,
1093656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			ASN1_OCTET_STRING *data);
1094656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_OBJECT *	X509_EXTENSION_get_object(X509_EXTENSION *ex);
1095656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
1096656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_EXTENSION_get_critical(X509_EXTENSION *ex);
1097656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1098656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x);
1099656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid,
1100656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			  int lastpos);
1101656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, ASN1_OBJECT *obj,
1102656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			  int lastpos);
1103656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc);
1104656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc);
1105656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectSTACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
1106656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project					 X509_ATTRIBUTE *attr);
1107656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectSTACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x,
1108656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const ASN1_OBJECT *obj, int type,
1109656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const unsigned char *bytes, int len);
1110656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectSTACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x,
1111656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			int nid, int type,
1112656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const unsigned char *bytes, int len);
1113656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectSTACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x,
1114656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const char *attrname, int type,
1115656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const unsigned char *bytes, int len);
1116656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x,
1117656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project				ASN1_OBJECT *obj, int lastpos, int type);
1118656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
1119656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	     int atrtype, const void *data, int len);
1120656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
1121656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project	     const ASN1_OBJECT *obj, int atrtype, const void *data, int len);
1122656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
1123656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project		const char *atrname, int type, const unsigned char *bytes, int len);
1124656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj);
1125656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len);
1126656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx,
1127656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project					int atrtype, void *data);
1128656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr);
1129656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr);
1130656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx);
1131656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1132656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint EVP_PKEY_get_attr_count(const EVP_PKEY *key);
1133656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid,
1134656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			  int lastpos);
1135656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj,
1136656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			  int lastpos);
1137656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc);
1138656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc);
1139656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr);
1140656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key,
1141656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const ASN1_OBJECT *obj, int type,
1142656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const unsigned char *bytes, int len);
1143656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key,
1144656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			int nid, int type,
1145656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const unsigned char *bytes, int len);
1146656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key,
1147656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const char *attrname, int type,
1148656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project			const unsigned char *bytes, int len);
1149656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1150656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint		X509_verify_cert(X509_STORE_CTX *ctx);
1151656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1152656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* lookup a cert from a X509 STACK */
1153656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name,
1154656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project				     ASN1_INTEGER *serial);
1155656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name);
1156656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1157656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(PBEPARAM)
1158656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(PBE2PARAM)
1159656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(PBKDF2PARAM)
1160656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1161221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter,
1162221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom				const unsigned char *salt, int saltlen);
1163221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom
1164221304ee937bc0910948a8be1320cb8cc4eb6d36Brian CarlstromX509_ALGOR *PKCS5_pbe_set(int alg, int iter,
1165221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom				const unsigned char *salt, int saltlen);
1166656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
1167656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project					 unsigned char *salt, int saltlen);
1168221304ee937bc0910948a8be1320cb8cc4eb6d36Brian CarlstromX509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
1169221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom				 unsigned char *salt, int saltlen,
1170221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom				 unsigned char *aiv, int prf_nid);
1171656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1172392aa7cc7d2b122614c5393c3e357da07fd07af3Brian CarlstromX509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen,
1173392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom				int prf_nid, int keylen);
1174392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom
1175656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* PKCS#8 utilities */
1176656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1177656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectDECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO)
1178656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1179656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectEVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8);
1180656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectPKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey);
1181656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectPKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken);
1182656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectPKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken);
1183656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1184221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj,
1185221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom			int version, int ptype, void *pval,
1186221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom				unsigned char *penc, int penclen);
1187221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint PKCS8_pkey_get0(ASN1_OBJECT **ppkalg,
1188221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom		const unsigned char **pk, int *ppklen,
1189221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom		X509_ALGOR **pa,
1190221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom		PKCS8_PRIV_KEY_INFO *p8);
1191221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom
1192221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj,
1193221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom					int ptype, void *pval,
1194221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom					unsigned char *penc, int penclen);
1195221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstromint X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg,
1196221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom		const unsigned char **pk, int *ppklen,
1197221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom		X509_ALGOR **pa,
1198221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom		X509_PUBKEY *pub);
1199221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom
1200656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_check_trust(X509 *x, int id, int flags);
1201656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_TRUST_get_count(void);
1202656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source ProjectX509_TRUST * X509_TRUST_get0(int idx);
1203656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_TRUST_get_by_id(int id);
1204656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),
1205656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project					char *name, int arg1, void *arg2);
1206656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid X509_TRUST_cleanup(void);
1207656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_TRUST_get_flags(X509_TRUST *xp);
1208656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectchar *X509_TRUST_get0_name(X509_TRUST *xp);
1209656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectint X509_TRUST_get_trust(X509_TRUST *xp);
1210656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1211656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* BEGIN ERROR CODES */
1212656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* The following lines are auto generated by the script mkerr.pl. Any changes
1213656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project * made after this point may be overwritten when the script is next run.
1214656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project */
1215656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Projectvoid ERR_load_X509_strings(void);
1216656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1217656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* Error codes for the X509 functions. */
1218656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1219656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* Function codes. */
1220656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_ADD_CERT_DIR				 100
1221656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_BY_FILE_CTRL				 101
1222656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_CHECK_POLICY				 145
1223656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_DIR_CTRL					 102
1224656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_GET_CERT_BY_SUBJECT			 103
1225656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_NETSCAPE_SPKI_B64_DECODE			 129
1226656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_NETSCAPE_SPKI_B64_ENCODE			 130
1227656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509AT_ADD1_ATTR				 135
1228656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509V3_ADD_EXT				 104
1229656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_ATTRIBUTE_CREATE_BY_NID		 136
1230656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ		 137
1231656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT		 140
1232656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_ATTRIBUTE_GET0_DATA			 139
1233656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_ATTRIBUTE_SET1_DATA			 138
1234656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_CHECK_PRIVATE_KEY			 128
1235656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_CRL_PRINT_FP			 147
1236656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_EXTENSION_CREATE_BY_NID		 108
1237656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_EXTENSION_CREATE_BY_OBJ		 109
1238656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_GET_PUBKEY_PARAMETERS		 110
1239656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_LOAD_CERT_CRL_FILE			 132
1240656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_LOAD_CERT_FILE			 111
1241656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_LOAD_CRL_FILE			 112
1242656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_NAME_ADD_ENTRY			 113
1243656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_NAME_ENTRY_CREATE_BY_NID		 114
1244656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT		 131
1245656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_NAME_ENTRY_SET_OBJECT		 115
1246656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_NAME_ONELINE			 116
1247656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_NAME_PRINT				 117
1248656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_PRINT_EX_FP				 118
1249656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_PUBKEY_GET				 119
1250656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_PUBKEY_SET				 120
1251656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_REQ_CHECK_PRIVATE_KEY		 144
1252656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_REQ_PRINT_EX			 121
1253656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_REQ_PRINT_FP			 122
1254656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_REQ_TO_X509				 123
1255656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_STORE_ADD_CERT			 124
1256656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_STORE_ADD_CRL			 125
1257656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_STORE_CTX_GET1_ISSUER		 146
1258656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_STORE_CTX_INIT			 143
1259656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_STORE_CTX_NEW			 142
1260656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_STORE_CTX_PURPOSE_INHERIT		 134
1261656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_TO_X509_REQ				 126
1262656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_TRUST_ADD				 133
1263656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_TRUST_SET				 141
1264656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_F_X509_VERIFY_CERT				 127
1265656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1266656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project/* Reason codes. */
1267656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_BAD_X509_FILETYPE			 100
1268656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_BASE64_DECODE_ERROR			 118
1269656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_CANT_CHECK_DH_KEY			 114
1270656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_CERT_ALREADY_IN_HASH_TABLE		 101
1271656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_ERR_ASN1_LIB				 102
1272656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_INVALID_DIRECTORY			 113
1273656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_INVALID_FIELD_NAME			 119
1274656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_INVALID_TRUST				 123
1275656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_KEY_TYPE_MISMATCH			 115
1276656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_KEY_VALUES_MISMATCH			 116
1277656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_LOADING_CERT_DIR				 103
1278656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_LOADING_DEFAULTS				 104
1279221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom#define X509_R_METHOD_NOT_SUPPORTED			 124
1280656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY		 105
1281221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom#define X509_R_PUBLIC_KEY_DECODE_ERROR			 125
1282221304ee937bc0910948a8be1320cb8cc4eb6d36Brian Carlstrom#define X509_R_PUBLIC_KEY_ENCODE_ERROR			 126
1283656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_SHOULD_RETRY				 106
1284656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN	 107
1285656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY		 108
1286656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_UNKNOWN_KEY_TYPE				 117
1287656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_UNKNOWN_NID				 109
1288656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_UNKNOWN_PURPOSE_ID			 121
1289656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_UNKNOWN_TRUST_ID				 120
1290656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_UNSUPPORTED_ALGORITHM			 111
1291656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_WRONG_LOOKUP_TYPE			 112
1292656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#define X509_R_WRONG_TYPE				 122
1293656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project
1294656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#ifdef  __cplusplus
1295656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project}
1296656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
1297656d9c7f52f88b3a3daccafa7655dec086c4756eThe Android Open Source Project#endif
1298