pub struct EncryptionConfig {
pub enabled: bool,
pub master_key: Option<String>,
pub salt: Option<String>,
pub algorithm: String,
}Expand description
Configuration for encrypted storage.
Fields§
§enabled: boolWhether encryption is enabled
master_key: Option<String>Master key (base64 encoded)
salt: Option<String>Key derivation salt (base64 encoded)
algorithm: StringAlgorithm to use (aes-256-gcm or chacha20-poly1305)
Implementations§
Source§impl EncryptionConfig
impl EncryptionConfig
Sourcepub fn with_generated_key() -> Self
pub fn with_generated_key() -> Self
Create a new encryption config with a generated key.
Sourcepub fn create_encryptor(&self) -> CryptoResult<Option<EnvelopeEncryptor>>
pub fn create_encryptor(&self) -> CryptoResult<Option<EnvelopeEncryptor>>
Create an encryptor from this config.
Trait Implementations§
Source§impl Clone for EncryptionConfig
impl Clone for EncryptionConfig
Source§fn clone(&self) -> EncryptionConfig
fn clone(&self) -> EncryptionConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EncryptionConfig
impl Debug for EncryptionConfig
Auto Trait Implementations§
impl Freeze for EncryptionConfig
impl RefUnwindSafe for EncryptionConfig
impl Send for EncryptionConfig
impl Sync for EncryptionConfig
impl Unpin for EncryptionConfig
impl UnsafeUnpin for EncryptionConfig
impl UnwindSafe for EncryptionConfig
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