/// Decrypts encrypted box using the provided `passphrase`.
Decrypts encrypted box using the provided `passphrase`.
Decrypts encrypted box using the provided ` passphrase ` .
pub fn decrypt(&self, passphrase: &str, encryption: &JsValue) -> Result<Box<[u8]>, JsValue> {
        let encryption: ErasedPwBox = encryption.into_serde().map_err(convert_err)?;
        let mut eraser = Eraser::new();
        eraser.add_suite::<PureCrypto>();
        let plaintext = eraser
            .restore(&encryption)
            .map_err(convert_err)?
            .open(passphrase)
            .map_err(convert_err)?;
        Ok(plaintext.to_vec().into_boxed_slice())
    }
pub fn decrypt ( & self , passphrase : & str , encryption : & JsValue ) -> Result < Box < [ u8 ] > , JsValue > { let encryption : ErasedPwBox = encryption . into_serde ( ) . map_err ( convert_err ) ? ; let mut eraser = Eraser :: new ( ) ; eraser . add_suite :: < PureCrypto > ( ) ; let plaintext = eraser . restore ( & encryption ) . map_err ( convert_err ) ? . open ( passphrase ) . map_err ( convert_err ) ? ; Ok ( plaintext . to_vec ( ) . into_boxed_slice ( ) ) }
Decrypts encrypted box using the provided `passphrase`.
Decrypts encrypted box using the provided ` passphrase ` .
&self
passphrase
&str
encryption
&JsValue