x509.h 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203
  1. /* $OpenBSD: x509.h,v 1.101 2023/07/28 15:50:33 tb Exp $ */
  2. /* Copyright (C) 1995-1998 Eric Young ([email protected])
  3. * All rights reserved.
  4. *
  5. * This package is an SSL implementation written
  6. * by Eric Young ([email protected]).
  7. * The implementation was written so as to conform with Netscapes SSL.
  8. *
  9. * This library is free for commercial and non-commercial use as long as
  10. * the following conditions are aheared to. The following conditions
  11. * apply to all code found in this distribution, be it the RC4, RSA,
  12. * lhash, DES, etc., code; not just the SSL code. The SSL documentation
  13. * included with this distribution is covered by the same copyright terms
  14. * except that the holder is Tim Hudson ([email protected]).
  15. *
  16. * Copyright remains Eric Young's, and as such any Copyright notices in
  17. * the code are not to be removed.
  18. * If this package is used in a product, Eric Young should be given attribution
  19. * as the author of the parts of the library used.
  20. * This can be in the form of a textual message at program startup or
  21. * in documentation (online or textual) provided with the package.
  22. *
  23. * Redistribution and use in source and binary forms, with or without
  24. * modification, are permitted provided that the following conditions
  25. * are met:
  26. * 1. Redistributions of source code must retain the copyright
  27. * notice, this list of conditions and the following disclaimer.
  28. * 2. Redistributions in binary form must reproduce the above copyright
  29. * notice, this list of conditions and the following disclaimer in the
  30. * documentation and/or other materials provided with the distribution.
  31. * 3. All advertising materials mentioning features or use of this software
  32. * must display the following acknowledgement:
  33. * "This product includes cryptographic software written by
  34. * Eric Young ([email protected])"
  35. * The word 'cryptographic' can be left out if the rouines from the library
  36. * being used are not cryptographic related :-).
  37. * 4. If you include any Windows specific code (or a derivative thereof) from
  38. * the apps directory (application code) you must include an acknowledgement:
  39. * "This product includes software written by Tim Hudson ([email protected])"
  40. *
  41. * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
  42. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  43. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  44. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  45. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  46. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  47. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  48. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  49. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  50. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  51. * SUCH DAMAGE.
  52. *
  53. * The licence and distribution terms for any publically available version or
  54. * derivative of this code cannot be changed. i.e. this code cannot simply be
  55. * copied and put under another distribution licence
  56. * [including the GNU Public Licence.]
  57. */
  58. /* ====================================================================
  59. * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
  60. * ECDH support in OpenSSL originally developed by
  61. * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
  62. */
  63. #ifndef HEADER_X509_H
  64. #define HEADER_X509_H
  65. #include <openssl/opensslconf.h>
  66. #include <openssl/asn1.h>
  67. #ifndef OPENSSL_NO_BIO
  68. #include <openssl/bio.h>
  69. #endif
  70. #ifndef OPENSSL_NO_BUFFER
  71. #include <openssl/buffer.h>
  72. #endif
  73. #ifndef OPENSSL_NO_DH
  74. #include <openssl/dh.h>
  75. #endif
  76. #ifndef OPENSSL_NO_DSA
  77. #include <openssl/dsa.h>
  78. #endif
  79. #ifndef OPENSSL_NO_EC
  80. #include <openssl/ec.h>
  81. #endif
  82. #ifndef OPENSSL_NO_EVP
  83. #include <openssl/evp.h>
  84. #endif
  85. #ifndef OPENSSL_NO_RSA
  86. #include <openssl/rsa.h>
  87. #endif
  88. #ifndef OPENSSL_NO_SHA
  89. #include <openssl/sha.h>
  90. #endif
  91. #include <openssl/stack.h>
  92. #include <openssl/safestack.h>
  93. #include <openssl/ossl_typ.h>
  94. #ifdef __cplusplus
  95. extern "C" {
  96. #endif
  97. #if defined(_WIN32) && defined(__WINCRYPT_H__)
  98. #if !defined(LIBRESSL_INTERNAL) && !defined(LIBRESSL_DISABLE_OVERRIDE_WINCRYPT_DEFINES_WARNING)
  99. #ifdef _MSC_VER
  100. #pragma message("Warning, overriding WinCrypt defines")
  101. #else
  102. #warning overriding WinCrypt defines
  103. #endif
  104. #endif
  105. #undef X509_NAME
  106. #undef X509_CERT_PAIR
  107. #undef X509_EXTENSIONS
  108. #endif
  109. #define X509_FILETYPE_PEM 1
  110. #define X509_FILETYPE_ASN1 2
  111. #define X509_FILETYPE_DEFAULT 3
  112. #define X509v3_KU_DIGITAL_SIGNATURE 0x0080
  113. #define X509v3_KU_NON_REPUDIATION 0x0040
  114. #define X509v3_KU_KEY_ENCIPHERMENT 0x0020
  115. #define X509v3_KU_DATA_ENCIPHERMENT 0x0010
  116. #define X509v3_KU_KEY_AGREEMENT 0x0008
  117. #define X509v3_KU_KEY_CERT_SIGN 0x0004
  118. #define X509v3_KU_CRL_SIGN 0x0002
  119. #define X509v3_KU_ENCIPHER_ONLY 0x0001
  120. #define X509v3_KU_DECIPHER_ONLY 0x8000
  121. #define X509v3_KU_UNDEF 0xffff
  122. struct X509_algor_st {
  123. ASN1_OBJECT *algorithm;
  124. ASN1_TYPE *parameter;
  125. } /* X509_ALGOR */;
  126. typedef STACK_OF(X509_ALGOR) X509_ALGORS;
  127. typedef struct X509_val_st {
  128. ASN1_TIME *notBefore;
  129. ASN1_TIME *notAfter;
  130. } X509_VAL;
  131. typedef struct X509_sig_st X509_SIG;
  132. typedef struct X509_name_entry_st X509_NAME_ENTRY;
  133. DECLARE_STACK_OF(X509_NAME_ENTRY)
  134. DECLARE_STACK_OF(X509_NAME)
  135. typedef struct X509_extension_st X509_EXTENSION;
  136. typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
  137. DECLARE_STACK_OF(X509_EXTENSION)
  138. typedef struct x509_attributes_st X509_ATTRIBUTE;
  139. DECLARE_STACK_OF(X509_ATTRIBUTE)
  140. typedef struct X509_req_info_st X509_REQ_INFO;
  141. typedef struct X509_req_st X509_REQ;
  142. typedef struct x509_cert_aux_st X509_CERT_AUX;
  143. typedef struct x509_cinf_st X509_CINF;
  144. DECLARE_STACK_OF(X509)
  145. /* This is used for a table of trust checking functions */
  146. typedef struct x509_trust_st {
  147. int trust;
  148. int flags;
  149. int (*check_trust)(struct x509_trust_st *, X509 *, int);
  150. char *name;
  151. int arg1;
  152. void *arg2;
  153. } X509_TRUST;
  154. DECLARE_STACK_OF(X509_TRUST)
  155. /* standard trust ids */
  156. /* OpenSSL changed this to 0 */
  157. #define X509_TRUST_DEFAULT -1 /* Only valid in purpose settings */
  158. #define X509_TRUST_COMPAT 1
  159. #define X509_TRUST_SSL_CLIENT 2
  160. #define X509_TRUST_SSL_SERVER 3
  161. #define X509_TRUST_EMAIL 4
  162. #define X509_TRUST_OBJECT_SIGN 5
  163. #define X509_TRUST_OCSP_SIGN 6
  164. #define X509_TRUST_OCSP_REQUEST 7
  165. #define X509_TRUST_TSA 8
  166. /* Keep these up to date! */
  167. #define X509_TRUST_MIN 1
  168. #define X509_TRUST_MAX 8
  169. /* trust_flags values */
  170. #define X509_TRUST_DYNAMIC 1
  171. #define X509_TRUST_DYNAMIC_NAME 2
  172. /* check_trust return codes */
  173. #define X509_TRUST_TRUSTED 1
  174. #define X509_TRUST_REJECTED 2
  175. #define X509_TRUST_UNTRUSTED 3
  176. /* Flags for X509_print_ex() */
  177. #define X509_FLAG_COMPAT 0
  178. #define X509_FLAG_NO_HEADER 1L
  179. #define X509_FLAG_NO_VERSION (1L << 1)
  180. #define X509_FLAG_NO_SERIAL (1L << 2)
  181. #define X509_FLAG_NO_SIGNAME (1L << 3)
  182. #define X509_FLAG_NO_ISSUER (1L << 4)
  183. #define X509_FLAG_NO_VALIDITY (1L << 5)
  184. #define X509_FLAG_NO_SUBJECT (1L << 6)
  185. #define X509_FLAG_NO_PUBKEY (1L << 7)
  186. #define X509_FLAG_NO_EXTENSIONS (1L << 8)
  187. #define X509_FLAG_NO_SIGDUMP (1L << 9)
  188. #define X509_FLAG_NO_AUX (1L << 10)
  189. #define X509_FLAG_NO_ATTRIBUTES (1L << 11)
  190. /* Flags specific to X509_NAME_print_ex() */
  191. /* The field separator information */
  192. #define XN_FLAG_SEP_MASK (0xf << 16)
  193. #define XN_FLAG_COMPAT 0 /* Traditional SSLeay: use old X509_NAME_print */
  194. #define XN_FLAG_SEP_COMMA_PLUS (1 << 16) /* RFC2253 ,+ */
  195. #define XN_FLAG_SEP_CPLUS_SPC (2 << 16) /* ,+ spaced: more readable */
  196. #define XN_FLAG_SEP_SPLUS_SPC (3 << 16) /* ;+ spaced */
  197. #define XN_FLAG_SEP_MULTILINE (4 << 16) /* One line per field */
  198. #define XN_FLAG_DN_REV (1 << 20) /* Reverse DN order */
  199. /* How the field name is shown */
  200. #define XN_FLAG_FN_MASK (0x3 << 21)
  201. #define XN_FLAG_FN_SN 0 /* Object short name */
  202. #define XN_FLAG_FN_LN (1 << 21) /* Object long name */
  203. #define XN_FLAG_FN_OID (2 << 21) /* Always use OIDs */
  204. #define XN_FLAG_FN_NONE (3 << 21) /* No field names */
  205. #define XN_FLAG_SPC_EQ (1 << 23) /* Put spaces round '=' */
  206. /* This determines if we dump fields we don't recognise:
  207. * RFC2253 requires this.
  208. */
  209. #define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
  210. #define XN_FLAG_FN_ALIGN (1 << 25) /* Align field names to 20 characters */
  211. /* Complete set of RFC2253 flags */
  212. #define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \
  213. XN_FLAG_SEP_COMMA_PLUS | \
  214. XN_FLAG_DN_REV | \
  215. XN_FLAG_FN_SN | \
  216. XN_FLAG_DUMP_UNKNOWN_FIELDS)
  217. /* readable oneline form */
  218. #define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
  219. ASN1_STRFLGS_ESC_QUOTE | \
  220. XN_FLAG_SEP_CPLUS_SPC | \
  221. XN_FLAG_SPC_EQ | \
  222. XN_FLAG_FN_SN)
  223. /* readable multiline form */
  224. #define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \
  225. ASN1_STRFLGS_ESC_MSB | \
  226. XN_FLAG_SEP_MULTILINE | \
  227. XN_FLAG_SPC_EQ | \
  228. XN_FLAG_FN_LN | \
  229. XN_FLAG_FN_ALIGN)
  230. DECLARE_STACK_OF(X509_REVOKED)
  231. typedef struct X509_crl_info_st X509_CRL_INFO;
  232. DECLARE_STACK_OF(X509_CRL)
  233. typedef struct private_key_st {
  234. int version;
  235. /* The PKCS#8 data types */
  236. X509_ALGOR *enc_algor;
  237. ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */
  238. /* When decrypted, the following will not be NULL */
  239. EVP_PKEY *dec_pkey;
  240. /* used to encrypt and decrypt */
  241. int key_length;
  242. char *key_data;
  243. int key_free; /* true if we should auto free key_data */
  244. /* expanded version of 'enc_algor' */
  245. EVP_CIPHER_INFO cipher;
  246. int references;
  247. } X509_PKEY;
  248. #ifndef OPENSSL_NO_EVP
  249. typedef struct X509_info_st {
  250. X509 *x509;
  251. X509_CRL *crl;
  252. X509_PKEY *x_pkey;
  253. EVP_CIPHER_INFO enc_cipher;
  254. int enc_len;
  255. char *enc_data;
  256. int references;
  257. } X509_INFO;
  258. DECLARE_STACK_OF(X509_INFO)
  259. #endif
  260. /* The next 2 structures and their 8 routines were sent to me by
  261. * Pat Richard <[email protected]> and are used to manipulate
  262. * Netscapes spki structures - useful if you are writing a CA web page
  263. */
  264. typedef struct Netscape_spkac_st {
  265. X509_PUBKEY *pubkey;
  266. ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */
  267. } NETSCAPE_SPKAC;
  268. typedef struct Netscape_spki_st {
  269. NETSCAPE_SPKAC *spkac; /* signed public key and challenge */
  270. X509_ALGOR *sig_algor;
  271. ASN1_BIT_STRING *signature;
  272. } NETSCAPE_SPKI;
  273. /* Password based encryption structure */
  274. typedef struct PBEPARAM_st {
  275. ASN1_OCTET_STRING *salt;
  276. ASN1_INTEGER *iter;
  277. } PBEPARAM;
  278. /* Password based encryption V2 structures */
  279. typedef struct PBE2PARAM_st {
  280. X509_ALGOR *keyfunc;
  281. X509_ALGOR *encryption;
  282. } PBE2PARAM;
  283. typedef struct PBKDF2PARAM_st {
  284. /* Usually OCTET STRING but could be anything */
  285. ASN1_TYPE *salt;
  286. ASN1_INTEGER *iter;
  287. ASN1_INTEGER *keylength;
  288. X509_ALGOR *prf;
  289. } PBKDF2PARAM;
  290. #ifdef __cplusplus
  291. }
  292. #endif
  293. #include <openssl/x509_vfy.h>
  294. #include <openssl/pkcs7.h>
  295. #ifdef __cplusplus
  296. extern "C" {
  297. #endif
  298. #define X509_extract_key(x) X509_get_pubkey(x) /*****/
  299. #define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a)
  300. #define X509_name_cmp(a,b) X509_NAME_cmp((a),(b))
  301. int X509_CRL_up_ref(X509_CRL *x);
  302. int X509_CRL_get_signature_nid(const X509_CRL *crl);
  303. int i2d_re_X509_CRL_tbs(X509_CRL *req, unsigned char **pp);
  304. const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl);
  305. long X509_CRL_get_version(const X509_CRL *crl);
  306. const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl);
  307. const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl);
  308. ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl);
  309. ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl);
  310. X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl);
  311. STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl);
  312. void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
  313. const X509_ALGOR **palg);
  314. const X509_ALGOR *X509_CRL_get0_tbs_sigalg(const X509_CRL *crl);
  315. int X509_REQ_get_signature_nid(const X509_REQ *req);
  316. void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
  317. const X509_ALGOR **palg);
  318. void X509_CRL_set_default_method(const X509_CRL_METHOD *meth);
  319. X509_CRL_METHOD *X509_CRL_METHOD_new(
  320. int (*crl_init)(X509_CRL *crl),
  321. int (*crl_free)(X509_CRL *crl),
  322. int (*crl_lookup)(X509_CRL *crl, X509_REVOKED **ret,
  323. ASN1_INTEGER *ser, X509_NAME *issuer),
  324. int (*crl_verify)(X509_CRL *crl, EVP_PKEY *pk));
  325. void X509_CRL_METHOD_free(X509_CRL_METHOD *m);
  326. void X509_CRL_set_meth_data(X509_CRL *crl, void *dat);
  327. void *X509_CRL_get_meth_data(X509_CRL *crl);
  328. X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x);
  329. const char *X509_verify_cert_error_string(long n);
  330. #ifndef OPENSSL_NO_EVP
  331. int X509_verify(X509 *a, EVP_PKEY *r);
  332. int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
  333. int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r);
  334. int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r);
  335. NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len);
  336. char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x);
  337. EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x);
  338. int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey);
  339. int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki);
  340. int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent);
  341. int X509_signature_print(BIO *bp, const X509_ALGOR *alg,
  342. const ASN1_STRING *sig);
  343. int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
  344. int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx);
  345. int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
  346. int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx);
  347. int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
  348. int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx);
  349. int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md);
  350. int X509_pubkey_digest(const X509 *data,const EVP_MD *type,
  351. unsigned char *md, unsigned int *len);
  352. int X509_digest(const X509 *data,const EVP_MD *type,
  353. unsigned char *md, unsigned int *len);
  354. int X509_CRL_digest(const X509_CRL *data,const EVP_MD *type,
  355. unsigned char *md, unsigned int *len);
  356. int X509_REQ_digest(const X509_REQ *data,const EVP_MD *type,
  357. unsigned char *md, unsigned int *len);
  358. int X509_NAME_digest(const X509_NAME *data,const EVP_MD *type,
  359. unsigned char *md, unsigned int *len);
  360. #endif
  361. X509 *d2i_X509_fp(FILE *fp, X509 **x509);
  362. int i2d_X509_fp(FILE *fp,X509 *x509);
  363. X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl);
  364. int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl);
  365. X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req);
  366. int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req);
  367. #ifndef OPENSSL_NO_RSA
  368. RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa);
  369. int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa);
  370. RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA **rsa);
  371. int i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa);
  372. RSA *d2i_RSA_PUBKEY_fp(FILE *fp,RSA **rsa);
  373. int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa);
  374. #endif
  375. #ifndef OPENSSL_NO_DSA
  376. DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa);
  377. int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa);
  378. DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa);
  379. int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa);
  380. #endif
  381. #ifndef OPENSSL_NO_EC
  382. EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey);
  383. int i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey);
  384. EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey);
  385. int i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey);
  386. #endif
  387. X509_SIG *d2i_PKCS8_fp(FILE *fp,X509_SIG **p8);
  388. int i2d_PKCS8_fp(FILE *fp,X509_SIG *p8);
  389. PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
  390. PKCS8_PRIV_KEY_INFO **p8inf);
  391. int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,PKCS8_PRIV_KEY_INFO *p8inf);
  392. int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key);
  393. int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey);
  394. EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a);
  395. int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey);
  396. EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a);
  397. #ifndef OPENSSL_NO_BIO
  398. X509 *d2i_X509_bio(BIO *bp,X509 **x509);
  399. int i2d_X509_bio(BIO *bp,X509 *x509);
  400. X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl);
  401. int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl);
  402. X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req);
  403. int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req);
  404. #ifndef OPENSSL_NO_RSA
  405. RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa);
  406. int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa);
  407. RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA **rsa);
  408. int i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa);
  409. RSA *d2i_RSA_PUBKEY_bio(BIO *bp,RSA **rsa);
  410. int i2d_RSA_PUBKEY_bio(BIO *bp,RSA *rsa);
  411. #endif
  412. #ifndef OPENSSL_NO_DSA
  413. DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa);
  414. int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa);
  415. DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa);
  416. int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa);
  417. #endif
  418. #ifndef OPENSSL_NO_EC
  419. EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey);
  420. int i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *eckey);
  421. EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey);
  422. int i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey);
  423. #endif
  424. X509_SIG *d2i_PKCS8_bio(BIO *bp,X509_SIG **p8);
  425. int i2d_PKCS8_bio(BIO *bp,X509_SIG *p8);
  426. PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
  427. PKCS8_PRIV_KEY_INFO **p8inf);
  428. int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,PKCS8_PRIV_KEY_INFO *p8inf);
  429. int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key);
  430. int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey);
  431. EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a);
  432. int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey);
  433. EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a);
  434. #endif
  435. X509 *X509_dup(X509 *x509);
  436. X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa);
  437. X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex);
  438. X509_CRL *X509_CRL_dup(X509_CRL *crl);
  439. X509_REQ *X509_REQ_dup(X509_REQ *req);
  440. X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn);
  441. int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval);
  442. void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval,
  443. const X509_ALGOR *algor);
  444. void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);
  445. int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b);
  446. X509_NAME *X509_NAME_dup(X509_NAME *xn);
  447. int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen);
  448. X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne);
  449. int X509_cmp_time(const ASN1_TIME *s, time_t *t);
  450. int X509_cmp_current_time(const ASN1_TIME *s);
  451. ASN1_TIME * X509_time_adj(ASN1_TIME *s, long adj, time_t *t);
  452. ASN1_TIME * X509_time_adj_ex(ASN1_TIME *s,
  453. int offset_day, long offset_sec, time_t *t);
  454. ASN1_TIME * X509_gmtime_adj(ASN1_TIME *s, long adj);
  455. const char * X509_get_default_cert_area(void );
  456. const char * X509_get_default_cert_dir(void );
  457. const char * X509_get_default_cert_file(void );
  458. const char * X509_get_default_cert_dir_env(void );
  459. const char * X509_get_default_cert_file_env(void );
  460. const char * X509_get_default_private_dir(void );
  461. X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
  462. X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey);
  463. X509_ALGOR *X509_ALGOR_new(void);
  464. void X509_ALGOR_free(X509_ALGOR *a);
  465. X509_ALGOR *d2i_X509_ALGOR(X509_ALGOR **a, const unsigned char **in, long len);
  466. int i2d_X509_ALGOR(X509_ALGOR *a, unsigned char **out);
  467. extern const ASN1_ITEM X509_ALGOR_it;
  468. X509_ALGORS *d2i_X509_ALGORS(X509_ALGORS **a, const unsigned char **in, long len);
  469. int i2d_X509_ALGORS(X509_ALGORS *a, unsigned char **out);
  470. extern const ASN1_ITEM X509_ALGORS_it;
  471. X509_VAL *X509_VAL_new(void);
  472. void X509_VAL_free(X509_VAL *a);
  473. X509_VAL *d2i_X509_VAL(X509_VAL **a, const unsigned char **in, long len);
  474. int i2d_X509_VAL(X509_VAL *a, unsigned char **out);
  475. extern const ASN1_ITEM X509_VAL_it;
  476. X509_PUBKEY *X509_PUBKEY_new(void);
  477. void X509_PUBKEY_free(X509_PUBKEY *a);
  478. X509_PUBKEY *d2i_X509_PUBKEY(X509_PUBKEY **a, const unsigned char **in, long len);
  479. int i2d_X509_PUBKEY(X509_PUBKEY *a, unsigned char **out);
  480. extern const ASN1_ITEM X509_PUBKEY_it;
  481. int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);
  482. EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key);
  483. EVP_PKEY * X509_PUBKEY_get0(X509_PUBKEY *key);
  484. int X509_get_pubkey_parameters(EVP_PKEY *pkey,
  485. STACK_OF(X509) *chain);
  486. int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp);
  487. EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,const unsigned char **pp,
  488. long length);
  489. #ifndef OPENSSL_NO_RSA
  490. int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp);
  491. RSA * d2i_RSA_PUBKEY(RSA **a,const unsigned char **pp,
  492. long length);
  493. #endif
  494. #ifndef OPENSSL_NO_DSA
  495. int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp);
  496. DSA * d2i_DSA_PUBKEY(DSA **a,const unsigned char **pp,
  497. long length);
  498. #endif
  499. #ifndef OPENSSL_NO_EC
  500. int i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp);
  501. EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp,
  502. long length);
  503. #endif
  504. X509_SIG *X509_SIG_new(void);
  505. void X509_SIG_free(X509_SIG *a);
  506. X509_SIG *d2i_X509_SIG(X509_SIG **a, const unsigned char **in, long len);
  507. int i2d_X509_SIG(X509_SIG *a, unsigned char **out);
  508. extern const ASN1_ITEM X509_SIG_it;
  509. void X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **palg,
  510. const ASN1_OCTET_STRING **pdigest);
  511. void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg,
  512. ASN1_OCTET_STRING **pdigest);
  513. X509_REQ_INFO *X509_REQ_INFO_new(void);
  514. void X509_REQ_INFO_free(X509_REQ_INFO *a);
  515. X509_REQ_INFO *d2i_X509_REQ_INFO(X509_REQ_INFO **a, const unsigned char **in, long len);
  516. int i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **out);
  517. extern const ASN1_ITEM X509_REQ_INFO_it;
  518. X509_REQ *X509_REQ_new(void);
  519. void X509_REQ_free(X509_REQ *a);
  520. X509_REQ *d2i_X509_REQ(X509_REQ **a, const unsigned char **in, long len);
  521. int i2d_X509_REQ(X509_REQ *a, unsigned char **out);
  522. extern const ASN1_ITEM X509_REQ_it;
  523. X509_ATTRIBUTE *X509_ATTRIBUTE_new(void);
  524. void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a);
  525. X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a, const unsigned char **in, long len);
  526. int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a, unsigned char **out);
  527. extern const ASN1_ITEM X509_ATTRIBUTE_it;
  528. X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value);
  529. X509_EXTENSION *X509_EXTENSION_new(void);
  530. void X509_EXTENSION_free(X509_EXTENSION *a);
  531. X509_EXTENSION *d2i_X509_EXTENSION(X509_EXTENSION **a, const unsigned char **in, long len);
  532. int i2d_X509_EXTENSION(X509_EXTENSION *a, unsigned char **out);
  533. extern const ASN1_ITEM X509_EXTENSION_it;
  534. X509_EXTENSIONS *d2i_X509_EXTENSIONS(X509_EXTENSIONS **a, const unsigned char **in, long len);
  535. int i2d_X509_EXTENSIONS(X509_EXTENSIONS *a, unsigned char **out);
  536. extern const ASN1_ITEM X509_EXTENSIONS_it;
  537. X509_NAME_ENTRY *X509_NAME_ENTRY_new(void);
  538. void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a);
  539. X509_NAME_ENTRY *d2i_X509_NAME_ENTRY(X509_NAME_ENTRY **a, const unsigned char **in, long len);
  540. int i2d_X509_NAME_ENTRY(X509_NAME_ENTRY *a, unsigned char **out);
  541. extern const ASN1_ITEM X509_NAME_ENTRY_it;
  542. X509_NAME *X509_NAME_new(void);
  543. void X509_NAME_free(X509_NAME *a);
  544. X509_NAME *d2i_X509_NAME(X509_NAME **a, const unsigned char **in, long len);
  545. int i2d_X509_NAME(X509_NAME *a, unsigned char **out);
  546. extern const ASN1_ITEM X509_NAME_it;
  547. int X509_NAME_set(X509_NAME **xn, X509_NAME *name);
  548. X509_CINF *X509_CINF_new(void);
  549. void X509_CINF_free(X509_CINF *a);
  550. X509_CINF *d2i_X509_CINF(X509_CINF **a, const unsigned char **in, long len);
  551. int i2d_X509_CINF(X509_CINF *a, unsigned char **out);
  552. extern const ASN1_ITEM X509_CINF_it;
  553. X509 *X509_new(void);
  554. void X509_free(X509 *a);
  555. X509 *d2i_X509(X509 **a, const unsigned char **in, long len);
  556. int i2d_X509(X509 *a, unsigned char **out);
  557. extern const ASN1_ITEM X509_it;
  558. X509_CERT_AUX *X509_CERT_AUX_new(void);
  559. void X509_CERT_AUX_free(X509_CERT_AUX *a);
  560. X509_CERT_AUX *d2i_X509_CERT_AUX(X509_CERT_AUX **a, const unsigned char **in, long len);
  561. int i2d_X509_CERT_AUX(X509_CERT_AUX *a, unsigned char **out);
  562. extern const ASN1_ITEM X509_CERT_AUX_it;
  563. int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
  564. CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
  565. int X509_set_ex_data(X509 *r, int idx, void *arg);
  566. void *X509_get_ex_data(X509 *r, int idx);
  567. int i2d_X509_AUX(X509 *a,unsigned char **pp);
  568. X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length);
  569. int i2d_re_X509_tbs(X509 *x, unsigned char **pp);
  570. void X509_get0_signature(const ASN1_BIT_STRING **psig,
  571. const X509_ALGOR **palg, const X509 *x);
  572. int X509_get_signature_nid(const X509 *x);
  573. int X509_alias_set1(X509 *x, const unsigned char *name, int len);
  574. int X509_keyid_set1(X509 *x, const unsigned char *id, int len);
  575. unsigned char *X509_alias_get0(X509 *x, int *len);
  576. unsigned char *X509_keyid_get0(X509 *x, int *len);
  577. int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int);
  578. int X509_TRUST_set(int *t, int trust);
  579. int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj);
  580. int X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj);
  581. void X509_trust_clear(X509 *x);
  582. void X509_reject_clear(X509 *x);
  583. X509_REVOKED *X509_REVOKED_new(void);
  584. void X509_REVOKED_free(X509_REVOKED *a);
  585. X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *a);
  586. X509_REVOKED *d2i_X509_REVOKED(X509_REVOKED **a, const unsigned char **in, long len);
  587. int i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **out);
  588. extern const ASN1_ITEM X509_REVOKED_it;
  589. X509_CRL_INFO *X509_CRL_INFO_new(void);
  590. void X509_CRL_INFO_free(X509_CRL_INFO *a);
  591. X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a, const unsigned char **in, long len);
  592. int i2d_X509_CRL_INFO(X509_CRL_INFO *a, unsigned char **out);
  593. extern const ASN1_ITEM X509_CRL_INFO_it;
  594. X509_CRL *X509_CRL_new(void);
  595. void X509_CRL_free(X509_CRL *a);
  596. X509_CRL *d2i_X509_CRL(X509_CRL **a, const unsigned char **in, long len);
  597. int i2d_X509_CRL(X509_CRL *a, unsigned char **out);
  598. extern const ASN1_ITEM X509_CRL_it;
  599. int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
  600. int X509_CRL_get0_by_serial(X509_CRL *crl,
  601. X509_REVOKED **ret, ASN1_INTEGER *serial);
  602. int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x);
  603. X509_PKEY * X509_PKEY_new(void );
  604. void X509_PKEY_free(X509_PKEY *a);
  605. NETSCAPE_SPKI *NETSCAPE_SPKI_new(void);
  606. void NETSCAPE_SPKI_free(NETSCAPE_SPKI *a);
  607. NETSCAPE_SPKI *d2i_NETSCAPE_SPKI(NETSCAPE_SPKI **a, const unsigned char **in, long len);
  608. int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a, unsigned char **out);
  609. extern const ASN1_ITEM NETSCAPE_SPKI_it;
  610. NETSCAPE_SPKAC *NETSCAPE_SPKAC_new(void);
  611. void NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a);
  612. NETSCAPE_SPKAC *d2i_NETSCAPE_SPKAC(NETSCAPE_SPKAC **a, const unsigned char **in, long len);
  613. int i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC *a, unsigned char **out);
  614. extern const ASN1_ITEM NETSCAPE_SPKAC_it;
  615. #ifndef OPENSSL_NO_EVP
  616. X509_INFO * X509_INFO_new(void);
  617. void X509_INFO_free(X509_INFO *a);
  618. char * X509_NAME_oneline(const X509_NAME *a, char *buf, int size);
  619. int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data,
  620. unsigned char *md,unsigned int *len);
  621. int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1,
  622. ASN1_BIT_STRING *signature,void *data,EVP_PKEY *pkey);
  623. int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
  624. ASN1_BIT_STRING *signature,
  625. void *data, EVP_PKEY *pkey, const EVP_MD *type);
  626. int ASN1_item_sign_ctx(const ASN1_ITEM *it,
  627. X509_ALGOR *algor1, X509_ALGOR *algor2,
  628. ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx);
  629. #endif
  630. const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x);
  631. void X509_get0_uids(const X509 *x, const ASN1_BIT_STRING **piuid,
  632. const ASN1_BIT_STRING **psuid);
  633. const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x);
  634. int X509_set_version(X509 *x, long version);
  635. long X509_get_version(const X509 *x);
  636. int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
  637. ASN1_INTEGER * X509_get_serialNumber(X509 *x);
  638. const ASN1_INTEGER *X509_get0_serialNumber(const X509 *x);
  639. int X509_set_issuer_name(X509 *x, X509_NAME *name);
  640. X509_NAME * X509_get_issuer_name(const X509 *a);
  641. int X509_set_subject_name(X509 *x, X509_NAME *name);
  642. X509_NAME * X509_get_subject_name(const X509 *a);
  643. int X509_set_notBefore(X509 *x, const ASN1_TIME *tm);
  644. int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm);
  645. int X509_set_notAfter(X509 *x, const ASN1_TIME *tm);
  646. int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm);
  647. const ASN1_TIME *X509_get0_notBefore(const X509 *x);
  648. ASN1_TIME *X509_getm_notBefore(const X509 *x);
  649. const ASN1_TIME *X509_get0_notAfter(const X509 *x);
  650. ASN1_TIME *X509_getm_notAfter(const X509 *x);
  651. int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
  652. EVP_PKEY * X509_get_pubkey(X509 *x);
  653. EVP_PKEY * X509_get0_pubkey(const X509 *x);
  654. ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x);
  655. int X509_certificate_type(const X509 *x, const EVP_PKEY *pubkey);
  656. int X509_get_signature_type(const X509 *x);
  657. #define X509_get_notBefore X509_getm_notBefore
  658. #define X509_get_notAfter X509_getm_notAfter
  659. int X509_REQ_set_version(X509_REQ *x,long version);
  660. long X509_REQ_get_version(const X509_REQ *x);
  661. int X509_REQ_set_subject_name(X509_REQ *req, X509_NAME *name);
  662. X509_NAME *X509_REQ_get_subject_name(const X509_REQ *x);
  663. int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
  664. EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req);
  665. int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp);
  666. EVP_PKEY * X509_REQ_get0_pubkey(X509_REQ *req);
  667. int X509_REQ_extension_nid(int nid);
  668. int * X509_REQ_get_extension_nids(void);
  669. void X509_REQ_set_extension_nids(int *nids);
  670. STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);
  671. int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
  672. int nid);
  673. int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts);
  674. int X509_REQ_get_attr_count(const X509_REQ *req);
  675. int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid,
  676. int lastpos);
  677. int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj,
  678. int lastpos);
  679. X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc);
  680. X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc);
  681. int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);
  682. int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
  683. const ASN1_OBJECT *obj, int type,
  684. const unsigned char *bytes, int len);
  685. int X509_REQ_add1_attr_by_NID(X509_REQ *req,
  686. int nid, int type,
  687. const unsigned char *bytes, int len);
  688. int X509_REQ_add1_attr_by_txt(X509_REQ *req,
  689. const char *attrname, int type,
  690. const unsigned char *bytes, int len);
  691. int X509_CRL_set_version(X509_CRL *x, long version);
  692. int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
  693. int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm);
  694. int X509_CRL_set1_lastUpdate(X509_CRL *x, const ASN1_TIME *tm);
  695. int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm);
  696. int X509_CRL_set1_nextUpdate(X509_CRL *x, const ASN1_TIME *tm);
  697. int X509_CRL_sort(X509_CRL *crl);
  698. const STACK_OF(X509_EXTENSION) *X509_REVOKED_get0_extensions(const X509_REVOKED *x);
  699. const ASN1_TIME *X509_REVOKED_get0_revocationDate(const X509_REVOKED *x);
  700. const ASN1_INTEGER *X509_REVOKED_get0_serialNumber(const X509_REVOKED *x);
  701. int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm);
  702. int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial);
  703. int X509_REQ_check_private_key(X509_REQ *x509,EVP_PKEY *pkey);
  704. int X509_check_private_key(const X509 *x509, const EVP_PKEY *pkey);
  705. int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b);
  706. unsigned long X509_issuer_and_serial_hash(X509 *a);
  707. int X509_issuer_name_cmp(const X509 *a, const X509 *b);
  708. unsigned long X509_issuer_name_hash(X509 *a);
  709. int X509_subject_name_cmp(const X509 *a, const X509 *b);
  710. unsigned long X509_subject_name_hash(X509 *x);
  711. #ifndef OPENSSL_NO_MD5
  712. unsigned long X509_issuer_name_hash_old(X509 *a);
  713. unsigned long X509_subject_name_hash_old(X509 *x);
  714. #endif
  715. int X509_cmp(const X509 *a, const X509 *b);
  716. int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
  717. unsigned long X509_NAME_hash(X509_NAME *x);
  718. unsigned long X509_NAME_hash_old(X509_NAME *x);
  719. int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
  720. int X509_CRL_match(const X509_CRL *a, const X509_CRL *b);
  721. int X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
  722. int X509_print_fp(FILE *bp,X509 *x);
  723. int X509_CRL_print_fp(FILE *bp,X509_CRL *x);
  724. int X509_REQ_print_fp(FILE *bp,X509_REQ *req);
  725. int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent,
  726. unsigned long flags);
  727. #ifndef OPENSSL_NO_BIO
  728. int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase);
  729. int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent,
  730. unsigned long flags);
  731. int X509_print_ex(BIO *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
  732. int X509_print(BIO *bp,X509 *x);
  733. int X509_ocspid_print(BIO *bp,X509 *x);
  734. int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent);
  735. int X509_CRL_print(BIO *bp,X509_CRL *x);
  736. int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long cflag);
  737. int X509_REQ_print(BIO *bp,X509_REQ *req);
  738. #endif
  739. int X509_NAME_entry_count(const X509_NAME *name);
  740. int X509_NAME_get_text_by_NID(X509_NAME *name, int nid,
  741. char *buf,int len);
  742. int X509_NAME_get_text_by_OBJ(X509_NAME *name,
  743. const ASN1_OBJECT *obj, char *buf,int len);
  744. /* NOTE: you should be passing -1, not 0 as lastpos. The functions that use
  745. * lastpos, search after that position on. */
  746. int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid,
  747. int lastpos);
  748. int X509_NAME_get_index_by_OBJ(const X509_NAME *name,
  749. const ASN1_OBJECT *obj, int lastpos);
  750. X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc);
  751. X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc);
  752. int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne,
  753. int loc, int set);
  754. int X509_NAME_add_entry_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj,
  755. int type, const unsigned char *bytes, int len, int loc, int set);
  756. int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
  757. const unsigned char *bytes, int len, int loc, int set);
  758. X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
  759. const char *field, int type, const unsigned char *bytes, int len);
  760. X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
  761. int type, const unsigned char *bytes, int len);
  762. int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type,
  763. const unsigned char *bytes, int len, int loc, int set);
  764. X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
  765. const ASN1_OBJECT *obj, int type,
  766. const unsigned char *bytes, int len);
  767. int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne,
  768. const ASN1_OBJECT *obj);
  769. int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
  770. const unsigned char *bytes, int len);
  771. ASN1_OBJECT * X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne);
  772. ASN1_STRING * X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne);
  773. int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne);
  774. int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x);
  775. int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x,
  776. int nid, int lastpos);
  777. int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x,
  778. const ASN1_OBJECT *obj, int lastpos);
  779. int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x,
  780. int crit, int lastpos);
  781. X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc);
  782. X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);
  783. STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
  784. X509_EXTENSION *ex, int loc);
  785. int X509_get_ext_count(const X509 *x);
  786. int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos);
  787. int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj,
  788. int lastpos);
  789. int X509_get_ext_by_critical(const X509 *x, int crit, int lastpos);
  790. X509_EXTENSION *X509_get_ext(const X509 *x, int loc);
  791. X509_EXTENSION *X509_delete_ext(X509 *x, int loc);
  792. int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
  793. void * X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx);
  794. int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
  795. unsigned long flags);
  796. int X509_CRL_get_ext_count(const X509_CRL *x);
  797. int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid,
  798. int lastpos);
  799. int X509_CRL_get_ext_by_OBJ(const X509_CRL *x,
  800. const ASN1_OBJECT *obj, int lastpos);
  801. int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit,
  802. int lastpos);
  803. X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc);
  804. X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);
  805. int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
  806. void * X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit,
  807. int *idx);
  808. int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value,
  809. int crit, unsigned long flags);
  810. int X509_REVOKED_get_ext_count(const X509_REVOKED *x);
  811. int X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid,
  812. int lastpos);
  813. int X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x,
  814. const ASN1_OBJECT *obj, int lastpos);
  815. int X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x,
  816. int crit, int lastpos);
  817. X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x, int loc);
  818. X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc);
  819. int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex,
  820. int loc);
  821. void * X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid,
  822. int *crit, int *idx);
  823. int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value,
  824. int crit, unsigned long flags);
  825. X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
  826. int nid, int crit, ASN1_OCTET_STRING *data);
  827. X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
  828. const ASN1_OBJECT *obj, int crit, ASN1_OCTET_STRING *data);
  829. int X509_EXTENSION_set_object(X509_EXTENSION *ex,
  830. const ASN1_OBJECT *obj);
  831. int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
  832. int X509_EXTENSION_set_data(X509_EXTENSION *ex,
  833. ASN1_OCTET_STRING *data);
  834. ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex);
  835. ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
  836. int X509_EXTENSION_get_critical(const X509_EXTENSION *ex);
  837. int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x);
  838. int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid,
  839. int lastpos);
  840. int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk,
  841. const ASN1_OBJECT *obj, int lastpos);
  842. X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc);
  843. X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc);
  844. STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
  845. X509_ATTRIBUTE *attr);
  846. STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x,
  847. const ASN1_OBJECT *obj, int type,
  848. const unsigned char *bytes, int len);
  849. STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x,
  850. int nid, int type,
  851. const unsigned char *bytes, int len);
  852. STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x,
  853. const char *attrname, int type,
  854. const unsigned char *bytes, int len);
  855. void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x,
  856. const ASN1_OBJECT *obj, int lastpos, int type);
  857. X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
  858. int atrtype, const void *data, int len);
  859. X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
  860. const ASN1_OBJECT *obj, int atrtype, const void *data, int len);
  861. X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
  862. const char *atrname, int type, const unsigned char *bytes, int len);
  863. int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj);
  864. int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len);
  865. void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx,
  866. int atrtype, void *data);
  867. int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr);
  868. ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr);
  869. ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx);
  870. int EVP_PKEY_get_attr_count(const EVP_PKEY *key);
  871. int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid,
  872. int lastpos);
  873. int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, const ASN1_OBJECT *obj,
  874. int lastpos);
  875. X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc);
  876. X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc);
  877. int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr);
  878. int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key,
  879. const ASN1_OBJECT *obj, int type,
  880. const unsigned char *bytes, int len);
  881. int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key,
  882. int nid, int type,
  883. const unsigned char *bytes, int len);
  884. int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key,
  885. const char *attrname, int type,
  886. const unsigned char *bytes, int len);
  887. int X509_verify_cert(X509_STORE_CTX *ctx);
  888. /* lookup a cert from a X509 STACK */
  889. X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name,
  890. ASN1_INTEGER *serial);
  891. X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name);
  892. PBEPARAM *PBEPARAM_new(void);
  893. void PBEPARAM_free(PBEPARAM *a);
  894. PBEPARAM *d2i_PBEPARAM(PBEPARAM **a, const unsigned char **in, long len);
  895. int i2d_PBEPARAM(PBEPARAM *a, unsigned char **out);
  896. extern const ASN1_ITEM PBEPARAM_it;
  897. PBE2PARAM *PBE2PARAM_new(void);
  898. void PBE2PARAM_free(PBE2PARAM *a);
  899. PBE2PARAM *d2i_PBE2PARAM(PBE2PARAM **a, const unsigned char **in, long len);
  900. int i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **out);
  901. extern const ASN1_ITEM PBE2PARAM_it;
  902. PBKDF2PARAM *PBKDF2PARAM_new(void);
  903. void PBKDF2PARAM_free(PBKDF2PARAM *a);
  904. PBKDF2PARAM *d2i_PBKDF2PARAM(PBKDF2PARAM **a, const unsigned char **in, long len);
  905. int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **out);
  906. extern const ASN1_ITEM PBKDF2PARAM_it;
  907. int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter,
  908. const unsigned char *salt, int saltlen);
  909. X509_ALGOR *PKCS5_pbe_set(int alg, int iter,
  910. const unsigned char *salt, int saltlen);
  911. X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
  912. unsigned char *salt, int saltlen);
  913. X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
  914. unsigned char *salt, int saltlen,
  915. unsigned char *aiv, int prf_nid);
  916. X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen,
  917. int prf_nid, int keylen);
  918. /* PKCS#8 utilities */
  919. PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new(void);
  920. void PKCS8_PRIV_KEY_INFO_free(PKCS8_PRIV_KEY_INFO *a);
  921. PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a, const unsigned char **in, long len);
  922. int i2d_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO *a, unsigned char **out);
  923. extern const ASN1_ITEM PKCS8_PRIV_KEY_INFO_it;
  924. EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8);
  925. PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey);
  926. int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, int version,
  927. int ptype, void *pval, unsigned char *penc, int penclen);
  928. int PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg, const unsigned char **pk,
  929. int *ppklen, const X509_ALGOR **pa, const PKCS8_PRIV_KEY_INFO *p8);
  930. const STACK_OF(X509_ATTRIBUTE) *PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8);
  931. int PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type,
  932. const unsigned char *bytes, int len);
  933. int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj,
  934. int ptype, void *pval,
  935. unsigned char *penc, int penclen);
  936. int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg,
  937. const unsigned char **pk, int *ppklen,
  938. X509_ALGOR **pa,
  939. X509_PUBKEY *pub);
  940. int X509_check_trust(X509 *x, int id, int flags);
  941. int X509_TRUST_get_count(void);
  942. X509_TRUST * X509_TRUST_get0(int idx);
  943. int X509_TRUST_get_by_id(int id);
  944. int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),
  945. const char *name, int arg1, void *arg2);
  946. void X509_TRUST_cleanup(void);
  947. int X509_TRUST_get_flags(const X509_TRUST *xp);
  948. char *X509_TRUST_get0_name(const X509_TRUST *xp);
  949. int X509_TRUST_get_trust(const X509_TRUST *xp);
  950. int X509_up_ref(X509 *x);
  951. STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain);
  952. void ERR_load_X509_strings(void);
  953. /* Error codes for the X509 functions. */
  954. /* Function codes. */
  955. #define X509_F_ADD_CERT_DIR 100
  956. #define X509_F_BY_FILE_CTRL 101
  957. #define X509_F_CHECK_POLICY 145
  958. #define X509_F_DIR_CTRL 102
  959. #define X509_F_GET_CERT_BY_SUBJECT 103
  960. #define X509_F_NETSCAPE_SPKI_B64_DECODE 129
  961. #define X509_F_NETSCAPE_SPKI_B64_ENCODE 130
  962. #define X509_F_X509AT_ADD1_ATTR 135
  963. #define X509_F_X509V3_ADD_EXT 104
  964. #define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 136
  965. #define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 137
  966. #define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 140
  967. #define X509_F_X509_ATTRIBUTE_GET0_DATA 139
  968. #define X509_F_X509_ATTRIBUTE_SET1_DATA 138
  969. #define X509_F_X509_CHECK_PRIVATE_KEY 128
  970. #define X509_F_X509_CRL_PRINT_FP 147
  971. #define X509_F_X509_EXTENSION_CREATE_BY_NID 108
  972. #define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109
  973. #define X509_F_X509_GET_PUBKEY_PARAMETERS 110
  974. #define X509_F_X509_LOAD_CERT_CRL_FILE 132
  975. #define X509_F_X509_LOAD_CERT_FILE 111
  976. #define X509_F_X509_LOAD_CRL_FILE 112
  977. #define X509_F_X509_NAME_ADD_ENTRY 113
  978. #define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114
  979. #define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131
  980. #define X509_F_X509_NAME_ENTRY_SET_OBJECT 115
  981. #define X509_F_X509_NAME_ONELINE 116
  982. #define X509_F_X509_NAME_PRINT 117
  983. #define X509_F_X509_PRINT_EX_FP 118
  984. #define X509_F_X509_PUBKEY_GET 119
  985. #define X509_F_X509_PUBKEY_SET 120
  986. #define X509_F_X509_REQ_CHECK_PRIVATE_KEY 144
  987. #define X509_F_X509_REQ_PRINT_EX 121
  988. #define X509_F_X509_REQ_PRINT_FP 122
  989. #define X509_F_X509_REQ_TO_X509 123
  990. #define X509_F_X509_STORE_ADD_CERT 124
  991. #define X509_F_X509_STORE_ADD_CRL 125
  992. #define X509_F_X509_STORE_CTX_GET1_ISSUER 146
  993. #define X509_F_X509_STORE_CTX_INIT 143
  994. #define X509_F_X509_STORE_CTX_NEW 142
  995. #define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134
  996. #define X509_F_X509_TO_X509_REQ 126
  997. #define X509_F_X509_TRUST_ADD 133
  998. #define X509_F_X509_TRUST_SET 141
  999. #define X509_F_X509_VERIFY_CERT 127
  1000. /* Reason codes. */
  1001. #define X509_R_BAD_X509_FILETYPE 100
  1002. #define X509_R_BASE64_DECODE_ERROR 118
  1003. #define X509_R_CANT_CHECK_DH_KEY 114
  1004. #define X509_R_CERT_ALREADY_IN_HASH_TABLE 101
  1005. #define X509_R_ERR_ASN1_LIB 102
  1006. #define X509_R_INVALID_DIRECTORY 113
  1007. #define X509_R_INVALID_FIELD_NAME 119
  1008. #define X509_R_INVALID_TRUST 123
  1009. #define X509_R_INVALID_VERSION 137
  1010. #define X509_R_KEY_TYPE_MISMATCH 115
  1011. #define X509_R_KEY_VALUES_MISMATCH 116
  1012. #define X509_R_LOADING_CERT_DIR 103
  1013. #define X509_R_LOADING_DEFAULTS 104
  1014. #define X509_R_METHOD_NOT_SUPPORTED 124
  1015. #define X509_R_NO_CERTIFICATE_OR_CRL_FOUND 136
  1016. #define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105
  1017. #define X509_R_PUBLIC_KEY_DECODE_ERROR 125
  1018. #define X509_R_PUBLIC_KEY_ENCODE_ERROR 126
  1019. #define X509_R_SHOULD_RETRY 106
  1020. #define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107
  1021. #define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108
  1022. #define X509_R_UNKNOWN_KEY_TYPE 117
  1023. #define X509_R_UNKNOWN_NID 109
  1024. #define X509_R_UNKNOWN_PURPOSE_ID 121
  1025. #define X509_R_UNKNOWN_TRUST_ID 120
  1026. #define X509_R_UNSUPPORTED_ALGORITHM 111
  1027. #define X509_R_WRONG_LOOKUP_TYPE 112
  1028. #define X509_R_WRONG_TYPE 122
  1029. #ifdef __cplusplus
  1030. }
  1031. #endif
  1032. #endif