mbedtls_x509write_csr_set_key_usage() function
Set the Key Usage Extension flags (e.g. MBEDTLS_X509_KU_DIGITAL_SIGNATURE | MBEDTLS_X509_KU_KEY_CERT_SIGN)
Arguments
key_usage
key usage flags to set
Return value
0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED
Notes
The decipherOnly flag from the Key Usage extension is represented by bit 8 (i.e. 0x8000), which cannot typically be represented in an unsigned char. Therefore, the flag decipherOnly (i.e. #MBEDTLS_X509_KU_DECIPHER_ONLY) cannot be set using this function.
mbedtls_x509write_csr_set_key_usage() calls 2 functions:
![]()
mbedtls_x509write_csr_set_key_usage()
mbedtls_x509write_csr_set_key_usage():
![]()
mbedtls_x509write_csr_set_key_usage()