|
PolarSSL v1.3.9
|
The X.509 module provides X.509 support which includes: More...
Data Structures | |
| struct | _x509_time |
| Container for date and time (precision in seconds). More... | |
| struct | _x509_crl_entry |
| Certificate revocation list entry. More... | |
| struct | _x509_crl |
| Certificate revocation list structure. More... | |
| struct | _x509_crt |
| Container for an X.509 certificate. More... | |
| struct | _x509write_cert |
| Container for writing a certificate (CRT) More... | |
| struct | _x509_csr |
| Certificate Signing Request (CSR) structure. More... | |
| struct | _x509write_csr |
| Container for writing a CSR. More... | |
Functions | |
| int | dhm_parse_dhm (dhm_context *dhm, const unsigned char *dhmin, size_t dhminlen) |
| Parse DHM parameters. | |
| int | dhm_parse_dhmfile (dhm_context *dhm, const char *path) |
| Load and parse DHM parameters. | |
| int | x509_dn_gets (char *buf, size_t size, const x509_name *dn) |
| Store the certificate DN in printable form into buf; no more than size characters will be written. | |
| int | x509_serial_gets (char *buf, size_t size, const x509_buf *serial) |
| Store the certificate serial in printable form into buf; no more than size characters will be written. | |
| const char * | x509_oid_get_description (x509_buf *oid) |
| Give an known OID, return its descriptive string. | |
| int | x509_oid_get_numeric_string (char *buf, size_t size, x509_buf *oid) |
| Give an OID, return a string version of its OID number. | |
| int | x509_time_expired (const x509_time *time) |
| Check a given x509_time against the system time and check if it is not expired. | |
| int | x509_time_future (const x509_time *time) |
| Check a given x509_time against the system time and check if it is not from the future. | |
| int | x509_self_test (int verbose) |
| Checkup routine. | |
| int | x509_get_name (unsigned char **p, const unsigned char *end, x509_name *cur) |
| int | x509_get_alg_null (unsigned char **p, const unsigned char *end, x509_buf *alg) |
| int | x509_get_alg (unsigned char **p, const unsigned char *end, x509_buf *alg, x509_buf *params) |
| int | x509_get_rsassa_pss_params (const x509_buf *params, md_type_t *md_alg, md_type_t *mgf_md, int *salt_len) |
| int | x509_get_sig (unsigned char **p, const unsigned char *end, x509_buf *sig) |
| int | x509_get_sig_alg (const x509_buf *sig_oid, const x509_buf *sig_params, md_type_t *md_alg, pk_type_t *pk_alg, void **sig_opts) |
| int | x509_get_time (unsigned char **p, const unsigned char *end, x509_time *time) |
| int | x509_get_serial (unsigned char **p, const unsigned char *end, x509_buf *serial) |
| int | x509_get_ext (unsigned char **p, const unsigned char *end, x509_buf *ext, int tag) |
| int | x509_load_file (const char *path, unsigned char **buf, size_t *n) |
| int | x509_sig_alg_gets (char *buf, size_t size, const x509_buf *sig_oid, pk_type_t pk_alg, md_type_t md_alg, const void *sig_opts) |
| int | x509_key_size_helper (char *buf, size_t size, const char *name) |
| int | x509_string_to_names (asn1_named_data **head, const char *name) |
| int | x509_set_extension (asn1_named_data **head, const char *oid, size_t oid_len, int critical, const unsigned char *val, size_t val_len) |
| int | x509_write_extensions (unsigned char **p, unsigned char *start, asn1_named_data *first) |
| int | x509_write_names (unsigned char **p, unsigned char *start, asn1_named_data *first) |
| int | x509_write_sig (unsigned char **p, unsigned char *start, const char *oid, size_t oid_len, unsigned char *sig, size_t size) |
Variables | |
| int | _x509_time::year |
| int | _x509_time::mon |
| int | _x509_time::day |
| Date. | |
| int | _x509_time::hour |
| int | _x509_time::min |
| int | _x509_time::sec |
| Time. | |
| x509_buf | _x509_crl_entry::raw |
| x509_buf | _x509_crl_entry::serial |
| x509_time | _x509_crl_entry::revocation_date |
| x509_buf | _x509_crl_entry::entry_ext |
| struct _x509_crl_entry * | _x509_crl_entry::next |
| x509_buf | _x509_crl::raw |
| The raw certificate data (DER). | |
| x509_buf | _x509_crl::tbs |
| The raw certificate body (DER). | |
| int | _x509_crl::version |
| CRL version (1=v1, 2=v2) | |
| x509_buf | _x509_crl::sig_oid1 |
| x509_buf | _x509_crl::issuer_raw |
| The raw issuer data (DER). | |
| x509_name | _x509_crl::issuer |
| The parsed issuer data (named information object). | |
| x509_time | _x509_crl::this_update |
| x509_time | _x509_crl::next_update |
| x509_crl_entry | _x509_crl::entry |
| The CRL entries containing the certificate revocation times for this CA. | |
| x509_buf | _x509_crl::crl_ext |
| x509_buf | _x509_crl::sig_oid2 |
| x509_buf | _x509_crl::sig |
| md_type_t | _x509_crl::sig_md |
| Internal representation of the MD algorithm of the signature algorithm, e.g. | |
| pk_type_t | _x509_crl::sig_pk |
| Internal representation of the Public Key algorithm of the signature algorithm, e.g. | |
| void * | _x509_crl::sig_opts |
| Signature options to be passed to pk_verify_ext(), e.g. | |
| struct _x509_crl * | _x509_crl::next |
| x509_buf | _x509_crt::raw |
| The raw certificate data (DER). | |
| x509_buf | _x509_crt::tbs |
| The raw certificate body (DER). | |
| int | _x509_crt::version |
| The X.509 version. | |
| x509_buf | _x509_crt::serial |
| Unique id for certificate issued by a specific CA. | |
| x509_buf | _x509_crt::sig_oid1 |
| Signature algorithm, e.g. | |
| x509_buf | _x509_crt::issuer_raw |
| The raw issuer data (DER). | |
| x509_buf | _x509_crt::subject_raw |
| The raw subject data (DER). | |
| x509_name | _x509_crt::issuer |
| The parsed issuer data (named information object). | |
| x509_name | _x509_crt::subject |
| The parsed subject data (named information object). | |
| x509_time | _x509_crt::valid_from |
| Start time of certificate validity. | |
| x509_time | _x509_crt::valid_to |
| End time of certificate validity. | |
| pk_context | _x509_crt::pk |
| Container for the public key context. | |
| x509_buf | _x509_crt::issuer_id |
| Optional X.509 v2/v3 issuer unique identifier. | |
| x509_buf | _x509_crt::subject_id |
| Optional X.509 v2/v3 subject unique identifier. | |
| x509_buf | _x509_crt::v3_ext |
| Optional X.509 v3 extensions. | |
| x509_sequence | _x509_crt::subject_alt_names |
| Optional list of Subject Alternative Names (Only dNSName supported). | |
| int | _x509_crt::ext_types |
| Bit string containing detected and parsed extensions. | |
| int | _x509_crt::ca_istrue |
| Optional Basic Constraint extension value: 1 if this certificate belongs to a CA, 0 otherwise. | |
| int | _x509_crt::max_pathlen |
| Optional Basic Constraint extension value: The maximum path length to the root certificate. | |
| unsigned char | _x509_crt::key_usage |
| Optional key usage extension value: See the values in x509.h. | |
| x509_sequence | _x509_crt::ext_key_usage |
| Optional list of extended key usage OIDs. | |
| unsigned char | _x509_crt::ns_cert_type |
| Optional Netscape certificate type extension value: See the values in x509.h. | |
| x509_buf | _x509_crt::sig_oid2 |
| Signature algorithm. | |
| x509_buf | _x509_crt::sig |
| Signature: hash of the tbs part signed with the private key. | |
| md_type_t | _x509_crt::sig_md |
| Internal representation of the MD algorithm of the signature algorithm, e.g. | |
| pk_type_t | _x509_crt::sig_pk |
| Internal representation of the Public Key algorithm of the signature algorithm, e.g. | |
| void * | _x509_crt::sig_opts |
| Signature options to be passed to pk_verify_ext(), e.g. | |
| struct _x509_crt * | _x509_crt::next |
| Next certificate in the CA-chain. | |
| int | _x509write_cert::version |
| mpi | _x509write_cert::serial |
| pk_context * | _x509write_cert::subject_key |
| pk_context * | _x509write_cert::issuer_key |
| asn1_named_data * | _x509write_cert::subject |
| asn1_named_data * | _x509write_cert::issuer |
| md_type_t | _x509write_cert::md_alg |
| char | _x509write_cert::not_before [X509_RFC5280_UTC_TIME_LEN+1] |
| char | _x509write_cert::not_after [X509_RFC5280_UTC_TIME_LEN+1] |
| asn1_named_data * | _x509write_cert::extensions |
| x509_buf | _x509_csr::raw |
| The raw CSR data (DER). | |
| x509_buf | _x509_csr::cri |
| The raw CertificateRequestInfo body (DER). | |
| int | _x509_csr::version |
| CSR version (1=v1). | |
| x509_buf | _x509_csr::subject_raw |
| The raw subject data (DER). | |
| x509_name | _x509_csr::subject |
| The parsed subject data (named information object). | |
| pk_context | _x509_csr::pk |
| Container for the public key context. | |
| x509_buf | _x509_csr::sig_oid |
| x509_buf | _x509_csr::sig |
| md_type_t | _x509_csr::sig_md |
| Internal representation of the MD algorithm of the signature algorithm, e.g. | |
| pk_type_t | _x509_csr::sig_pk |
| Internal representation of the Public Key algorithm of the signature algorithm, e.g. | |
| void * | _x509_csr::sig_opts |
| Signature options to be passed to pk_verify_ext(), e.g. | |
| pk_context * | _x509write_csr::key |
| asn1_named_data * | _x509write_csr::subject |
| md_type_t | _x509write_csr::md_alg |
| asn1_named_data * | _x509write_csr::extensions |
Structures for parsing X.509 certificates, CRLs and CSRs | |
| typedef asn1_buf | x509_buf |
| Type-length-value structure that allows for ASN1 using DER. | |
| typedef asn1_bitstring | x509_bitstring |
| Container for ASN1 bit strings. | |
| typedef asn1_named_data | x509_name |
| Container for ASN1 named information objects. | |
| typedef asn1_sequence | x509_sequence |
| Container for a sequence of ASN.1 items. | |
| typedef struct _x509_time | x509_time |
| Container for date and time (precision in seconds). | |
Structures and functions for parsing CRLs | |
| typedef struct _x509_crl_entry | x509_crl_entry |
| Certificate revocation list entry. | |
| typedef struct _x509_crl | x509_crl |
| Certificate revocation list structure. | |
| int | x509_crl_parse (x509_crl *chain, const unsigned char *buf, size_t buflen) |
| Parse one or more CRLs and add them to the chained list. | |
| int | x509_crl_parse_file (x509_crl *chain, const char *path) |
| Load one or more CRLs and add them to the chained list. | |
| int | x509_crl_info (char *buf, size_t size, const char *prefix, const x509_crl *crl) |
| Returns an informational string about the CRL. | |
| void | x509_crl_init (x509_crl *crl) |
| Initialize a CRL (chain) | |
| void | x509_crl_free (x509_crl *crl) |
| Unallocate all CRL data. | |
Structures and functions for parsing and writing X.509 certificates | |
| typedef struct _x509_crt | x509_crt |
| Container for an X.509 certificate. | |
| typedef struct _x509write_cert | x509write_cert |
| Container for writing a certificate (CRT) | |
| int | x509_crt_parse_der (x509_crt *chain, const unsigned char *buf, size_t buflen) |
| Parse a single DER formatted certificate and add it to the chained list. | |
| int | x509_crt_parse (x509_crt *chain, const unsigned char *buf, size_t buflen) |
| Parse one or more certificates and add them to the chained list. | |
| int | x509_crt_parse_file (x509_crt *chain, const char *path) |
| Load one or more certificates and add them to the chained list. | |
| int | x509_crt_parse_path (x509_crt *chain, const char *path) |
| Load one or more certificate files from a path and add them to the chained list. | |
| int | x509_crt_info (char *buf, size_t size, const char *prefix, const x509_crt *crt) |
| Returns an informational string about the certificate. | |
| int | x509_crt_verify (x509_crt *crt, x509_crt *trust_ca, x509_crl *ca_crl, const char *cn, int *flags, int(*f_vrfy)(void *, x509_crt *, int, int *), void *p_vrfy) |
| Verify the certificate signature. | |
| int | x509_crt_check_key_usage (const x509_crt *crt, int usage) |
| Check usage of certificate against keyUsage extension. | |
| int | x509_crt_check_extended_key_usage (const x509_crt *crt, const char *usage_oid, size_t usage_len) |
| Check usage of certificate against extentedJeyUsage. | |
| int | x509_crt_revoked (const x509_crt *crt, const x509_crl *crl) |
| Verify the certificate revocation status. | |
| void | x509_crt_init (x509_crt *crt) |
| Initialize a certificate (chain) | |
| void | x509_crt_free (x509_crt *crt) |
| Unallocate all certificate data. | |
| void | x509write_crt_init (x509write_cert *ctx) |
| Initialize a CRT writing context. | |
| void | x509write_crt_set_version (x509write_cert *ctx, int version) |
| Set the verion for a Certificate Default: X509_CRT_VERSION_3. | |
| int | x509write_crt_set_serial (x509write_cert *ctx, const mpi *serial) |
| Set the serial number for a Certificate. | |
| int | x509write_crt_set_validity (x509write_cert *ctx, const char *not_before, const char *not_after) |
| Set the validity period for a Certificate Timestamps should be in string format for UTC timezone i.e. | |
| int | x509write_crt_set_issuer_name (x509write_cert *ctx, const char *issuer_name) |
| Set the issuer name for a Certificate Issuer names should contain a comma-separated list of OID types and values: e.g. | |
| int | x509write_crt_set_subject_name (x509write_cert *ctx, const char *subject_name) |
| Set the subject name for a Certificate Subject names should contain a comma-separated list of OID types and values: e.g. | |
| void | x509write_crt_set_subject_key (x509write_cert *ctx, pk_context *key) |
| Set the subject public key for the certificate. | |
| void | x509write_crt_set_issuer_key (x509write_cert *ctx, pk_context *key) |
| Set the issuer key used for signing the certificate. | |
| void | x509write_crt_set_md_alg (x509write_cert *ctx, md_type_t md_alg) |
| Set the MD algorithm to use for the signature (e.g. | |
| int | x509write_crt_set_extension (x509write_cert *ctx, const char *oid, size_t oid_len, int critical, const unsigned char *val, size_t val_len) |
| Generic function to add to or replace an extension in the CRT. | |
| int | x509write_crt_set_basic_constraints (x509write_cert *ctx, int is_ca, int max_pathlen) |
| Set the basicConstraints extension for a CRT. | |
| int | x509write_crt_set_subject_key_identifier (x509write_cert *ctx) |
| Set the subjectKeyIdentifier extension for a CRT Requires that x509write_crt_set_subject_key() has been called before. | |
| int | x509write_crt_set_authority_key_identifier (x509write_cert *ctx) |
| Set the authorityKeyIdentifier extension for a CRT Requires that x509write_crt_set_issuer_key() has been called before. | |
| int | x509write_crt_set_key_usage (x509write_cert *ctx, unsigned char key_usage) |
| Set the Key Usage Extension flags (e.g. | |
| int | x509write_crt_set_ns_cert_type (x509write_cert *ctx, unsigned char ns_cert_type) |
| Set the Netscape Cert Type flags (e.g. | |
| void | x509write_crt_free (x509write_cert *ctx) |
| Free the contents of a CRT write context. | |
| int | x509write_crt_der (x509write_cert *ctx, unsigned char *buf, size_t size, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng) |
| Write a built up certificate to a X509 DER structure Note: data is written at the end of the buffer! Use the return value to determine where you should start using the buffer. | |
| int | x509write_crt_pem (x509write_cert *ctx, unsigned char *buf, size_t size, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng) |
| Write a built up certificate to a X509 PEM string. | |
| #define | X509_CRT_VERSION_1 0 |
| #define | X509_CRT_VERSION_2 1 |
| #define | X509_CRT_VERSION_3 2 |
| #define | X509_RFC5280_MAX_SERIAL_LEN 32 |
| #define | X509_RFC5280_UTC_TIME_LEN 15 |
Structures and functions for X.509 Certificate Signing Requests (CSR) | |
| typedef struct _x509_csr | x509_csr |
| Certificate Signing Request (CSR) structure. | |
| typedef struct _x509write_csr | x509write_csr |
| Container for writing a CSR. | |
| int | x509_csr_parse_der (x509_csr *csr, const unsigned char *buf, size_t buflen) |
| Load a Certificate Signing Request (CSR) in DER format. | |
| int | x509_csr_parse (x509_csr *csr, const unsigned char *buf, size_t buflen) |
| Load a Certificate Signing Request (CSR), DER or PEM format. | |
| int | x509_csr_parse_file (x509_csr *csr, const char *path) |
| Load a Certificate Signing Request (CSR) | |
| int | x509_csr_info (char *buf, size_t size, const char *prefix, const x509_csr *csr) |
| Returns an informational string about the CSR. | |
| void | x509_csr_init (x509_csr *csr) |
| Initialize a CSR. | |
| void | x509_csr_free (x509_csr *csr) |
| Unallocate all CSR data. | |
| void | x509write_csr_init (x509write_csr *ctx) |
| Initialize a CSR context. | |
| int | x509write_csr_set_subject_name (x509write_csr *ctx, const char *subject_name) |
| Set the subject name for a CSR Subject names should contain a comma-separated list of OID types and values: e.g. | |
| void | x509write_csr_set_key (x509write_csr *ctx, pk_context *key) |
| Set the key for a CSR (public key will be included, private key used to sign the CSR when writing it) | |
| void | x509write_csr_set_md_alg (x509write_csr *ctx, md_type_t md_alg) |
| Set the MD algorithm to use for the signature (e.g. | |
| int | x509write_csr_set_key_usage (x509write_csr *ctx, unsigned char key_usage) |
| Set the Key Usage Extension flags (e.g. | |
| int | x509write_csr_set_ns_cert_type (x509write_csr *ctx, unsigned char ns_cert_type) |
| Set the Netscape Cert Type flags (e.g. | |
| int | x509write_csr_set_extension (x509write_csr *ctx, const char *oid, size_t oid_len, const unsigned char *val, size_t val_len) |
| Generic function to add to or replace an extension in the CSR. | |
| void | x509write_csr_free (x509write_csr *ctx) |
| Free the contents of a CSR context. | |
| int | x509write_csr_der (x509write_csr *ctx, unsigned char *buf, size_t size, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng) |
| Write a CSR (Certificate Signing Request) to a DER structure Note: data is written at the end of the buffer! Use the return value to determine where you should start using the buffer. | |
| int | x509write_csr_pem (x509write_csr *ctx, unsigned char *buf, size_t size, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng) |
| Write a CSR (Certificate Signing Request) to a PEM string. | |
X509 Error codes | |
| #define | POLARSSL_ERR_X509_FEATURE_UNAVAILABLE -0x2080 |
| Unavailable feature, e.g. | |
| #define | POLARSSL_ERR_X509_UNKNOWN_OID -0x2100 |
| Requested OID is unknown. | |
| #define | POLARSSL_ERR_X509_INVALID_FORMAT -0x2180 |
| The CRT/CRL/CSR format is invalid, e.g. | |
| #define | POLARSSL_ERR_X509_INVALID_VERSION -0x2200 |
| The CRT/CRL/CSR version element is invalid. | |
| #define | POLARSSL_ERR_X509_INVALID_SERIAL -0x2280 |
| The serial tag or value is invalid. | |
| #define | POLARSSL_ERR_X509_INVALID_ALG -0x2300 |
| The algorithm tag or value is invalid. | |
| #define | POLARSSL_ERR_X509_INVALID_NAME -0x2380 |
| The name tag or value is invalid. | |
| #define | POLARSSL_ERR_X509_INVALID_DATE -0x2400 |
| The date tag or value is invalid. | |
| #define | POLARSSL_ERR_X509_INVALID_SIGNATURE -0x2480 |
| The signature tag or value invalid. | |
| #define | POLARSSL_ERR_X509_INVALID_EXTENSIONS -0x2500 |
| The extension tag or value is invalid. | |
| #define | POLARSSL_ERR_X509_UNKNOWN_VERSION -0x2580 |
| CRT/CRL/CSR has an unsupported version number. | |
| #define | POLARSSL_ERR_X509_UNKNOWN_SIG_ALG -0x2600 |
| Signature algorithm (oid) is unsupported. | |
| #define | POLARSSL_ERR_X509_SIG_MISMATCH -0x2680 |
| Signature algorithms do not match. | |
| #define | POLARSSL_ERR_X509_CERT_VERIFY_FAILED -0x2700 |
| Certificate verification failed, e.g. | |
| #define | POLARSSL_ERR_X509_CERT_UNKNOWN_FORMAT -0x2780 |
| Format not recognized as DER or PEM. | |
| #define | POLARSSL_ERR_X509_BAD_INPUT_DATA -0x2800 |
| Input invalid. | |
| #define | POLARSSL_ERR_X509_MALLOC_FAILED -0x2880 |
| Allocation of memory failed. | |
| #define | POLARSSL_ERR_X509_FILE_IO_ERROR -0x2900 |
| Read/write of file failed. | |
X509 Verify codes | |
| #define | BADCERT_EXPIRED 0x01 |
| The certificate validity has expired. | |
| #define | BADCERT_REVOKED 0x02 |
| The certificate has been revoked (is on a CRL). | |
| #define | BADCERT_CN_MISMATCH 0x04 |
| The certificate Common Name (CN) does not match with the expected CN. | |
| #define | BADCERT_NOT_TRUSTED 0x08 |
| The certificate is not correctly signed by the trusted CA. | |
| #define | BADCRL_NOT_TRUSTED 0x10 |
| CRL is not correctly signed by the trusted CA. | |
| #define | BADCRL_EXPIRED 0x20 |
| CRL is expired. | |
| #define | BADCERT_MISSING 0x40 |
| Certificate was missing. | |
| #define | BADCERT_SKIP_VERIFY 0x80 |
| Certificate verification was skipped. | |
| #define | BADCERT_OTHER 0x0100 |
| Other reason (can be used by verify callback) | |
| #define | BADCERT_FUTURE 0x0200 |
| The certificate validity starts in the future. | |
| #define | BADCRL_FUTURE 0x0400 |
| The CRL is from the future. | |
| #define | KU_DIGITAL_SIGNATURE (0x80) /* bit 0 */ |
| #define | KU_NON_REPUDIATION (0x40) /* bit 1 */ |
| #define | KU_KEY_ENCIPHERMENT (0x20) /* bit 2 */ |
| #define | KU_DATA_ENCIPHERMENT (0x10) /* bit 3 */ |
| #define | KU_KEY_AGREEMENT (0x08) /* bit 4 */ |
| #define | KU_KEY_CERT_SIGN (0x04) /* bit 5 */ |
| #define | KU_CRL_SIGN (0x02) /* bit 6 */ |
| #define | NS_CERT_TYPE_SSL_CLIENT (0x80) /* bit 0 */ |
| #define | NS_CERT_TYPE_SSL_SERVER (0x40) /* bit 1 */ |
| #define | NS_CERT_TYPE_EMAIL (0x20) /* bit 2 */ |
| #define | NS_CERT_TYPE_OBJECT_SIGNING (0x10) /* bit 3 */ |
| #define | NS_CERT_TYPE_RESERVED (0x08) /* bit 4 */ |
| #define | NS_CERT_TYPE_SSL_CA (0x04) /* bit 5 */ |
| #define | NS_CERT_TYPE_EMAIL_CA (0x02) /* bit 6 */ |
| #define | NS_CERT_TYPE_OBJECT_SIGNING_CA (0x01) /* bit 7 */ |
| #define | EXT_AUTHORITY_KEY_IDENTIFIER (1 << 0) |
| #define | EXT_SUBJECT_KEY_IDENTIFIER (1 << 1) |
| #define | EXT_KEY_USAGE (1 << 2) /* Parsed but not used */ |
| #define | EXT_CERTIFICATE_POLICIES (1 << 3) |
| #define | EXT_POLICY_MAPPINGS (1 << 4) |
| #define | EXT_SUBJECT_ALT_NAME (1 << 5) /* Supported (DNS) */ |
| #define | EXT_ISSUER_ALT_NAME (1 << 6) |
| #define | EXT_SUBJECT_DIRECTORY_ATTRS (1 << 7) |
| #define | EXT_BASIC_CONSTRAINTS (1 << 8) /* Supported */ |
| #define | EXT_NAME_CONSTRAINTS (1 << 9) |
| #define | EXT_POLICY_CONSTRAINTS (1 << 10) |
| #define | EXT_EXTENDED_KEY_USAGE (1 << 11) /* Parsed but not used */ |
| #define | EXT_CRL_DISTRIBUTION_POINTS (1 << 12) |
| #define | EXT_INIHIBIT_ANYPOLICY (1 << 13) |
| #define | EXT_FRESHEST_CRL (1 << 14) |
| #define | EXT_NS_CERT_TYPE (1 << 16) /* Parsed (and then ?) */ |
| #define | X509_FORMAT_DER 1 |
| #define | X509_FORMAT_PEM 2 |
| #define | X509_MAX_DN_NAME_SIZE 256 |
| Maximum value size of a DN entry. | |
The X.509 module provides X.509 support which includes:
x509parse_crt() and x509parse_crtfile()).x509parse_crl() andx509parse_crlfile()).x509parse_key() and x509parse_keyfile()).x509parse_verify())x509write_crt_der() and x509write_csr_der()).This module can be used to build a certificate authority (CA) chain and verify its signature. It is also used to generate Certificate Signing Requests and X509 certificates just as a CA would do.
| #define BADCERT_CN_MISMATCH 0x04 |
| #define BADCERT_EXPIRED 0x01 |
| #define BADCERT_FUTURE 0x0200 |
| #define BADCERT_NOT_TRUSTED 0x08 |
| #define BADCERT_OTHER 0x0100 |
| #define BADCERT_REVOKED 0x02 |
| #define BADCERT_SKIP_VERIFY 0x80 |
| #define BADCRL_NOT_TRUSTED 0x10 |
| #define EXT_EXTENDED_KEY_USAGE (1 << 11) /* Parsed but not used */ |
| #define POLARSSL_ERR_X509_BAD_INPUT_DATA -0x2800 |
| #define POLARSSL_ERR_X509_CERT_UNKNOWN_FORMAT -0x2780 |
| #define POLARSSL_ERR_X509_CERT_VERIFY_FAILED -0x2700 |
| #define POLARSSL_ERR_X509_FEATURE_UNAVAILABLE -0x2080 |
| #define POLARSSL_ERR_X509_FILE_IO_ERROR -0x2900 |
| #define POLARSSL_ERR_X509_INVALID_ALG -0x2300 |
| #define POLARSSL_ERR_X509_INVALID_DATE -0x2400 |
| #define POLARSSL_ERR_X509_INVALID_EXTENSIONS -0x2500 |
| #define POLARSSL_ERR_X509_INVALID_FORMAT -0x2180 |
| #define POLARSSL_ERR_X509_INVALID_NAME -0x2380 |
| #define POLARSSL_ERR_X509_INVALID_SERIAL -0x2280 |
| #define POLARSSL_ERR_X509_INVALID_SIGNATURE -0x2480 |
| #define POLARSSL_ERR_X509_INVALID_VERSION -0x2200 |
| #define POLARSSL_ERR_X509_MALLOC_FAILED -0x2880 |
| #define POLARSSL_ERR_X509_SIG_MISMATCH -0x2680 |
| #define POLARSSL_ERR_X509_UNKNOWN_OID -0x2100 |
| #define POLARSSL_ERR_X509_UNKNOWN_SIG_ALG -0x2600 |
| #define POLARSSL_ERR_X509_UNKNOWN_VERSION -0x2580 |
| #define X509_CRT_VERSION_1 0 |
Definition at line 102 of file x509_crt.h.
| #define X509_CRT_VERSION_2 1 |
Definition at line 103 of file x509_crt.h.
| #define X509_CRT_VERSION_3 2 |
Definition at line 104 of file x509_crt.h.
| #define X509_MAX_DN_NAME_SIZE 256 |
| #define X509_RFC5280_MAX_SERIAL_LEN 32 |
Definition at line 106 of file x509_crt.h.
| #define X509_RFC5280_UTC_TIME_LEN 15 |
Definition at line 107 of file x509_crt.h.
| typedef asn1_bitstring x509_bitstring |
Certificate revocation list structure.
Every CRL may have multiple entries.
| typedef struct _x509_crl_entry x509_crl_entry |
Certificate revocation list entry.
Contains the CA-specific serial numbers and revocation dates.
Container for an X.509 certificate.
The certificate may be chained.
| typedef asn1_named_data x509_name |
| typedef asn1_sequence x509_sequence |
| typedef struct _x509_time x509_time |
Container for date and time (precision in seconds).
| typedef struct _x509write_cert x509write_cert |
Container for writing a certificate (CRT)
| typedef struct _x509write_csr x509write_csr |
Container for writing a CSR.
| int dhm_parse_dhm | ( | dhm_context * | dhm, |
| const unsigned char * | dhmin, | ||
| size_t | dhminlen | ||
| ) |
Parse DHM parameters.
| dhm | DHM context to be initialized |
| dhmin | input buffer |
| dhminlen | size of the buffer |
| int dhm_parse_dhmfile | ( | dhm_context * | dhm, |
| const char * | path | ||
| ) |
Load and parse DHM parameters.
| dhm | DHM context to be initialized |
| path | filename to read the DHM Parameters from |
| void x509_crl_free | ( | x509_crl * | crl | ) |
Unallocate all CRL data.
| crl | CRL chain to free |
| int x509_crl_info | ( | char * | buf, |
| size_t | size, | ||
| const char * | prefix, | ||
| const x509_crl * | crl | ||
| ) |
Returns an informational string about the CRL.
| buf | Buffer to write to |
| size | Maximum size of buffer |
| prefix | A line prefix |
| crl | The X509 CRL to represent |
Referenced by x509parse_crl_info().
| void x509_crl_init | ( | x509_crl * | crl | ) |
Initialize a CRL (chain)
| crl | CRL chain to initialize |
| int x509_crl_parse | ( | x509_crl * | chain, |
| const unsigned char * | buf, | ||
| size_t | buflen | ||
| ) |
Parse one or more CRLs and add them to the chained list.
| chain | points to the start of the chain |
| buf | buffer holding the CRL data |
| buflen | size of the buffer |
Referenced by x509parse_crl().
| int x509_crl_parse_file | ( | x509_crl * | chain, |
| const char * | path | ||
| ) |
Load one or more CRLs and add them to the chained list.
| chain | points to the start of the chain |
| path | filename to read the CRLs from |
Referenced by x509parse_crlfile().
| int x509_crt_check_extended_key_usage | ( | const x509_crt * | crt, |
| const char * | usage_oid, | ||
| size_t | usage_len | ||
| ) |
Check usage of certificate against extentedJeyUsage.
| crt | Leaf certificate used. |
| usage_oid | Intended usage (eg OID_SERVER_AUTH or OID_CLIENT_AUTH). |
| usage_len | Length of usage_oid (eg given by OID_SIZE()). |
| int x509_crt_check_key_usage | ( | const x509_crt * | crt, |
| int | usage | ||
| ) |
Check usage of certificate against keyUsage extension.
| crt | Leaf certificate used. |
| usage | Intended usage(s) (eg KU_KEY_ENCIPHERMENT before using the certificate to perform an RSA key exchange). |
x509_crt_verify(). | void x509_crt_free | ( | x509_crt * | crt | ) |
| int x509_crt_info | ( | char * | buf, |
| size_t | size, | ||
| const char * | prefix, | ||
| const x509_crt * | crt | ||
| ) |
Returns an informational string about the certificate.
| buf | Buffer to write to |
| size | Maximum size of buffer |
| prefix | A line prefix |
| crt | The X509 certificate to represent |
Referenced by x509parse_cert_info().
| void x509_crt_init | ( | x509_crt * | crt | ) |
Initialize a certificate (chain)
| crt | Certificate chain to initialize |
| int x509_crt_parse | ( | x509_crt * | chain, |
| const unsigned char * | buf, | ||
| size_t | buflen | ||
| ) |
Parse one or more certificates and add them to the chained list.
Parses permissively. If some certificates can be parsed, the result is the number of failed certificates it encountered. If none complete correctly, the first error is returned.
| chain | points to the start of the chain |
| buf | buffer holding the certificate data |
| buflen | size of the buffer |
Referenced by x509parse_crt().
| int x509_crt_parse_der | ( | x509_crt * | chain, |
| const unsigned char * | buf, | ||
| size_t | buflen | ||
| ) |
Parse a single DER formatted certificate and add it to the chained list.
| chain | points to the start of the chain |
| buf | buffer holding the certificate DER data |
| buflen | size of the buffer |
Referenced by x509parse_crt_der().
| int x509_crt_parse_file | ( | x509_crt * | chain, |
| const char * | path | ||
| ) |
Load one or more certificates and add them to the chained list.
Parses permissively. If some certificates can be parsed, the result is the number of failed certificates it encountered. If none complete correctly, the first error is returned.
| chain | points to the start of the chain |
| path | filename to read the certificates from |
Referenced by x509parse_crtfile().
| int x509_crt_parse_path | ( | x509_crt * | chain, |
| const char * | path | ||
| ) |
Load one or more certificate files from a path and add them to the chained list.
Parses permissively. If some certificates can be parsed, the result is the number of failed certificates it encountered. If none complete correctly, the first error is returned.
| chain | points to the start of the chain |
| path | directory / folder to read the certificate files from |
Referenced by x509parse_crtpath().
Verify the certificate revocation status.
| crt | a certificate to be verified |
| crl | the CRL to verify against |
Referenced by x509parse_revoked().
| int x509_crt_verify | ( | x509_crt * | crt, |
| x509_crt * | trust_ca, | ||
| x509_crl * | ca_crl, | ||
| const char * | cn, | ||
| int * | flags, | ||
| int(*)(void *, x509_crt *, int, int *) | f_vrfy, | ||
| void * | p_vrfy | ||
| ) |
Verify the certificate signature.
The verify callback is a user-supplied callback that
can clear / modify / add flags for a certificate. If set,
the verification callback is called for each
certificate in the chain (from the trust-ca down to the
presented crt). The parameters for the callback are:
(void *parameter, x509_crt *crt, int certificate_depth,
int *flags). With the flags representing current flags for
that specific certificate and the certificate depth from
the bottom (Peer cert depth = 0).
All flags left after returning from the callback
are also returned to the application. The function should
return 0 for anything but a fatal error.
| crt | a certificate to be verified |
| trust_ca | the trusted CA chain |
| ca_crl | the CRL chain for trusted CA's |
| cn | expected Common Name (can be set to NULL if the CN must not be verified) |
| flags | result of the verification |
| f_vrfy | verification function |
| p_vrfy | verification parameter |
Referenced by x509parse_verify().
| void x509_csr_free | ( | x509_csr * | csr | ) |
Unallocate all CSR data.
| csr | CSR to free |
| int x509_csr_info | ( | char * | buf, |
| size_t | size, | ||
| const char * | prefix, | ||
| const x509_csr * | csr | ||
| ) |
Returns an informational string about the CSR.
| buf | Buffer to write to |
| size | Maximum size of buffer |
| prefix | A line prefix |
| csr | The X509 CSR to represent |
Referenced by x509parse_csr_info().
| void x509_csr_init | ( | x509_csr * | csr | ) |
Initialize a CSR.
| csr | CSR to initialize |
| int x509_csr_parse | ( | x509_csr * | csr, |
| const unsigned char * | buf, | ||
| size_t | buflen | ||
| ) |
Load a Certificate Signing Request (CSR), DER or PEM format.
| csr | CSR context to fill |
| buf | buffer holding the CRL data |
| buflen | size of the buffer |
Referenced by x509parse_csr().
| int x509_csr_parse_der | ( | x509_csr * | csr, |
| const unsigned char * | buf, | ||
| size_t | buflen | ||
| ) |
Load a Certificate Signing Request (CSR) in DER format.
| csr | CSR context to fill |
| buf | buffer holding the CRL data |
| buflen | size of the buffer |
| int x509_csr_parse_file | ( | x509_csr * | csr, |
| const char * | path | ||
| ) |
Load a Certificate Signing Request (CSR)
| csr | CSR context to fill |
| path | filename to read the CSR from |
Referenced by x509parse_csrfile().
| int x509_dn_gets | ( | char * | buf, |
| size_t | size, | ||
| const x509_name * | dn | ||
| ) |
Store the certificate DN in printable form into buf; no more than size characters will be written.
| buf | Buffer to write to |
| size | Maximum size of buffer |
| dn | The X509 name to represent |
Referenced by x509parse_dn_gets().
| int x509_get_alg | ( | unsigned char ** | p, |
| const unsigned char * | end, | ||
| x509_buf * | alg, | ||
| x509_buf * | params | ||
| ) |
| int x509_get_alg_null | ( | unsigned char ** | p, |
| const unsigned char * | end, | ||
| x509_buf * | alg | ||
| ) |
| int x509_get_ext | ( | unsigned char ** | p, |
| const unsigned char * | end, | ||
| x509_buf * | ext, | ||
| int | tag | ||
| ) |
| int x509_get_name | ( | unsigned char ** | p, |
| const unsigned char * | end, | ||
| x509_name * | cur | ||
| ) |
| int x509_get_rsassa_pss_params | ( | const x509_buf * | params, |
| md_type_t * | md_alg, | ||
| md_type_t * | mgf_md, | ||
| int * | salt_len | ||
| ) |
| int x509_get_serial | ( | unsigned char ** | p, |
| const unsigned char * | end, | ||
| x509_buf * | serial | ||
| ) |
| int x509_get_sig | ( | unsigned char ** | p, |
| const unsigned char * | end, | ||
| x509_buf * | sig | ||
| ) |
| int x509_get_sig_alg | ( | const x509_buf * | sig_oid, |
| const x509_buf * | sig_params, | ||
| md_type_t * | md_alg, | ||
| pk_type_t * | pk_alg, | ||
| void ** | sig_opts | ||
| ) |
| int x509_get_time | ( | unsigned char ** | p, |
| const unsigned char * | end, | ||
| x509_time * | time | ||
| ) |
| int x509_key_size_helper | ( | char * | buf, |
| size_t | size, | ||
| const char * | name | ||
| ) |
| int x509_load_file | ( | const char * | path, |
| unsigned char ** | buf, | ||
| size_t * | n | ||
| ) |
| const char * x509_oid_get_description | ( | x509_buf * | oid | ) |
Give an known OID, return its descriptive string.
(Deprecated. Use oid_get_extended_key_usage() instead.) Warning: only works for extended_key_usage OIDs!
| oid | buffer containing the oid |
| int x509_oid_get_numeric_string | ( | char * | buf, |
| size_t | size, | ||
| x509_buf * | oid | ||
| ) |
Give an OID, return a string version of its OID number.
(Deprecated. Use oid_get_numeric_string() instead)
| buf | Buffer to write to |
| size | Maximum size of buffer |
| oid | Buffer containing the OID |
| int x509_self_test | ( | int | verbose | ) |
Checkup routine.
| int x509_serial_gets | ( | char * | buf, |
| size_t | size, | ||
| const x509_buf * | serial | ||
| ) |
Store the certificate serial in printable form into buf; no more than size characters will be written.
| buf | Buffer to write to |
| size | Maximum size of buffer |
| serial | The X509 serial to represent |
Referenced by x509parse_serial_gets().
| int x509_set_extension | ( | asn1_named_data ** | head, |
| const char * | oid, | ||
| size_t | oid_len, | ||
| int | critical, | ||
| const unsigned char * | val, | ||
| size_t | val_len | ||
| ) |
| int x509_sig_alg_gets | ( | char * | buf, |
| size_t | size, | ||
| const x509_buf * | sig_oid, | ||
| pk_type_t | pk_alg, | ||
| md_type_t | md_alg, | ||
| const void * | sig_opts | ||
| ) |
| int x509_string_to_names | ( | asn1_named_data ** | head, |
| const char * | name | ||
| ) |
| int x509_time_expired | ( | const x509_time * | time | ) |
Check a given x509_time against the system time and check if it is not expired.
| time | x509_time to check |
Referenced by x509parse_time_expired().
| int x509_time_future | ( | const x509_time * | time | ) |
Check a given x509_time against the system time and check if it is not from the future.
| time | x509_time to check |
| int x509_write_extensions | ( | unsigned char ** | p, |
| unsigned char * | start, | ||
| asn1_named_data * | first | ||
| ) |
| int x509_write_names | ( | unsigned char ** | p, |
| unsigned char * | start, | ||
| asn1_named_data * | first | ||
| ) |
| int x509_write_sig | ( | unsigned char ** | p, |
| unsigned char * | start, | ||
| const char * | oid, | ||
| size_t | oid_len, | ||
| unsigned char * | sig, | ||
| size_t | size | ||
| ) |
| int x509write_crt_der | ( | x509write_cert * | ctx, |
| unsigned char * | buf, | ||
| size_t | size, | ||
| int(*)(void *, unsigned char *, size_t) | f_rng, | ||
| void * | p_rng | ||
| ) |
Write a built up certificate to a X509 DER structure Note: data is written at the end of the buffer! Use the return value to determine where you should start using the buffer.
| ctx | certificate to write away |
| buf | buffer to write to |
| size | size of the buffer |
| f_rng | RNG function (for signature, see note) |
| p_rng | RNG parameter |
| void x509write_crt_free | ( | x509write_cert * | ctx | ) |
Free the contents of a CRT write context.
| ctx | CRT context to free |
| void x509write_crt_init | ( | x509write_cert * | ctx | ) |
Initialize a CRT writing context.
| ctx | CRT context to initialize |
| int x509write_crt_pem | ( | x509write_cert * | ctx, |
| unsigned char * | buf, | ||
| size_t | size, | ||
| int(*)(void *, unsigned char *, size_t) | f_rng, | ||
| void * | p_rng | ||
| ) |
Write a built up certificate to a X509 PEM string.
| ctx | certificate to write away |
| buf | buffer to write to |
| size | size of the buffer |
| f_rng | RNG function (for signature, see note) |
| p_rng | RNG parameter |
| int x509write_crt_set_authority_key_identifier | ( | x509write_cert * | ctx | ) |
Set the authorityKeyIdentifier extension for a CRT Requires that x509write_crt_set_issuer_key() has been called before.
| ctx | CRT context to use |
| int x509write_crt_set_basic_constraints | ( | x509write_cert * | ctx, |
| int | is_ca, | ||
| int | max_pathlen | ||
| ) |
Set the basicConstraints extension for a CRT.
| ctx | CRT context to use |
| is_ca | is this a CA certificate |
| max_pathlen | maximum length of certificate chains below this certificate (only for CA certificates, -1 is inlimited) |
| int x509write_crt_set_extension | ( | x509write_cert * | ctx, |
| const char * | oid, | ||
| size_t | oid_len, | ||
| int | critical, | ||
| const unsigned char * | val, | ||
| size_t | val_len | ||
| ) |
Generic function to add to or replace an extension in the CRT.
| ctx | CRT context to use |
| oid | OID of the extension |
| oid_len | length of the OID |
| critical | if the extension is critical (per the RFC's definition) |
| val | value of the extension OCTET STRING |
| val_len | length of the value data |
| void x509write_crt_set_issuer_key | ( | x509write_cert * | ctx, |
| pk_context * | key | ||
| ) |
Set the issuer key used for signing the certificate.
| ctx | CRT context to use |
| key | private key to sign with |
| int x509write_crt_set_issuer_name | ( | x509write_cert * | ctx, |
| const char * | issuer_name | ||
| ) |
Set the issuer name for a Certificate Issuer names should contain a comma-separated list of OID types and values: e.g.
"C=NL,O=Offspark,CN=PolarSSL CA"
| ctx | CRT context to use |
| issuer_name | issuer name to set |
| int x509write_crt_set_key_usage | ( | x509write_cert * | ctx, |
| unsigned char | key_usage | ||
| ) |
Set the Key Usage Extension flags (e.g.
KU_DIGITAL_SIGNATURE | KU_KEY_CERT_SIGN)
| ctx | CRT context to use |
| key_usage | key usage flags to set |
| void x509write_crt_set_md_alg | ( | x509write_cert * | ctx, |
| md_type_t | md_alg | ||
| ) |
Set the MD algorithm to use for the signature (e.g.
POLARSSL_MD_SHA1)
| ctx | CRT context to use |
| md_alg | MD algorithm to use |
| int x509write_crt_set_ns_cert_type | ( | x509write_cert * | ctx, |
| unsigned char | ns_cert_type | ||
| ) |
Set the Netscape Cert Type flags (e.g.
NS_CERT_TYPE_SSL_CLIENT | NS_CERT_TYPE_EMAIL)
| ctx | CRT context to use |
| ns_cert_type | Netscape Cert Type flags to set |
| int x509write_crt_set_serial | ( | x509write_cert * | ctx, |
| const mpi * | serial | ||
| ) |
Set the serial number for a Certificate.
| ctx | CRT context to use |
| serial | serial number to set |
| void x509write_crt_set_subject_key | ( | x509write_cert * | ctx, |
| pk_context * | key | ||
| ) |
Set the subject public key for the certificate.
| ctx | CRT context to use |
| key | public key to include |
| int x509write_crt_set_subject_key_identifier | ( | x509write_cert * | ctx | ) |
Set the subjectKeyIdentifier extension for a CRT Requires that x509write_crt_set_subject_key() has been called before.
| ctx | CRT context to use |
| int x509write_crt_set_subject_name | ( | x509write_cert * | ctx, |
| const char * | subject_name | ||
| ) |
Set the subject name for a Certificate Subject names should contain a comma-separated list of OID types and values: e.g.
"C=NL,O=Offspark,CN=PolarSSL Server 1"
| ctx | CRT context to use |
| subject_name | subject name to set |
| int x509write_crt_set_validity | ( | x509write_cert * | ctx, |
| const char * | not_before, | ||
| const char * | not_after | ||
| ) |
Set the validity period for a Certificate Timestamps should be in string format for UTC timezone i.e.
"YYYYMMDDhhmmss" e.g. "20131231235959" for December 31st 2013 at 23:59:59
| ctx | CRT context to use |
| not_before | not_before timestamp |
| not_after | not_after timestamp |
| void x509write_crt_set_version | ( | x509write_cert * | ctx, |
| int | version | ||
| ) |
Set the verion for a Certificate Default: X509_CRT_VERSION_3.
| ctx | CRT context to use |
| version | version to set (X509_CRT_VERSION_1, X509_CRT_VERSION_2 or X509_CRT_VERSION_3) |
| int x509write_csr_der | ( | x509write_csr * | ctx, |
| unsigned char * | buf, | ||
| size_t | size, | ||
| int(*)(void *, unsigned char *, size_t) | f_rng, | ||
| void * | p_rng | ||
| ) |
Write a CSR (Certificate Signing Request) to a DER structure Note: data is written at the end of the buffer! Use the return value to determine where you should start using the buffer.
| ctx | CSR to write away |
| buf | buffer to write to |
| size | size of the buffer |
| f_rng | RNG function (for signature, see note) |
| p_rng | RNG parameter |
| void x509write_csr_free | ( | x509write_csr * | ctx | ) |
Free the contents of a CSR context.
| ctx | CSR context to free |
| void x509write_csr_init | ( | x509write_csr * | ctx | ) |
Initialize a CSR context.
| ctx | CSR context to initialize |
| int x509write_csr_pem | ( | x509write_csr * | ctx, |
| unsigned char * | buf, | ||
| size_t | size, | ||
| int(*)(void *, unsigned char *, size_t) | f_rng, | ||
| void * | p_rng | ||
| ) |
Write a CSR (Certificate Signing Request) to a PEM string.
| ctx | CSR to write away |
| buf | buffer to write to |
| size | size of the buffer |
| f_rng | RNG function (for signature, see note) |
| p_rng | RNG parameter |
| int x509write_csr_set_extension | ( | x509write_csr * | ctx, |
| const char * | oid, | ||
| size_t | oid_len, | ||
| const unsigned char * | val, | ||
| size_t | val_len | ||
| ) |
Generic function to add to or replace an extension in the CSR.
| ctx | CSR context to use |
| oid | OID of the extension |
| oid_len | length of the OID |
| val | value of the extension OCTET STRING |
| val_len | length of the value data |
| void x509write_csr_set_key | ( | x509write_csr * | ctx, |
| pk_context * | key | ||
| ) |
Set the key for a CSR (public key will be included, private key used to sign the CSR when writing it)
| ctx | CSR context to use |
| key | Asymetric key to include |
| int x509write_csr_set_key_usage | ( | x509write_csr * | ctx, |
| unsigned char | key_usage | ||
| ) |
Set the Key Usage Extension flags (e.g.
KU_DIGITAL_SIGNATURE | KU_KEY_CERT_SIGN)
| ctx | CSR context to use |
| key_usage | key usage flags to set |
| void x509write_csr_set_md_alg | ( | x509write_csr * | ctx, |
| md_type_t | md_alg | ||
| ) |
Set the MD algorithm to use for the signature (e.g.
POLARSSL_MD_SHA1)
| ctx | CSR context to use |
| md_alg | MD algorithm to use |
| int x509write_csr_set_ns_cert_type | ( | x509write_csr * | ctx, |
| unsigned char | ns_cert_type | ||
| ) |
Set the Netscape Cert Type flags (e.g.
NS_CERT_TYPE_SSL_CLIENT | NS_CERT_TYPE_EMAIL)
| ctx | CSR context to use |
| ns_cert_type | Netscape Cert Type flags to set |
| int x509write_csr_set_subject_name | ( | x509write_csr * | ctx, |
| const char * | subject_name | ||
| ) |
Set the subject name for a CSR Subject names should contain a comma-separated list of OID types and values: e.g.
"C=NL,O=Offspark,CN=PolarSSL Server 1"
| ctx | CSR context to use |
| subject_name | subject name to set |
| int _x509_crt::ca_istrue |
Optional Basic Constraint extension value: 1 if this certificate belongs to a CA, 0 otherwise.
Definition at line 83 of file x509_crt.h.
| x509_buf _x509_csr::cri |
The raw CertificateRequestInfo body (DER).
Definition at line 57 of file x509_csr.h.
| x509_buf _x509_crl::crl_ext |
Definition at line 90 of file x509_crl.h.
| x509_crl_entry _x509_crl::entry |
The CRL entries containing the certificate revocation times for this CA.
Definition at line 88 of file x509_crl.h.
| x509_buf _x509_crl_entry::entry_ext |
Definition at line 63 of file x509_crl.h.
| x509_sequence _x509_crt::ext_key_usage |
Optional list of extended key usage OIDs.
Definition at line 88 of file x509_crt.h.
| int _x509_crt::ext_types |
Bit string containing detected and parsed extensions.
Definition at line 82 of file x509_crt.h.
| asn1_named_data* _x509write_cert::extensions |
Definition at line 123 of file x509_crt.h.
| asn1_named_data* _x509write_csr::extensions |
Definition at line 82 of file x509_csr.h.
| x509_name _x509_crl::issuer |
The parsed issuer data (named information object).
Definition at line 83 of file x509_crl.h.
| x509_name _x509_crt::issuer |
The parsed issuer data (named information object).
Definition at line 69 of file x509_crt.h.
| asn1_named_data* _x509write_cert::issuer |
Definition at line 119 of file x509_crt.h.
| x509_buf _x509_crt::issuer_id |
Optional X.509 v2/v3 issuer unique identifier.
Definition at line 77 of file x509_crt.h.
| pk_context* _x509write_cert::issuer_key |
Definition at line 117 of file x509_crt.h.
| x509_buf _x509_crl::issuer_raw |
The raw issuer data (DER).
Definition at line 81 of file x509_crl.h.
| x509_buf _x509_crt::issuer_raw |
| pk_context* _x509write_csr::key |
Definition at line 79 of file x509_csr.h.
| unsigned char _x509_crt::key_usage |
Optional key usage extension value: See the values in x509.h.
Definition at line 86 of file x509_crt.h.
| int _x509_crt::max_pathlen |
Optional Basic Constraint extension value: The maximum path length to the root certificate.
Path length is 1 higher than RFC 5280 'meaning', so 1+
Definition at line 84 of file x509_crt.h.
| md_type_t _x509write_cert::md_alg |
Definition at line 120 of file x509_crt.h.
| md_type_t _x509write_csr::md_alg |
Definition at line 81 of file x509_csr.h.
| struct _x509_crl_entry* _x509_crl_entry::next |
Definition at line 65 of file x509_crl.h.
| struct _x509_crl* _x509_crl::next |
Definition at line 98 of file x509_crl.h.
| struct _x509_crt* _x509_crt::next |
Next certificate in the CA-chain.
Definition at line 98 of file x509_crt.h.
| x509_time _x509_crl::next_update |
Definition at line 86 of file x509_crl.h.
| char _x509write_cert::not_after[X509_RFC5280_UTC_TIME_LEN+1] |
Definition at line 122 of file x509_crt.h.
| char _x509write_cert::not_before[X509_RFC5280_UTC_TIME_LEN+1] |
Definition at line 121 of file x509_crt.h.
| unsigned char _x509_crt::ns_cert_type |
Optional Netscape certificate type extension value: See the values in x509.h.
Definition at line 90 of file x509_crt.h.
| pk_context _x509_crt::pk |
Container for the public key context.
Definition at line 75 of file x509_crt.h.
| pk_context _x509_csr::pk |
Container for the public key context.
Definition at line 64 of file x509_csr.h.
| x509_buf _x509_crl_entry::raw |
Definition at line 57 of file x509_crl.h.
| x509_buf _x509_crl::raw |
The raw certificate data (DER).
Definition at line 75 of file x509_crl.h.
| x509_buf _x509_crt::raw |
The raw certificate data (DER).
Definition at line 59 of file x509_crt.h.
| x509_buf _x509_csr::raw |
The raw CSR data (DER).
Definition at line 56 of file x509_csr.h.
| x509_time _x509_crl_entry::revocation_date |
Definition at line 61 of file x509_crl.h.
| x509_buf _x509_crl_entry::serial |
Definition at line 59 of file x509_crl.h.
| x509_buf _x509_crt::serial |
Unique id for certificate issued by a specific CA.
Definition at line 63 of file x509_crt.h.
| mpi _x509write_cert::serial |
Definition at line 115 of file x509_crt.h.
| x509_buf _x509_crl::sig |
Definition at line 93 of file x509_crl.h.
| x509_buf _x509_crt::sig |
Signature: hash of the tbs part signed with the private key.
Definition at line 93 of file x509_crt.h.
| x509_buf _x509_csr::sig |
Definition at line 67 of file x509_csr.h.
| md_type_t _x509_crl::sig_md |
Internal representation of the MD algorithm of the signature algorithm, e.g.
POLARSSL_MD_SHA256
Definition at line 94 of file x509_crl.h.
| md_type_t _x509_crt::sig_md |
Internal representation of the MD algorithm of the signature algorithm, e.g.
POLARSSL_MD_SHA256
Definition at line 94 of file x509_crt.h.
| md_type_t _x509_csr::sig_md |
Internal representation of the MD algorithm of the signature algorithm, e.g.
POLARSSL_MD_SHA256
Definition at line 68 of file x509_csr.h.
| x509_buf _x509_csr::sig_oid |
Definition at line 66 of file x509_csr.h.
| x509_buf _x509_crl::sig_oid1 |
Definition at line 79 of file x509_crl.h.
| x509_buf _x509_crt::sig_oid1 |
| x509_buf _x509_crl::sig_oid2 |
Definition at line 92 of file x509_crl.h.
| x509_buf _x509_crt::sig_oid2 |
| void* _x509_crl::sig_opts |
Signature options to be passed to pk_verify_ext(), e.g.
for RSASSA-PSS
Definition at line 96 of file x509_crl.h.
| void* _x509_crt::sig_opts |
Signature options to be passed to pk_verify_ext(), e.g.
for RSASSA-PSS
Definition at line 96 of file x509_crt.h.
| void* _x509_csr::sig_opts |
Signature options to be passed to pk_verify_ext(), e.g.
for RSASSA-PSS
Definition at line 70 of file x509_csr.h.
| pk_type_t _x509_crl::sig_pk |
Internal representation of the Public Key algorithm of the signature algorithm, e.g.
POLARSSL_PK_RSA
Definition at line 95 of file x509_crl.h.
| pk_type_t _x509_crt::sig_pk |
Internal representation of the Public Key algorithm of the signature algorithm, e.g.
POLARSSL_PK_RSA
Definition at line 95 of file x509_crt.h.
| pk_type_t _x509_csr::sig_pk |
Internal representation of the Public Key algorithm of the signature algorithm, e.g.
POLARSSL_PK_RSA
Definition at line 69 of file x509_csr.h.
| x509_name _x509_crt::subject |
The parsed subject data (named information object).
Definition at line 70 of file x509_crt.h.
| asn1_named_data* _x509write_cert::subject |
Definition at line 118 of file x509_crt.h.
| x509_name _x509_csr::subject |
The parsed subject data (named information object).
Definition at line 62 of file x509_csr.h.
| asn1_named_data* _x509write_csr::subject |
Definition at line 80 of file x509_csr.h.
| x509_sequence _x509_crt::subject_alt_names |
Optional list of Subject Alternative Names (Only dNSName supported).
Definition at line 80 of file x509_crt.h.
| x509_buf _x509_crt::subject_id |
Optional X.509 v2/v3 subject unique identifier.
Definition at line 78 of file x509_crt.h.
| pk_context* _x509write_cert::subject_key |
Definition at line 116 of file x509_crt.h.
| x509_buf _x509_crt::subject_raw |
| x509_buf _x509_csr::subject_raw |
The raw subject data (DER).
Definition at line 61 of file x509_csr.h.
| x509_buf _x509_crl::tbs |
The raw certificate body (DER).
The part that is To Be Signed.
Definition at line 76 of file x509_crl.h.
| x509_buf _x509_crt::tbs |
The raw certificate body (DER).
The part that is To Be Signed.
Definition at line 60 of file x509_crt.h.
| x509_time _x509_crl::this_update |
Definition at line 85 of file x509_crl.h.
| x509_buf _x509_crt::v3_ext |
| x509_time _x509_crt::valid_from |
Start time of certificate validity.
Definition at line 72 of file x509_crt.h.
| x509_time _x509_crt::valid_to |
End time of certificate validity.
Definition at line 73 of file x509_crt.h.
| int _x509_crl::version |
CRL version (1=v1, 2=v2)
Definition at line 78 of file x509_crl.h.
| int _x509_crt::version |
| int _x509write_cert::version |
Definition at line 114 of file x509_crt.h.
| int _x509_csr::version |
CSR version (1=v1).
Definition at line 59 of file x509_csr.h.