pub struct EncryptionKey { /* private fields */ }Expand description
Encryption key for AEAD ciphers.
Implementations§
Source§impl EncryptionKey
impl EncryptionKey
Sourcepub fn new(algorithm: CipherAlgorithm, key_material: &[u8]) -> FynxResult<Self>
pub fn new(algorithm: CipherAlgorithm, key_material: &[u8]) -> FynxResult<Self>
Creates a new encryption key.
Sourcepub fn encrypt(&mut self, data: &mut Vec<u8>) -> FynxResult<()>
pub fn encrypt(&mut self, data: &mut Vec<u8>) -> FynxResult<()>
Encrypts data in place (AEAD mode).
Sourcepub fn algorithm(&self) -> &CipherAlgorithm
pub fn algorithm(&self) -> &CipherAlgorithm
Returns the algorithm.
Trait Implementations§
Source§impl Debug for EncryptionKey
impl Debug for EncryptionKey
Source§impl Drop for EncryptionKey
impl Drop for EncryptionKey
Auto Trait Implementations§
impl Freeze for EncryptionKey
impl RefUnwindSafe for EncryptionKey
impl Send for EncryptionKey
impl Sync for EncryptionKey
impl Unpin for EncryptionKey
impl UnsafeUnpin for EncryptionKey
impl UnwindSafe for EncryptionKey
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