Function esp_idf_sys::mbedtls_x509_parse_subject_alt_name
source · pub unsafe extern "C" fn mbedtls_x509_parse_subject_alt_name(
san_buf: *const mbedtls_x509_buf,
san: *mut mbedtls_x509_subject_alternative_name,
) -> c_int
Expand description
\brief This function parses an item in the SubjectAlternativeNames extension. Please note that this function might allocate additional memory for a subject alternative name, thus mbedtls_x509_free_subject_alt_name has to be called to dispose of this additional memory afterwards.
\param san_buf The buffer holding the raw data item of the subject alternative name. \param san The target structure to populate with the parsed presentation of the subject alternative name encoded in \p san_buf.
\note Supported GeneralName types, as defined in RFC 5280: “rfc822Name”, “dnsName”, “directoryName”, “uniformResourceIdentifier” and “hardware_module_name” of type “otherName”, as defined in RFC 4108.
\note This function should be called on a single raw data of subject alternative name. For example, after successful certificate parsing, one must iterate on every item in the \c crt->subject_alt_names sequence, and pass it to this function.
\warning The target structure contains pointers to the raw data of the parsed certificate, and its lifetime is restricted by the lifetime of the certificate.
\return \c 0 on success \return #MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE for an unsupported SAN type. \return Another negative value for any other failure.