pub fn convert_key_attributes(
    attrs: &psa_key_attributes::KeyAttributes,
    key_id: psa_key_id_t,
) -> Result<psa_key_attributes_t> {
    Ok(psa_key_attributes_t {
        core: psa_core_key_attributes_t {
            type_: convert_key_type(attrs.key_type)?,
            lifetime: PSA_KEY_LIFETIME_PERSISTENT,
            id: key_id,
            policy: psa_key_policy_s {
                usage: convert_key_usage(&attrs.key_policy.key_usage_flags),
                alg: convert_algorithm(&attrs.key_policy.key_algorithm)?,
                alg2: 0,
            },
            bits: convert_key_bits(attrs.key_bits),
            flags: 0,
        },
        domain_parameters: ::std::ptr::null_mut(),
        domain_parameters_size: 0,
    })
}
/// Converts between native Parsec key attributes and ID and the
/// `psa_key_attributes_t` structure required by Mbed Crypto.
///
/// # Errors
///
/// If either algorithm or key type conversion fails. See docs for
/// `convert_key_type` and `convert_algorithm` for more details.
Converts between native Parsec key attributes and ID and the
`psa_key_attributes_t` structure required by Mbed Crypto.
Converts between native Parsec key attributes and ID and the ` psa_key_attributes_t ` structure required by Mbed Crypto .
pub fn convert_key_attributes(
    attrs: &psa_key_attributes::KeyAttributes,
    key_id: psa_key_id_t,
) -> Result<psa_key_attributes_t> {
    Ok(psa_key_attributes_t {
        core: psa_core_key_attributes_t {
            type_: convert_key_type(attrs.key_type)?,
            lifetime: PSA_KEY_LIFETIME_PERSISTENT,
            id: key_id,
            policy: psa_key_policy_s {
                usage: convert_key_usage(&attrs.key_policy.key_usage_flags),
                alg: convert_algorithm(&attrs.key_policy.key_algorithm)?,
                alg2: 0,
            },
            bits: convert_key_bits(attrs.key_bits),
            flags: 0,
        },
        domain_parameters: ::std::ptr::null_mut(),
        domain_parameters_size: 0,
    })
}
pub fn convert_key_attributes ( attrs : & psa_key_attributes :: KeyAttributes , key_id : psa_key_id_t , ) -> Result < psa_key_attributes_t > { Ok ( psa_key_attributes_t { core : psa_core_key_attributes_t { type_ : convert_key_type ( attrs . key_type ) ? , lifetime : PSA_KEY_LIFETIME_PERSISTENT , id : key_id , policy : psa_key_policy_s { usage : convert_key_usage ( & attrs . key_policy . key_usage_flags ) , alg : convert_algorithm ( & attrs . key_policy . key_algorithm ) ? , alg2 : 0 , } , bits : convert_key_bits ( attrs . key_bits ) , flags : 0 , } , domain_parameters : :: std :: ptr :: null_mut ( ) , domain_parameters_size : 0 , } ) }
Converts between native Parsec key attributes and ID and the
`psa_key_attributes_t` structure required by Mbed Crypto.
Converts between native Parsec key attributes and ID and the ` psa_key_attributes_t ` structure required by Mbed Crypto .
attrs
&psa_key_attributes::KeyAttributes
key_id
psa_key_id_t
attrs
&psa_key_attributes::KeyAttributes
key_id
psa_key_id_t
errors
If either algorithm or key type conversion fails. See docs for
`convert_key_type` and `convert_algorithm` for more details.
If either algorithm or key type conversion fails . See docs for ` convert_key_type ` and ` convert_algorithm ` for more details .