mbedTLS + 0/6 examples
CodeScope will show references to mbedtls_x509_crt_parse() from the following samples and libraries:
Examples
STM32469I_EVAL
Applications
mbedTLS
STM324x9I_EVAL
Applications
mbedTLS
STM324xG_EVAL
Applications
mbedTLS
 
Symbols
loading...
Files
loading...

mbedtls_x509_crt_parse() function

Parse one DER-encoded or one or more concatenated PEM-encoded certificates and add them to the chained list. For CRTs in PEM encoding, the function parses permissively: if at least one certificate can be parsed, the function returns the number of certificates for which parsing failed (hence \c 0 if all certificates were parsed successfully). If no certificate could be parsed, the function returns the first (negative) error encountered during parsing. PEM encoded certificates may be interleaved by other data such as human readable descriptions of their content, as long as the certificates are enclosed in the PEM specific '-----{BEGIN/END} CERTIFICATE-----' delimiters.

Syntax

int mbedtls_x509_crt_parse( mbedtls_x509_crt *chain,     const unsigned char *buf,     size_t buflen );
Implemented in x509_crt.c:1139

Arguments

chain

The chain to which to add the parsed certificates.

buf

The buffer holding the certificate data in PEM or DER format. For certificates in PEM encoding, this may be a concatenation of multiple certificates; for DER encoding, the buffer must comprise exactly one certificate.

buflen

The size of \p buf, including the terminating \c NULL byte in case of PEM encoded data.

Return value

\c 0 if all certificates were parsed successfully. The (positive) number of certificates that couldn't be parsed if parsing was partly successful (see above). A negative X509 or PEM error code otherwise.

Examples

mbedtls_x509_crt_parse() is referenced by 6 libraries and example projects.

References

LocationText
x509_crt.c:1139
int mbedtls_x509_crt_parse( mbedtls_x509_crt *chain, const unsigned char *buf, size_t buflen )
x509_crt.h:264
int mbedtls_x509_crt_parse( mbedtls_x509_crt *chain, const unsigned char *buf, size_t buflen );

Call Tree

Functions called by mbedtls_x509_crt_parse()
mbedtls_x509_crt_parse()
Data read by mbedtls_x509_crt_parse()
Data written by mbedtls_x509_crt_parse()
mbedtls_x509_crt_parse()::success
mbedtls_x509_crt_parse()::first_error
mbedtls_x509_crt_parse()::total_failed
mbedtls_x509_crt_parse()::buf_format
mbedtls_x509_crt_parse()::ret
mbedtls_x509_crt_parse()::pem
mbedtls_x509_crt_parse()::use_len
all items filtered out
mbedtls_x509_crt_parse()
mbedtls_x509_crt_parse()::success
mbedtls_x509_crt_parse()::first_error
mbedtls_x509_crt_parse()::total_failed
mbedtls_x509_crt_parse()::buf_format
mbedtls_x509_crt_parse()::ret
all items filtered out
Type of mbedtls_x509_crt_parse()
mbedtls_x509_crt_parse()
size_t
all items filtered out