pub struct EnvelopeEncryptor { /* private fields */ }Expand description
Envelope encryptor using envelope encryption pattern.
Implementations§
Source§impl EnvelopeEncryptor
impl EnvelopeEncryptor
Sourcepub fn new(
kek_provider: Box<dyn KekProvider>,
dek_algorithm: EncryptionAlgorithm,
) -> Self
pub fn new( kek_provider: Box<dyn KekProvider>, dek_algorithm: EncryptionAlgorithm, ) -> Self
Create a new envelope encryptor.
Sourcepub fn encrypt(
&self,
plaintext: &[u8],
aad: Option<&[u8]>,
) -> Result<EnvelopeEncryptedData>
pub fn encrypt( &self, plaintext: &[u8], aad: Option<&[u8]>, ) -> Result<EnvelopeEncryptedData>
Encrypt data using envelope encryption.
Sourcepub fn decrypt(&self, envelope: &EnvelopeEncryptedData) -> Result<Vec<u8>>
pub fn decrypt(&self, envelope: &EnvelopeEncryptedData) -> Result<Vec<u8>>
Decrypt data using envelope encryption.
Sourcepub fn dek_algorithm(&self) -> EncryptionAlgorithm
pub fn dek_algorithm(&self) -> EncryptionAlgorithm
Get the DEK algorithm.
Auto Trait Implementations§
impl Freeze for EnvelopeEncryptor
impl !RefUnwindSafe for EnvelopeEncryptor
impl Send for EnvelopeEncryptor
impl Sync for EnvelopeEncryptor
impl Unpin for EnvelopeEncryptor
impl UnsafeUnpin for EnvelopeEncryptor
impl !UnwindSafe for EnvelopeEncryptor
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