pub struct KdfEncryptedData { /* private fields */ }Expand description
A blob that stores key derivation parameters alongside a symmetric ciphertext, allowing decryption with only the original password.
The serialized format contains the DerivationParameters
used to derive the key and the resulting Ciphertext,
so no external state is required to decrypt.
Implementations§
Source§impl KdfEncryptedData
impl KdfEncryptedData
Sourcepub fn decrypt_with_password(&self, password: &[u8]) -> Result<Vec<u8>>
pub fn decrypt_with_password(&self, password: &[u8]) -> Result<Vec<u8>>
Decrypts this blob using password.
Equivalent to calling decrypt_with_password_and_aad with an empty AAD.
§Arguments
password- The password used during encryption.
§Returns
Returns the decrypted plaintext, or an error if the password is wrong or the blob is invalid.
Sourcepub fn decrypt_with_password_and_aad(
&self,
password: &[u8],
aad: &[u8],
) -> Result<Vec<u8>>
pub fn decrypt_with_password_and_aad( &self, password: &[u8], aad: &[u8], ) -> Result<Vec<u8>>
Decrypts this blob using password, verifying aad.
§Arguments
password- The password used during encryption.aad- The same Additional Authenticated Data that was provided during encryption.
§Returns
Returns the decrypted plaintext, or an error if the password is wrong, the AAD does not match, or the blob is invalid.
Trait Implementations§
Source§impl Clone for KdfEncryptedData
impl Clone for KdfEncryptedData
Source§fn clone(&self) -> KdfEncryptedData
fn clone(&self) -> KdfEncryptedData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KdfEncryptedData
impl Debug for KdfEncryptedData
Source§impl From<KdfEncryptedData> for Vec<u8>
impl From<KdfEncryptedData> for Vec<u8>
Source§fn from(data: KdfEncryptedData) -> Self
fn from(data: KdfEncryptedData) -> Self
Converts to this type from the input type.
Source§impl HeaderType for KdfEncryptedData
impl HeaderType for KdfEncryptedData
Auto Trait Implementations§
impl Freeze for KdfEncryptedData
impl RefUnwindSafe for KdfEncryptedData
impl Send for KdfEncryptedData
impl Sync for KdfEncryptedData
impl Unpin for KdfEncryptedData
impl UnsafeUnpin for KdfEncryptedData
impl UnwindSafe for KdfEncryptedData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more