mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-07 23:45:18 +00:00
Add public API to query SubjectAltNames and ExtKeyUsage extensions
This commit is contained in:
parent
63e6998dd7
commit
ab6c8ea8bc
2 changed files with 96 additions and 0 deletions
|
|
@ -750,6 +750,56 @@ int mbedtls_x509_crt_get_subject( mbedtls_x509_crt const *crt,
|
|||
int mbedtls_x509_crt_get_issuer( mbedtls_x509_crt const *crt,
|
||||
mbedtls_x509_name **issuer );
|
||||
|
||||
/**
|
||||
* \brief Request the subject alternative name of a CRT, presented
|
||||
* as a dynamically allocated linked list.
|
||||
*
|
||||
* \param crt The CRT to use. This must be initialized and setup.
|
||||
* \param subj_alt The address at which to store the address of the
|
||||
* first component of the subject alternative names list.
|
||||
*
|
||||
* \note Depending in your use case, consider using the raw ASN.1
|
||||
* describing the subject alternative names extension
|
||||
* instead of the heap-allocated linked list generated by this
|
||||
* call. The pointers to the raw ASN.1 data are part of the CRT
|
||||
* frame that can be queried via mbedtls_x509_crt_get_frame(),
|
||||
* and mbedtls_asn1_traverse_sequence_of() can be used to
|
||||
* traverse the list of subject alternative names.
|
||||
*
|
||||
* \return \c 0 on success. In this case, the user takes ownership
|
||||
* of the name context, and is responsible for freeing it
|
||||
* through a call to mbedtls_x509_sequence_free() once it's
|
||||
* no longer needed.
|
||||
* \return A negative error code on failure.
|
||||
*/
|
||||
int mbedtls_x509_crt_get_subject_alt_names( mbedtls_x509_crt const *crt,
|
||||
mbedtls_x509_sequence **subj_alt );
|
||||
|
||||
/**
|
||||
* \brief Request the ExtendedKeyUsage extension of a CRT,
|
||||
* presented as a dynamically allocated linked list.
|
||||
*
|
||||
* \param crt The CRT to use. This must be initialized and setup.
|
||||
* \param ext_key_usage The address at which to store the address of the
|
||||
* first entry of the ExtendedKeyUsage extension.
|
||||
*
|
||||
* \note Depending in your use case, consider using the raw ASN.1
|
||||
* describing the extended key usage extension instead of
|
||||
* the heap-allocated linked list generated by this call.
|
||||
* The pointers to the raw ASN.1 data are part of the CRT
|
||||
* frame that can be queried via mbedtls_x509_crt_get_frame(),
|
||||
* and mbedtls_asn1_traverse_sequence_of() can be used to
|
||||
* traverse the entries in the extended key usage extension.
|
||||
*
|
||||
* \return \c 0 on success. In this case, the user takes ownership
|
||||
* of the name context, and is responsible for freeing it
|
||||
* through a call to mbedtls_x509_sequence_free() once it's
|
||||
* no longer needed.
|
||||
* \return A negative error code on failure.
|
||||
*/
|
||||
int mbedtls_x509_crt_get_ext_key_usage( mbedtls_x509_crt const *crt,
|
||||
mbedtls_x509_sequence **ext_key_usage );
|
||||
|
||||
/**
|
||||
* \brief Flush internal X.509 CRT parsing cache, if present.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue