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

Method set_encryption_ring

nodedb-wal/src/segmented.rs:140–144  ·  view source on GitHub ↗

Set the encryption key ring. All subsequent records will be encrypted. Must be called before the first `append`. Returns an error if records have already been written to the active segment.

(&mut self, ring: crate::crypto::KeyRing)

Source from the content-addressed store, hash-verified

138 /// Must be called before the first `append`. Returns an error if records
139 /// have already been written to the active segment.
140 pub fn set_encryption_ring(&mut self, ring: crate::crypto::KeyRing) -> Result<()> {
141 self.writer.set_encryption_ring(ring.clone())?;
142 self.encryption_ring = Some(ring);
143 Ok(())
144 }
145
146 /// Get the encryption key ring (for replay decryption).
147 pub fn encryption_ring(&self) -> Option<&crate::crypto::KeyRing> {

Callers 4

roll_segmentMethod · 0.45
epoch_tamper_rejectedFunction · 0.45

Calls 1

cloneMethod · 0.45

Tested by 3

epoch_tamper_rejectedFunction · 0.36