pub struct LogCipher { /* private fields */ }Expand description
Encrypts and decrypts transaction-log record payloads for one database.
Frame lengths and CRC32C checksums stay cleartext, as do each record’s key epoch and transaction number, so frame scanning, range reads, and recovery truncation need no key. The payload — the transaction’s datoms — does not.
The key set is an immutable snapshot of already-unwrapped storage keys, the
same shape EncryptedBlobStore holds: KMS access belongs on database open
and key-manifest reload, not on the append path. A rotation replaces the
cipher rather than mutating it.
Implementations§
Source§impl LogCipher
impl LogCipher
Sourcepub fn new(
lineage: impl Into<Vec<u8>>,
current_epoch: u32,
keys: impl IntoIterator<Item = (u32, SecretKey)>,
) -> Result<Self, LogError>
pub fn new( lineage: impl Into<Vec<u8>>, current_epoch: u32, keys: impl IntoIterator<Item = (u32, SecretKey)>, ) -> Result<Self, LogError>
Creates a cipher over every readable epoch, writing under
current_epoch.
lineage identifies the database and is authenticated into every
record, so a record cannot be moved between databases.
§Errors
Returns LogError::MissingKeyEpoch when current_epoch has no key.
Sourcepub fn with_key(lineage: impl Into<Vec<u8>>, epoch: u32, key: SecretKey) -> Self
pub fn with_key(lineage: impl Into<Vec<u8>>, epoch: u32, key: SecretKey) -> Self
Creates a single-epoch cipher.
Sourcepub fn current_epoch(&self) -> u32
pub fn current_epoch(&self) -> u32
Returns the epoch new records are written under.