pub struct AesGcmEncryptor { /* private fields */ }Expand description
AES-256-GCM encryption. Output is nonce || ciphertext, with a fresh
random nonce generated for every encrypt call.
Implementations§
Trait Implementations§
Source§impl Encryptor for AesGcmEncryptor
impl Encryptor for AesGcmEncryptor
Source§fn encrypt_with_aad(
&self,
plaintext: &[u8],
aad: &[u8],
) -> Result<EncryptionResult, OperationOutcomeError>
fn encrypt_with_aad( &self, plaintext: &[u8], aad: &[u8], ) -> Result<EncryptionResult, OperationOutcomeError>
Encrypts the given plaintext and binds the result to
aad, its
associated data: what the value belongs to, such as the key of the row
that stores it. The associated data is neither secret nor part of the
result. Decryption needs the same bytes again, so a result copied to
another owner does not decrypt there. Read moreSource§fn decrypt_with_aad(
&self,
encrypted_result: &EncryptionResult,
aad: &[u8],
) -> Result<Vec<u8>, OperationOutcomeError>
fn decrypt_with_aad( &self, encrypted_result: &EncryptionResult, aad: &[u8], ) -> Result<Vec<u8>, OperationOutcomeError>
Decrypts a payload encrypted with the associated data
aad. Read moreSource§fn encrypt(
&self,
plaintext: &[u8],
) -> Result<EncryptionResult, OperationOutcomeError>
fn encrypt( &self, plaintext: &[u8], ) -> Result<EncryptionResult, OperationOutcomeError>
Encrypts the given plaintext:
Self::encrypt_with_aad with empty
associated data. Read moreAuto Trait Implementations§
impl Freeze for AesGcmEncryptor
impl RefUnwindSafe for AesGcmEncryptor
impl Send for AesGcmEncryptor
impl Sync for AesGcmEncryptor
impl Unpin for AesGcmEncryptor
impl UnsafeUnpin for AesGcmEncryptor
impl UnwindSafe for AesGcmEncryptor
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
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more