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)
| 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> { |