pub fn import_rsa_key_pair_for_encryption(
        &mut self,
        key_name: String,
        data: Vec<u8>,
    ) -> Result<()> {
        self.import_key(
            key_name,
            Attributes {
                lifetime: Lifetime::Persistent,
                key_type: Type::RsaKeyPair,
                bits: 1024,
                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: AsymmetricEncryption::RsaPkcs1v15Crypt.into(),
                },
            },
            data,
        )
    }
/// Import a 1024 bit RSA key pair
/// The key pair can only be used for encryption and decryption with RSA PKCS 1v15
Import a 1024 bit RSA key pair
The key pair can only be used for encryption and decryption with RSA PKCS 1v15
Import a 1024 bit RSA key pair The key pair can only be used for encryption and decryption with RSA PKCS 1v15
pub fn import_rsa_key_pair_for_encryption(
        &mut self,
        key_name: String,
        data: Vec<u8>,
    ) -> Result<()> {
        self.import_key(
            key_name,
            Attributes {
                lifetime: Lifetime::Persistent,
                key_type: Type::RsaKeyPair,
                bits: 1024,
                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: AsymmetricEncryption::RsaPkcs1v15Crypt.into(),
                },
            },
            data,
        )
    }
pub fn import_rsa_key_pair_for_encryption ( & mut self , key_name : String , data : Vec < u8 > , ) -> Result < ( ) > { self . import_key ( key_name , Attributes { lifetime : Lifetime :: Persistent , key_type : Type :: RsaKeyPair , bits : 1024 , 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 : AsymmetricEncryption :: RsaPkcs1v15Crypt . into ( ) , } , } , data , ) }
Import a 1024 bit RSA key pair
The key pair can only be used for encryption and decryption with RSA PKCS 1v15
Import a 1024 bit RSA key pair The key pair can only be used for encryption and decryption with RSA PKCS 1v15
&mut self
key_name
String
data
Vec<u8>
&mut self
key_name
String
data
Vec<u8>