Function esp_idf_svc::hal::sys::mbedtls_x509_crt_parse_der
source ยท pub unsafe extern "C" fn mbedtls_x509_crt_parse_der(
chain: *mut mbedtls_x509_crt,
buf: *const u8,
buflen: usize,
) -> i32
Expand description
\brief Parse a single DER formatted certificate and add it to the end of the provided chained list.
\note If #MBEDTLS_USE_PSA_CRYPTO is enabled, the PSA crypto subsystem must have been initialized by calling psa_crypto_init() before calling this function.
\param chain The pointer to the start of the CRT chain to attach to. When parsing the first CRT in a chain, this should point to an instance of ::mbedtls_x509_crt initialized through mbedtls_x509_crt_init(). \param buf The buffer holding the DER encoded certificate. \param buflen The size in Bytes of \p buf.
\note This function makes an internal copy of the CRT buffer \p buf. In particular, \p buf may be destroyed or reused after this call returns. To avoid duplicating the CRT buffer (at the cost of stricter lifetime constraints), use mbedtls_x509_crt_parse_der_nocopy() instead.
\return \c 0 if successful. \return A negative error code on failure.