69 #ifndef OPENSSL_NO_BUFFER
72 #ifndef OPENSSL_NO_EVP
75 #ifndef OPENSSL_NO_BIO
86 #ifndef OPENSSL_NO_ECDSA
90 #ifndef OPENSSL_NO_ECDH
94 #ifndef OPENSSL_NO_DEPRECATED
95 #ifndef OPENSSL_NO_RSA
98 #ifndef OPENSSL_NO_DSA
101 #ifndef OPENSSL_NO_DH
106 #ifndef OPENSSL_NO_SHA
115 #ifdef OPENSSL_SYS_WIN32
118 #undef X509_CERT_PAIR
119 #undef X509_EXTENSIONS
122 #define X509_FILETYPE_PEM 1
123 #define X509_FILETYPE_ASN1 2
124 #define X509_FILETYPE_DEFAULT 3
126 #define X509v3_KU_DIGITAL_SIGNATURE 0x0080
127 #define X509v3_KU_NON_REPUDIATION 0x0040
128 #define X509v3_KU_KEY_ENCIPHERMENT 0x0020
129 #define X509v3_KU_DATA_ENCIPHERMENT 0x0010
130 #define X509v3_KU_KEY_AGREEMENT 0x0008
131 #define X509v3_KU_KEY_CERT_SIGN 0x0004
132 #define X509v3_KU_CRL_SIGN 0x0002
133 #define X509v3_KU_ENCIPHER_ONLY 0x0001
134 #define X509v3_KU_DECIPHER_ONLY 0x8000
135 #define X509v3_KU_UNDEF 0xffff
189 #ifndef OPENSSL_NO_BUFFER
195 unsigned char *canon_enc;
201 #define X509_EX_V_NETSCAPE_HACK 0x8000
202 #define X509_EX_V_INIT 0x0001
301 #ifndef OPENSSL_NO_RFC3779
305 #ifndef OPENSSL_NO_SHA
319 int (*check_trust)(
struct x509_trust_st *,
X509 *, int);
334 #define X509_TRUST_DEFAULT -1
336 #define X509_TRUST_COMPAT 1
337 #define X509_TRUST_SSL_CLIENT 2
338 #define X509_TRUST_SSL_SERVER 3
339 #define X509_TRUST_EMAIL 4
340 #define X509_TRUST_OBJECT_SIGN 5
341 #define X509_TRUST_OCSP_SIGN 6
342 #define X509_TRUST_OCSP_REQUEST 7
343 #define X509_TRUST_TSA 8
346 #define X509_TRUST_MIN 1
347 #define X509_TRUST_MAX 8
351 #define X509_TRUST_DYNAMIC 1
352 #define X509_TRUST_DYNAMIC_NAME 2
356 #define X509_TRUST_TRUSTED 1
357 #define X509_TRUST_REJECTED 2
358 #define X509_TRUST_UNTRUSTED 3
362 #define X509_FLAG_COMPAT 0
363 #define X509_FLAG_NO_HEADER 1L
364 #define X509_FLAG_NO_VERSION (1L << 1)
365 #define X509_FLAG_NO_SERIAL (1L << 2)
366 #define X509_FLAG_NO_SIGNAME (1L << 3)
367 #define X509_FLAG_NO_ISSUER (1L << 4)
368 #define X509_FLAG_NO_VALIDITY (1L << 5)
369 #define X509_FLAG_NO_SUBJECT (1L << 6)
370 #define X509_FLAG_NO_PUBKEY (1L << 7)
371 #define X509_FLAG_NO_EXTENSIONS (1L << 8)
372 #define X509_FLAG_NO_SIGDUMP (1L << 9)
373 #define X509_FLAG_NO_AUX (1L << 10)
374 #define X509_FLAG_NO_ATTRIBUTES (1L << 11)
380 #define XN_FLAG_SEP_MASK (0xf << 16)
382 #define XN_FLAG_COMPAT 0
383 #define XN_FLAG_SEP_COMMA_PLUS (1 << 16)
384 #define XN_FLAG_SEP_CPLUS_SPC (2 << 16)
385 #define XN_FLAG_SEP_SPLUS_SPC (3 << 16)
386 #define XN_FLAG_SEP_MULTILINE (4 << 16)
388 #define XN_FLAG_DN_REV (1 << 20)
392 #define XN_FLAG_FN_MASK (0x3 << 21)
394 #define XN_FLAG_FN_SN 0
395 #define XN_FLAG_FN_LN (1 << 21)
396 #define XN_FLAG_FN_OID (2 << 21)
397 #define XN_FLAG_FN_NONE (3 << 21)
399 #define XN_FLAG_SPC_EQ (1 << 23)
405 #define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
407 #define XN_FLAG_FN_ALIGN (1 << 25)
411 #define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \
412 XN_FLAG_SEP_COMMA_PLUS | \
415 XN_FLAG_DUMP_UNKNOWN_FIELDS)
419 #define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
420 ASN1_STRFLGS_ESC_QUOTE | \
421 XN_FLAG_SEP_CPLUS_SPC | \
427 #define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \
428 ASN1_STRFLGS_ESC_MSB | \
429 XN_FLAG_SEP_MULTILINE | \
478 #ifndef OPENSSL_NO_SHA
510 #ifndef OPENSSL_NO_EVP
586 #define PKCS8_NO_OCTET 1
587 #define PKCS8_EMBEDDED_PARAM 2
588 #define PKCS8_NS_DB 3
589 #define PKCS8_NEG_PRIVKEY 4
607 #define X509_EXT_PACK_UNKNOWN 1
608 #define X509_EXT_PACK_STRING 2
610 #define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version)
612 #define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore)
613 #define X509_get_notAfter(x) ((x)->cert_info->validity->notAfter)
614 #define X509_extract_key(x) X509_get_pubkey(x)
615 #define X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version)
616 #define X509_REQ_get_subject_name(x) ((x)->req_info->subject)
617 #define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a)
618 #define X509_name_cmp(a,b) X509_NAME_cmp((a),(b))
619 #define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm))
621 #define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version)
622 #define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate)
623 #define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate)
624 #define X509_CRL_get_issuer(x) ((x)->crl->issuer)
625 #define X509_CRL_get_REVOKED(x) ((x)->crl->revoked)
641 #define X509_get_X509_PUBKEY(x) ((x)->cert_info->key)
646 #ifndef OPENSSL_NO_EVP
672 unsigned char *md,
unsigned int *
len);
674 unsigned char *md,
unsigned int *
len);
676 unsigned char *md,
unsigned int *
len);
678 unsigned char *md,
unsigned int *
len);
680 unsigned char *md,
unsigned int *
len);
683 #ifndef OPENSSL_NO_FP_API
690 #ifndef OPENSSL_NO_RSA
698 #ifndef OPENSSL_NO_DSA
704 #ifndef OPENSSL_NO_EC
722 #ifndef OPENSSL_NO_BIO
729 #ifndef OPENSSL_NO_RSA
737 #ifndef OPENSSL_NO_DSA
743 #ifndef OPENSSL_NO_EC
779 int offset_day,
long offset_sec, time_t *
t);
805 #ifndef OPENSSL_NO_RSA
810 #ifndef OPENSSL_NO_DSA
815 #ifndef OPENSSL_NO_EC
880 #ifndef OPENSSL_NO_EVP
889 unsigned char *md,
unsigned int *len);
896 unsigned char *md,
unsigned int *len);
944 const unsigned char *
bytes,
int len);
947 const unsigned char *
bytes,
int len);
950 const unsigned char *
bytes,
int len);
974 #ifndef OPENSSL_NO_MD5
979 int X509_cmp(
const X509 *a,
const X509 *
b);
986 #ifndef OPENSSL_NO_FP_API
994 #ifndef OPENSSL_NO_BIO
1022 unsigned char *
bytes,
int len,
int loc,
int set);
1024 unsigned char *
bytes,
int len,
int loc,
int set);
1026 const char *field,
int type,
const unsigned char *
bytes,
int len);
1028 int type,
unsigned char *
bytes,
int len);
1030 const unsigned char *
bytes,
int len,
int loc,
int set);
1037 const unsigned char *
bytes,
int len);
1043 int nid,
int lastpos);
1047 int crit,
int lastpos);
1062 unsigned long flags);
1073 unsigned long flags);
1084 unsigned long flags);
1109 const unsigned char *
bytes,
int len);
1112 const unsigned char *
bytes,
int len);
1115 const unsigned char *
bytes,
int len);
1119 int atrtype,
const void *
data,
int len);
1123 const char *atrname,
int type,
const unsigned char *
bytes,
int len);
1127 int atrtype,
void *
data);
1142 const unsigned char *
bytes,
int len);
1145 const unsigned char *
bytes,
int len);
1148 const unsigned char *
bytes,
int len);
1162 const
unsigned char *salt,
int saltlen);
1165 const
unsigned char *salt,
int saltlen);
1167 unsigned char *salt,
int saltlen);
1169 unsigned char *salt,
int saltlen,
1170 unsigned char *aiv,
int prf_nid);
1173 int prf_nid,
int keylen);
1185 int version,
int ptype,
void *pval,
1186 unsigned char *penc,
int penclen);
1188 const
unsigned char **pk,
int *ppklen,
1193 int ptype,
void *pval,
1194 unsigned char *penc,
int penclen);
1196 const
unsigned char **pk,
int *ppklen,
1205 char *name,
int arg1,
void *arg2);
1220 #define X509_F_ADD_CERT_DIR 100
1221 #define X509_F_BY_FILE_CTRL 101
1222 #define X509_F_CHECK_POLICY 145
1223 #define X509_F_DIR_CTRL 102
1224 #define X509_F_GET_CERT_BY_SUBJECT 103
1225 #define X509_F_NETSCAPE_SPKI_B64_DECODE 129
1226 #define X509_F_NETSCAPE_SPKI_B64_ENCODE 130
1227 #define X509_F_X509AT_ADD1_ATTR 135
1228 #define X509_F_X509V3_ADD_EXT 104
1229 #define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 136
1230 #define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 137
1231 #define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 140
1232 #define X509_F_X509_ATTRIBUTE_GET0_DATA 139
1233 #define X509_F_X509_ATTRIBUTE_SET1_DATA 138
1234 #define X509_F_X509_CHECK_PRIVATE_KEY 128
1235 #define X509_F_X509_CRL_PRINT_FP 147
1236 #define X509_F_X509_EXTENSION_CREATE_BY_NID 108
1237 #define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109
1238 #define X509_F_X509_GET_PUBKEY_PARAMETERS 110
1239 #define X509_F_X509_LOAD_CERT_CRL_FILE 132
1240 #define X509_F_X509_LOAD_CERT_FILE 111
1241 #define X509_F_X509_LOAD_CRL_FILE 112
1242 #define X509_F_X509_NAME_ADD_ENTRY 113
1243 #define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114
1244 #define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131
1245 #define X509_F_X509_NAME_ENTRY_SET_OBJECT 115
1246 #define X509_F_X509_NAME_ONELINE 116
1247 #define X509_F_X509_NAME_PRINT 117
1248 #define X509_F_X509_PRINT_EX_FP 118
1249 #define X509_F_X509_PUBKEY_GET 119
1250 #define X509_F_X509_PUBKEY_SET 120
1251 #define X509_F_X509_REQ_CHECK_PRIVATE_KEY 144
1252 #define X509_F_X509_REQ_PRINT_EX 121
1253 #define X509_F_X509_REQ_PRINT_FP 122
1254 #define X509_F_X509_REQ_TO_X509 123
1255 #define X509_F_X509_STORE_ADD_CERT 124
1256 #define X509_F_X509_STORE_ADD_CRL 125
1257 #define X509_F_X509_STORE_CTX_GET1_ISSUER 146
1258 #define X509_F_X509_STORE_CTX_INIT 143
1259 #define X509_F_X509_STORE_CTX_NEW 142
1260 #define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134
1261 #define X509_F_X509_TO_X509_REQ 126
1262 #define X509_F_X509_TRUST_ADD 133
1263 #define X509_F_X509_TRUST_SET 141
1264 #define X509_F_X509_VERIFY_CERT 127
1267 #define X509_R_BAD_X509_FILETYPE 100
1268 #define X509_R_BASE64_DECODE_ERROR 118
1269 #define X509_R_CANT_CHECK_DH_KEY 114
1270 #define X509_R_CERT_ALREADY_IN_HASH_TABLE 101
1271 #define X509_R_ERR_ASN1_LIB 102
1272 #define X509_R_INVALID_DIRECTORY 113
1273 #define X509_R_INVALID_FIELD_NAME 119
1274 #define X509_R_INVALID_TRUST 123
1275 #define X509_R_KEY_TYPE_MISMATCH 115
1276 #define X509_R_KEY_VALUES_MISMATCH 116
1277 #define X509_R_LOADING_CERT_DIR 103
1278 #define X509_R_LOADING_DEFAULTS 104
1279 #define X509_R_METHOD_NOT_SUPPORTED 124
1280 #define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105
1281 #define X509_R_PUBLIC_KEY_DECODE_ERROR 125
1282 #define X509_R_PUBLIC_KEY_ENCODE_ERROR 126
1283 #define X509_R_SHOULD_RETRY 106
1284 #define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107
1285 #define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108
1286 #define X509_R_UNKNOWN_KEY_TYPE 117
1287 #define X509_R_UNKNOWN_NID 109
1288 #define X509_R_UNKNOWN_PURPOSE_ID 121
1289 #define X509_R_UNKNOWN_TRUST_ID 120
1290 #define X509_R_UNSUPPORTED_ALGORITHM 111
1291 #define X509_R_WRONG_LOOKUP_TYPE 112
1292 #define X509_R_WRONG_TYPE 122