/// Apply encryption to all the Wallet db backends. The Wallet backend will test if the db's are already encrypted
/// in which case this will fail.
Apply encryption to all the Wallet db backends. The Wallet backend will test if the db's are already encrypted
in which case this will fail.
Apply encryption to all the Wallet db backends . The Wallet backend will test if the db ' s are already encrypted in which case this will fail .
pub async fn apply_encryption(&mut self, passphrase: String) -> Result<(), WalletError> {
        let passphrase_hash = Blake256::new().chain(passphrase.as_bytes()).result().to_vec();
        let key = GenericArray::from_slice(passphrase_hash.as_slice());
        let cipher = Aes256Gcm::new(key);
        self.db.apply_encryption(cipher.clone()).await?;
        self.output_manager_service.apply_encryption(cipher.clone()).await?;
        self.transaction_service.apply_encryption(cipher).await?;
        Ok(())
    }
pub async fn apply_encryption ( & mut self , passphrase : String ) -> Result < ( ) , WalletError > { let passphrase_hash = Blake256 :: new ( ) . chain ( passphrase . as_bytes ( ) ) . result ( ) . to_vec ( ) ; let key = GenericArray :: from_slice ( passphrase_hash . as_slice ( ) ) ; let cipher = Aes256Gcm :: new ( key ) ; self . db . apply_encryption ( cipher . clone ( ) ) . await ? ; self . output_manager_service . apply_encryption ( cipher . clone ( ) ) . await ? ; self . transaction_service . apply_encryption ( cipher ) . await ? ; Ok ( ( ) ) }
Apply encryption to all the Wallet db backends.
Apply encryption to all the Wallet db backends .
&mut self
passphrase
String