pub struct EncryptionEngine { /* private fields */ }Expand description
Encryption engine for data encryption
Implementations§
Source§impl EncryptionEngine
impl EncryptionEngine
pub fn new() -> Self
pub fn initialize(&mut self) -> Result<(), CryptographicError>
Sourcepub fn add_encryption_algorithm(
&mut self,
algorithm: EncryptionAlgorithm,
implementation: EncryptionAlgorithmImpl,
)
pub fn add_encryption_algorithm( &mut self, algorithm: EncryptionAlgorithm, implementation: EncryptionAlgorithmImpl, )
Register an encryption algorithm implementation.
Sourcepub fn get_encryption_algorithm(
&self,
algorithm: &EncryptionAlgorithm,
) -> Option<&EncryptionAlgorithmImpl>
pub fn get_encryption_algorithm( &self, algorithm: &EncryptionAlgorithm, ) -> Option<&EncryptionAlgorithmImpl>
Look up an encryption algorithm implementation.
Sourcepub fn list_encryption_algorithms(
&self,
) -> impl Iterator<Item = &EncryptionAlgorithmImpl>
pub fn list_encryption_algorithms( &self, ) -> impl Iterator<Item = &EncryptionAlgorithmImpl>
Iterate over all registered encryption algorithm implementations.
Sourcepub fn add_decryption_algorithm(
&mut self,
algorithm: EncryptionAlgorithm,
implementation: DecryptionAlgorithmImpl,
)
pub fn add_decryption_algorithm( &mut self, algorithm: EncryptionAlgorithm, implementation: DecryptionAlgorithmImpl, )
Register a decryption algorithm implementation.
Sourcepub fn get_decryption_algorithm(
&self,
algorithm: &EncryptionAlgorithm,
) -> Option<&DecryptionAlgorithmImpl>
pub fn get_decryption_algorithm( &self, algorithm: &EncryptionAlgorithm, ) -> Option<&DecryptionAlgorithmImpl>
Look up a decryption algorithm implementation.
Sourcepub fn list_decryption_algorithms(
&self,
) -> impl Iterator<Item = &DecryptionAlgorithmImpl>
pub fn list_decryption_algorithms( &self, ) -> impl Iterator<Item = &DecryptionAlgorithmImpl>
Iterate over all registered decryption algorithm implementations.
Sourcepub fn derive_hkdf(
&self,
ikm: &[u8],
info: &[u8],
) -> Result<Vec<u8>, CryptographicError>
pub fn derive_hkdf( &self, ikm: &[u8], info: &[u8], ) -> Result<Vec<u8>, CryptographicError>
Derive key material using HKDF-SHA256 via the embedded KeyDerivation engine.
pub fn encrypt_data( &mut self, key: &Key, data: &[u8], additional_data: Option<&[u8]>, ) -> Result<EncryptedData, CryptographicError>
Sourcepub fn encrypt_data_with(
&mut self,
key: &Key,
data: &[u8],
additional_data: Option<&[u8]>,
algorithm: EncryptionAlgorithm,
) -> Result<EncryptedData, CryptographicError>
pub fn encrypt_data_with( &mut self, key: &Key, data: &[u8], additional_data: Option<&[u8]>, algorithm: EncryptionAlgorithm, ) -> Result<EncryptedData, CryptographicError>
Encrypt with an explicitly chosen AEAD algorithm (AES-256-GCM, ChaCha20-Poly1305, or XChaCha20-Poly1305).
pub fn decrypt_data( &mut self, key: &Key, encrypted_data: &EncryptedData, ) -> Result<Vec<u8>, CryptographicError>
Auto Trait Implementations§
impl Freeze for EncryptionEngine
impl RefUnwindSafe for EncryptionEngine
impl Send for EncryptionEngine
impl Sync for EncryptionEngine
impl Unpin for EncryptionEngine
impl UnsafeUnpin for EncryptionEngine
impl UnwindSafe for EncryptionEngine
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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