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
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