esp_idf_sys

Function psa_generate_key_ext

Source
pub unsafe extern "C" fn psa_generate_key_ext(
    attributes: *const psa_key_attributes_t,
    params: *const psa_key_production_parameters_t,
    params_data_length: usize,
    key: *mut mbedtls_svc_key_id_t,
) -> psa_status_t
Expand description

\brief Generate a key or key pair using custom production parameters.

\note This is a deprecated variant of psa_key_derivation_output_key_custom(). It is equivalent except that the associated variable-length data is passed in params->data instead of a separate parameter. This function will be removed in a future version of Mbed TLS.

\param[in] attributes The attributes for the new key. \param[in] params Customization parameters for the key generation. When this is #PSA_KEY_PRODUCTION_PARAMETERS_INIT with \p params_data_length = 0, this function is equivalent to psa_generate_key(). \param params_data_length Length of params->data in bytes. \param[out] key On success, an identifier for the newly created key. For persistent keys, this is the key identifier defined in \p attributes. \c 0 on failure.

\retval #PSA_SUCCESS Success. If the key is persistent, the key material and the key’s metadata have been saved to persistent storage. \retval #PSA_ERROR_ALREADY_EXISTS This is an attempt to create a persistent key, and there is already a persistent key with the given identifier. \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription \retval #PSA_ERROR_INSUFFICIENT_STORAGE \emptydescription \retval #PSA_ERROR_DATA_INVALID \emptydescription \retval #PSA_ERROR_DATA_CORRUPT \emptydescription \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription \retval #PSA_ERROR_BAD_STATE The library has not been previously initialized by psa_crypto_init(). It is implementation-dependent whether a failure to initialize results in this error code.