pub struct StorageEncryption {
pub kek: Option<EncryptionKey>,
pub source_id: String,
}Expand description
Encryption configuration for opening a DurableStorage.
disabled() (the default for the legacy open variants) keeps the database
plaintext and byte-compatible with pre-encryption binaries. with_kek()
supplies the Key-Encryption-Key — the operator secret that wraps a
per-database data key; it is never used verbatim as the cipher key (see
crate::keyring). A wrong/missing KEK for an encrypted database fails
closed at open (the DB will refuse to open, never silently read as plaintext).
Fields§
§kek: Option<EncryptionKey>The KEK. None ⇒ plaintext database.
source_id: StringHuman-readable identifier for the key source (e.g. “env:SOCHDB_ENCRYPTION_KEY”, “embedded”, “kms:…”). Bound into the keyring for provenance.
Implementations§
Source§impl StorageEncryption
impl StorageEncryption
Sourcepub fn with_kek(kek: EncryptionKey, source_id: impl Into<String>) -> Self
pub fn with_kek(kek: EncryptionKey, source_id: impl Into<String>) -> Self
Encrypt at rest under the given KEK.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether a key is configured (i.e. encryption is requested).
Auto Trait Implementations§
impl Freeze for StorageEncryption
impl RefUnwindSafe for StorageEncryption
impl Send for StorageEncryption
impl Sync for StorageEncryption
impl Unpin for StorageEncryption
impl UnsafeUnpin for StorageEncryption
impl UnwindSafe for StorageEncryption
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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