StoreCipher

Struct StoreCipher 

Source
pub struct StoreCipher<C = Aes256Gcm>
where C: KeySizeUser,
{ /* private fields */ }

Implementations§

Source§

impl StoreCipher<Aes256Gcm>

Source

pub fn import_aes256gcm( passphrase: &[u8], exported: ExportedStoreCipher, ) -> Result<Self, Error>

Source

pub fn export_aes256gcm(&self) -> Result<ExportedStoreCipher, Error>

Source

pub fn new_aes256gcm( passphrase: &[u8], kdf_info: KdfInfo, ) -> Result<Self, Error>

Source§

impl<C> StoreCipher<C>
where C: KeySizeUser + KeyInit,

Source

pub fn new(passphrase: &[u8], kdf_info: KdfInfo) -> Result<Self, Error>

Source

pub fn new_with_default_kdf(passphrase: &[u8]) -> Result<Self, Error>

Source

pub fn encrypt_data_ref(&self, data: &[u8]) -> Result<EncryptedData, Error>
where C: Aead,

Source

pub fn encrypt_data(&self, data: Vec<u8>) -> Result<EncryptedData, Error>
where C: AeadInPlace,

Source

pub fn decrypt_data_unchecked( &self, data: EncryptedData, ) -> Result<Vec<u8>, Error>
where C: Aead,

Source

pub fn decrypt_data(&self, data: EncryptedData) -> Result<Vec<u8>, Error>
where C: Aead,

Source

pub fn random_nonce() -> Result<Nonce<C>, Error>
where C: AeadCore,

Source

pub fn random_nonce_with_rng<R: RngCore + CryptoRng>( rng: &mut R, ) -> Result<Nonce<C>, Error>
where C: AeadCore,

Trait Implementations§

Source§

impl<C> Drop for StoreCipher<C>
where C: KeySizeUser,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<C> Zeroize for StoreCipher<C>
where C: KeySizeUser,

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V