pub struct EncryptedPayload {
pub ciphertext: Vec<u8>,
pub nonce: [u8; 12],
pub key_version: KeyVersion,
}Expand description
The encrypted form of a single Raft log entry payload.
key_version records which crate::key_rotation::KeyVersion of the
master key was used to derive the per-entry AES key. Decryption looks
the version up in the corresponding crate::key_rotation::KeyManager
so historical payloads remain decryptable after rotation.
The key_version field uses #[serde(default)], so any future
deserialization of pre-rotation payloads parses with version
crate::key_rotation::LEGACY_KEY_VERSION (= 0).
Fields§
§ciphertext: Vec<u8>Ciphertext produced by AES-256-GCM, including the 16-byte authentication tag.
nonce: [u8; 12]The 12-byte nonce used during encryption (derived from master key + entry index).
key_version: KeyVersionVersion of the master key used during encryption.
Defaults to LEGACY_KEY_VERSION (= 0) when absent from a
serialized form, providing forward compatibility with payloads
written before key rotation existed.
Trait Implementations§
Source§impl Clone for EncryptedPayload
impl Clone for EncryptedPayload
Source§fn clone(&self) -> EncryptedPayload
fn clone(&self) -> EncryptedPayload
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more