pub struct SealedSecret {
pub kek_id: String,
pub nonce: [u8; 12],
pub ciphertext: Vec<u8>,
}Expand description
An encrypted secret, exactly as it is persisted.
This is the only shape that crosses the storage boundary. It carries no
plaintext and no key material — kek_id names which KEK to open it with,
it is not itself secret.
Serialisable so a durable store can persist it verbatim. The byte fields are
hex rather than JSON number arrays: a credential file is something an
operator will open during an incident, and "a3f1…" is inspectable where
[163,241,…] is not. Hex also keeps the file a third of the size.
Fields§
§kek_id: StringWhich key-encryption key sealed this. Clear-text by design (rotation).
nonce: [u8; 12]Random per-seal nonce.
ciphertext: Vec<u8>Ciphertext with the AEAD tag appended.
Trait Implementations§
Source§impl Clone for SealedSecret
impl Clone for SealedSecret
Source§impl Debug for SealedSecret
Never print ciphertext or nonce: a Debug on a request-scoped struct is
how secrets reach logs. The id and a length are enough to debug with.
impl Debug for SealedSecret
Never print ciphertext or nonce: a Debug on a request-scoped struct is
how secrets reach logs. The id and a length are enough to debug with.