pub fn import_aes_key(&mut self, key_name: String, data: Vec<u8>) -> Result<()> {
        self.import_key(
            key_name,
            Attributes {
                lifetime: Lifetime::Persistent,
                key_type: Type::Aes,
                bits: 0,
                policy: Policy {
                    usage_flags: UsageFlags {
                        sign_hash: false,
                        verify_hash: false,
                        sign_message: false,
                        verify_message: false,
                        export: false,
                        encrypt: true,
                        decrypt: true,
                        cache: false,
                        copy: false,
                        derive: false,
                    },
                    permitted_algorithms: Aead::AeadWithDefaultLengthTag(
                        AeadWithDefaultLengthTag::Ccm,
                    )
                    .into(),
                },
            },
            data,
        )
    }
/// Import an AES key.
/// The key can only be used for AEAD encryption and decryption with the CCM algorithm
Import an AES key.
The key can only be used for AEAD encryption and decryption with the CCM algorithm
Import an AES key . The key can only be used for AEAD encryption and decryption with the CCM algorithm
pub fn import_aes_key(&mut self, key_name: String, data: Vec<u8>) -> Result<()> {
        self.import_key(
            key_name,
            Attributes {
                lifetime: Lifetime::Persistent,
                key_type: Type::Aes,
                bits: 0,
                policy: Policy {
                    usage_flags: UsageFlags {
                        sign_hash: false,
                        verify_hash: false,
                        sign_message: false,
                        verify_message: false,
                        export: false,
                        encrypt: true,
                        decrypt: true,
                        cache: false,
                        copy: false,
                        derive: false,
                    },
                    permitted_algorithms: Aead::AeadWithDefaultLengthTag(
                        AeadWithDefaultLengthTag::Ccm,
                    )
                    .into(),
                },
            },
            data,
        )
    }
pub fn import_aes_key ( & mut self , key_name : String , data : Vec < u8 > ) -> Result < ( ) > { self . import_key ( key_name , Attributes { lifetime : Lifetime :: Persistent , key_type : Type :: Aes , bits : 0 , policy : Policy { usage_flags : UsageFlags { sign_hash : false , verify_hash : false , sign_message : false , verify_message : false , export : false , encrypt : true , decrypt : true , cache : false , copy : false , derive : false , } , permitted_algorithms : Aead :: AeadWithDefaultLengthTag ( AeadWithDefaultLengthTag :: Ccm , ) . into ( ) , } , } , data , ) }
Import an AES key.
Import an AES key .
&mut self
key_name
String
data
Vec<u8>
&mut self
key_name
String
data
Vec<u8>