mbedtls_x509_crt_verify_with_profile() function
Verify the certificate signature according to profile
Syntax
int mbedtls_x509_crt_verify_with_profile( mbedtls_x509_crt *crt,
mbedtls_x509_crt *trust_ca,
mbedtls_x509_crl *ca_crl,
const mbedtls_x509_crt_profile *profile,
const char *cn,
uint32_t *flags,
int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
void *p_vrfy );
Arguments
crt
a certificate (chain) to be verified
trust_ca
the list of trusted CAs
ca_crl
the list of CRLs for trusted CAs
profile
security profile for verification
cn
expected Common Name (can be set to NULL if the CN must not be verified)
flags
result of the verification
f_vrfy
verification function
p_vrfy
verification parameter
Return value
0 if successful or MBEDTLS_ERR_X509_CERT_VERIFY_FAILED in which case *flags will have one or more MBEDTLS_X509_BADCERT_XXX or MBEDTLS_X509_BADCRL_XXX flags set, or another error in case of a fatal error encountered during the verification process.
Notes
Same as \c mbedtls_x509_crt_verify(), but with explicit security profile. The restrictions on keys (RSA minimum size, allowed curves for ECDSA) apply to all certificates: trusted root, intermediate CAs if any, and end entity certificate.