pub struct EncryptionKey { /* private fields */ }👎Deprecated:
Will be extracted to mockforge-workspace crate
Expand description
Cryptographic key for encryption operations
Implementations§
Source§impl EncryptionKey
impl EncryptionKey
Sourcepub fn new(algorithm: EncryptionAlgorithm, key_data: Vec<u8>) -> Result<Self>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn new(algorithm: EncryptionAlgorithm, key_data: Vec<u8>) -> Result<Self>
Will be extracted to mockforge-workspace crate
Create a new encryption key from raw bytes
Sourcepub fn from_password_pbkdf2(
password: &str,
salt: Option<&[u8]>,
algorithm: EncryptionAlgorithm,
) -> Result<Self>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn from_password_pbkdf2( password: &str, salt: Option<&[u8]>, algorithm: EncryptionAlgorithm, ) -> Result<Self>
Will be extracted to mockforge-workspace crate
Derive a key from a password using PBKDF2
Sourcepub fn from_password_argon2(
password: &str,
salt: Option<&[u8]>,
algorithm: EncryptionAlgorithm,
) -> Result<Self>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn from_password_argon2( password: &str, salt: Option<&[u8]>, algorithm: EncryptionAlgorithm, ) -> Result<Self>
Will be extracted to mockforge-workspace crate
Derive a key from a password using Argon2
Sourcepub fn encrypt(
&self,
plaintext: &str,
associated_data: Option<&[u8]>,
) -> Result<String>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn encrypt( &self, plaintext: &str, associated_data: Option<&[u8]>, ) -> Result<String>
Will be extracted to mockforge-workspace crate
Encrypt plaintext data
Sourcepub fn decrypt(
&self,
ciphertext: &str,
associated_data: Option<&[u8]>,
) -> Result<String>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn decrypt( &self, ciphertext: &str, associated_data: Option<&[u8]>, ) -> Result<String>
Will be extracted to mockforge-workspace crate
Decrypt ciphertext data
Sourcepub fn encrypt_chacha20(
&self,
plaintext: &str,
_associated_data: Option<&[u8]>,
) -> Result<String>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn encrypt_chacha20( &self, plaintext: &str, _associated_data: Option<&[u8]>, ) -> Result<String>
Will be extracted to mockforge-workspace crate
Auto Trait Implementations§
impl Freeze for EncryptionKey
impl RefUnwindSafe for EncryptionKey
impl Send for EncryptionKey
impl Sync for EncryptionKey
impl Unpin for EncryptionKey
impl UnsafeUnpin for EncryptionKey
impl UnwindSafe for EncryptionKey
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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