pub struct Aes256GcmEncryptor { /* private fields */ }Available on crate features
signatures and encryption only.Expand description
AES-256-GCM encryptor.
Implementations§
Source§impl Aes256GcmEncryptor
impl Aes256GcmEncryptor
Sourcepub fn generate_key() -> [u8; 32]
pub fn generate_key() -> [u8; 32]
Generate a new random encryption key.
Sourcepub fn generate_nonce() -> [u8; 12]
pub fn generate_nonce() -> [u8; 12]
Generate a random nonce.
Sourcepub fn encrypt(&self, plaintext: &[u8]) -> Result<EncryptedData>
pub fn encrypt(&self, plaintext: &[u8]) -> Result<EncryptedData>
Sourcepub fn encrypt_with_nonce(
&self,
plaintext: &[u8],
nonce: &[u8; 12],
) -> Result<EncryptedData>
pub fn encrypt_with_nonce( &self, plaintext: &[u8], nonce: &[u8; 12], ) -> Result<EncryptedData>
Auto Trait Implementations§
impl Freeze for Aes256GcmEncryptor
impl RefUnwindSafe for Aes256GcmEncryptor
impl Send for Aes256GcmEncryptor
impl Sync for Aes256GcmEncryptor
impl Unpin for Aes256GcmEncryptor
impl UnsafeUnpin for Aes256GcmEncryptor
impl UnwindSafe for Aes256GcmEncryptor
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