pub struct EncryptionCipher<C, S>{ /* private fields */ }
Expand description
Describes the Key
, NonceSequence
and EncryptionMode
used to encrypt / decrypt
the data
Implementations§
Source§impl<C, S> EncryptionCipher<C, S>
impl<C, S> EncryptionCipher<C, S>
Sourcepub fn new(key: Key<C>, nonces: S, mode: EncryptionMode) -> Self
pub fn new(key: Key<C>, nonces: S, mode: EncryptionMode) -> Self
Create a new EncryptionCipher
Trait Implementations§
Source§impl<C, S> Clone for EncryptionCipher<C, S>
impl<C, S> Clone for EncryptionCipher<C, S>
Source§impl<C, S> Debug for EncryptionCipher<C, S>
impl<C, S> Debug for EncryptionCipher<C, S>
Source§impl<C, S> Encryption for EncryptionCipher<C, S>
impl<C, S> Encryption for EncryptionCipher<C, S>
fn encrypt_ivec( &self, data: IVec, mode: EncryptionMode, nonce: Option<IVec>, ) -> Result<IVec>
fn decrypt_ivec(&self, data: IVec, mode: EncryptionMode) -> Result<IVec>
fn applies_to(&self, mode: EncryptionMode) -> bool
fn get_nonce_from_encrypted(&self, data: &IVec) -> Result<IVec>
fn salt_and_hash<D: AsRef<[u8]>>(&self, data: D) -> Hash
fn applies_to_key(&self) -> bool
fn applies_to_tree_name(&self) -> bool
fn encrypt<T, E>( &self, data: T, mode: EncryptionMode, default_nonce_fn: Box<dyn Fn(&IVec) -> Result<Option<IVec>, E> + '_>, ) -> Result<IVec, E>
fn decrypt<T: Into<IVec>>(&self, data: T, mode: EncryptionMode) -> Result<IVec>
fn encrypt_key<T, E>( &self, data: T, default_nonce_fn: Box<dyn Fn(&IVec) -> Result<Option<IVec>, E> + '_>, ) -> Result<IVec, E>
fn decrypt_key<T: Into<IVec>>(&self, data: T) -> Result<IVec>
fn encrypt_value<T: Into<IVec>>(&self, data: T) -> Result<IVec>
fn decrypt_value<T: Into<IVec>>(&self, data: T) -> Result<IVec>
fn encrypt_tree_name<T, E>( &self, data: T, default_nonce_fn: Box<dyn Fn(&IVec) -> Result<Option<IVec>, E> + '_>, ) -> Result<IVec, E>
fn decrypt_tree_name<T: Into<IVec>>(&self, data: T) -> Result<IVec>
fn decrypt_value_result<E>( &self, res: Result<Option<IVec>, E>, ) -> Result<Option<IVec>, E>
fn decrypt_key_value_result( &self, res: Result<Option<(IVec, IVec)>>, ) -> Result<Option<(IVec, IVec)>>
fn decrypt_event(&self, event: Event) -> Result<Event>
Auto Trait Implementations§
impl<C, S> Freeze for EncryptionCipher<C, S>
impl<C, S> RefUnwindSafe for EncryptionCipher<C, S>
impl<C, S> Send for EncryptionCipher<C, S>
impl<C, S> Sync for EncryptionCipher<C, S>
impl<C, S> Unpin for EncryptionCipher<C, S>
impl<C, S> UnwindSafe for EncryptionCipher<C, S>
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