15 enum x509_name_attr_type {
16 X509_NAME_ATTR_NOT_USED,
28 #define X509_MAX_NAME_ATTRIBUTES 20
46 enum { X509_CERT_V1 = 0, X509_CERT_V2 = 1, X509_CERT_V3 = 2 } version;
47 unsigned long serial_number;
55 size_t public_key_len;
58 size_t sign_value_len;
61 unsigned int extensions_present;
62 #define X509_EXT_BASIC_CONSTRAINTS (1 << 0)
63 #define X509_EXT_PATH_LEN_CONSTRAINT (1 << 1)
64 #define X509_EXT_KEY_USAGE (1 << 2)
65 #define X509_EXT_SUBJECT_ALT_NAME (1 << 3)
66 #define X509_EXT_ISSUER_ALT_NAME (1 << 4)
70 unsigned long path_len_constraint;
73 unsigned long key_usage;
74 #define X509_KEY_USAGE_DIGITAL_SIGNATURE (1 << 0)
75 #define X509_KEY_USAGE_NON_REPUDIATION (1 << 1)
76 #define X509_KEY_USAGE_KEY_ENCIPHERMENT (1 << 2)
77 #define X509_KEY_USAGE_DATA_ENCIPHERMENT (1 << 3)
78 #define X509_KEY_USAGE_KEY_AGREEMENT (1 << 4)
79 #define X509_KEY_USAGE_KEY_CERT_SIGN (1 << 5)
80 #define X509_KEY_USAGE_CRL_SIGN (1 << 6)
81 #define X509_KEY_USAGE_ENCIPHER_ONLY (1 << 7)
82 #define X509_KEY_USAGE_DECIPHER_ONLY (1 << 8)
90 const u8 *tbs_cert_start;
96 X509_VALIDATE_BAD_CERTIFICATE,
97 X509_VALIDATE_UNSUPPORTED_CERTIFICATE,
98 X509_VALIDATE_CERTIFICATE_REVOKED,
99 X509_VALIDATE_CERTIFICATE_EXPIRED,
100 X509_VALIDATE_CERTIFICATE_UNKNOWN,
101 X509_VALIDATE_UNKNOWN_CA
113 int *reason,
int disable_time_checks);
struct x509_certificate * x509_certificate_parse(const u8 *buf, size_t len)
Parse a X.509 certificate in DER format.
Definition: x509v3.c:1472
void x509_name_string(struct x509_name *name, char *buf, size_t len)
Convert an X.509 certificate name into a string.
Definition: x509v3.c:495
int x509_certificate_check_signature(struct x509_certificate *issuer, struct x509_certificate *cert)
Verify certificate signature.
Definition: x509v3.c:1578
void x509_certificate_chain_free(struct x509_certificate *cert)
Free an X.509 certificate chain.
Definition: x509v3.c:62
void x509_certificate_free(struct x509_certificate *cert)
Free an X.509 certificate.
Definition: x509v3.c:41
int x509_certificate_self_signed(struct x509_certificate *cert)
Is the certificate self-signed?
Definition: x509v3.c:1983
int x509_name_compare(struct x509_name *a, struct x509_name *b)
Compare X.509 certificate names.
Definition: x509v3.c:143
int x509_certificate_chain_validate(struct x509_certificate *trusted, struct x509_certificate *chain, int *reason, int disable_time_checks)
Validate X.509 certificate chain.
Definition: x509v3.c:1835
struct x509_certificate * x509_certificate_get_subject(struct x509_certificate *chain, struct x509_name *name)
Get a certificate based on Subject name.
Definition: x509v3.c:1965