pub unsafe fn import(attributes: &psa_key_attributes_t, key_data: Vec<u8>) -> Result<Self> {
        let mut key_handle: psa_key_handle_t = Default::default();
        let status = psa_crypto_binding::psa_import_key(
            attributes,
            key_data.as_ptr(),
            key_data.len(),
            &mut key_handle,
        );
        if status != PSA_SUCCESS {
            error!("Import key status: {}", status);
            Err(convert_status(status))
        } else {
            Ok(KeyHandle(key_handle))
        }
    }
/// Import a key in binary format.
///
/// # 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
Import a key in binary format.
Import a key in binary format .
pub unsafe fn import(attributes: &psa_key_attributes_t, key_data: Vec<u8>) -> Result<Self> {
        let mut key_handle: psa_key_handle_t = Default::default();
        let status = psa_crypto_binding::psa_import_key(
            attributes,
            key_data.as_ptr(),
            key_data.len(),
            &mut key_handle,
        );
        if status != PSA_SUCCESS {
            error!("Import key status: {}", status);
            Err(convert_status(status))
        } else {
            Ok(KeyHandle(key_handle))
        }
    }
pub unsafe fn import ( attributes : & psa_key_attributes_t , key_data : Vec < u8 > ) -> Result < Self > { let mut key_handle : psa_key_handle_t = Default :: default ( ) ; let status = psa_crypto_binding :: psa_import_key ( attributes , key_data . as_ptr ( ) , key_data . len ( ) , & mut key_handle , ) ; if status != PSA_SUCCESS { error ! ( " " status ) ; Err ( convert_status ( status ) ) } else { Ok ( KeyHandle ( key_handle ) ) } }
Import a key in binary format.
Import a key in binary format .
attributes
&psa_key_attributes_t
key_data
Vec<u8>
attributes
&psa_key_attributes_t
key_data
Vec<u8>
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