pub unsafe fn generate(attributes: &psa_key_attributes_t) -> Result<Self> {
        let mut key_handle: psa_key_handle_t = Default::default();
        let status = psa_crypto_binding::psa_generate_key(attributes, &mut key_handle);
        if status != PSA_SUCCESS {
            error!("Generate key status: {}", status);
            Err(convert_status(status))
        } else {
            Ok(KeyHandle(key_handle))
        }
    }
/// Generate a key or a key pair.
///
/// # Safety
///
/// Calling this function is only safe if:
/// * the Mbed Crypto library has already been initialized
/// * calls to open, generate, import and close are protected by the same mutex
/// * only PSA_KEY_SLOT_COUNT slots are used at any given time
Generate a key or a key pair.
Generate a key or a key pair .
pub unsafe fn generate(attributes: &psa_key_attributes_t) -> Result<Self> {
        let mut key_handle: psa_key_handle_t = Default::default();
        let status = psa_crypto_binding::psa_generate_key(attributes, &mut key_handle);
        if status != PSA_SUCCESS {
            error!("Generate key status: {}", status);
            Err(convert_status(status))
        } else {
            Ok(KeyHandle(key_handle))
        }
    }
pub unsafe fn generate ( attributes : & psa_key_attributes_t ) -> Result < Self > { let mut key_handle : psa_key_handle_t = Default :: default ( ) ; let status = psa_crypto_binding :: psa_generate_key ( attributes , & mut key_handle ) ; if status != PSA_SUCCESS { error ! ( " " status ) ; Err ( convert_status ( status ) ) } else { Ok ( KeyHandle ( key_handle ) ) } }
Generate a key or a key pair.
Generate a key or a key pair .
attributes
&psa_key_attributes_t
attributes
&psa_key_attributes_t
safety
Calling this function is only safe if:
the Mbed Crypto library has already been initialized
calls to open, generate, import and close are protected by the same mutex
only PSA_KEY_SLOT_COUNT slots are used at any given time
Calling this function is only safe if : the Mbed Crypto library has already been initialized calls to open generate import and close are protected by the same mutex only PSA_KEY_SLOT_COUNT slots are used at any given time