pub struct CipherKey { /* private fields */ }Expand description
Encryption key.
Implementations§
Source§impl CipherKey
impl CipherKey
Sourcepub fn new_chacha20poly1305() -> Self
pub fn new_chacha20poly1305() -> Self
Generates an encryption (ChaCha20Poly1305) key.
Sourcepub fn encrypt(&self, message: &impl Serialize) -> MResult<(Vec<u8>, Vec<u8>)>
pub fn encrypt(&self, message: &impl Serialize) -> MResult<(Vec<u8>, Vec<u8>)>
Encrypts serializable message by encryption key, providing ciphertext and its nonce.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CipherKey
impl RefUnwindSafe for CipherKey
impl Send for CipherKey
impl Sync for CipherKey
impl Unpin for CipherKey
impl UnsafeUnpin for CipherKey
impl UnwindSafe for CipherKey
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