Skip to main content

mbedtls_x509write_csr_set_key_usage

Function mbedtls_x509write_csr_set_key_usage 

Source
pub unsafe extern "C" fn mbedtls_x509write_csr_set_key_usage(
    ctx: *mut mbedtls_x509write_csr,
    key_usage: c_uchar,
) -> c_int
Expand description

\brief Set the Key Usage Extension flags (e.g. MBEDTLS_X509_KU_DIGITAL_SIGNATURE | MBEDTLS_X509_KU_KEY_CERT_SIGN)

\param ctx CSR context to use \param key_usage key usage flags to set

\return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED

\note 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.