pub struct AeadEncryptor { /* private fields */ }Expand description
AEAD_AES_256_CBC_HMAC_SHA256 encryption context.
Provides encryption and decryption operations for Always Encrypted data.
Implementations§
Source§impl AeadEncryptor
impl AeadEncryptor
Sourcepub fn new(cek: &[u8]) -> Result<Self, EncryptionError>
pub fn new(cek: &[u8]) -> Result<Self, EncryptionError>
Sourcepub fn encrypt(
&self,
plaintext: &[u8],
encryption_type: EncryptionType,
) -> Result<Vec<u8>, EncryptionError>
pub fn encrypt( &self, plaintext: &[u8], encryption_type: EncryptionType, ) -> Result<Vec<u8>, EncryptionError>
Sourcepub fn decrypt(&self, ciphertext: &[u8]) -> Result<Vec<u8>, EncryptionError>
pub fn decrypt(&self, ciphertext: &[u8]) -> Result<Vec<u8>, EncryptionError>
Decrypt ciphertext using AEAD_AES_256_CBC_HMAC_SHA256.
§Arguments
ciphertext- The encrypted data (version + MAC + IV + aes_ciphertext)
§Returns
The decrypted plaintext.
§Errors
Returns an error if:
- Ciphertext is too short
- Version byte is invalid
- MAC verification fails (data may be tampered)
- Decryption fails
Auto Trait Implementations§
impl Freeze for AeadEncryptor
impl RefUnwindSafe for AeadEncryptor
impl Send for AeadEncryptor
impl Sync for AeadEncryptor
impl Unpin for AeadEncryptor
impl UnsafeUnpin for AeadEncryptor
impl UnwindSafe for AeadEncryptor
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