mbedtls_x509_crt_parse_der() function
Parse a single DER formatted certificate and add it to the end of the provided chained list.
Arguments
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().
buf
The buffer holding the DER encoded certificate.
buflen
The size in Bytes of \p buf.
Return value
\c 0 if successful. A negative error code on failure.
Notes
If #MBEDTLS_USE_PSA_CRYPTO is enabled, the PSA crypto subsystem must have been initialized by calling psa_crypto_init() before calling this function. 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.