MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / set_encryption_key

Method set_encryption_key

nodedb-wal/src/writer.rs:182–184  ·  view source on GitHub ↗

Set the encryption key. When set, all subsequent records will have their payloads encrypted with AES-256-GCM. Writes the 16-byte WAL segment preamble at the current file offset. Must be called before the first `append`. Calling it after records have already been written to this file returns an error.

(&mut self, key: crate::crypto::WalEncryptionKey)

Source from the content-addressed store, hash-verified

180 /// Must be called before the first `append`. Calling it after records
181 /// have already been written to this file returns an error.
182 pub fn set_encryption_key(&mut self, key: crate::crypto::WalEncryptionKey) -> Result<()> {
183 self.set_encryption_ring(crate::crypto::KeyRing::new(key))
184 }
185
186 /// Set the key ring directly (for key rotation with dual-key reads).
187 ///

Callers

nothing calls this directly

Calls 1

set_encryption_ringMethod · 0.45

Tested by

no test coverage detected