pub struct SseKeyring { /* private fields */ }Expand description
v0.5 #29: a set of SseKeys indexed by u16 key-id, plus a
designated active id used for new encryptions. Rotation is just
“add the new key, flip active to its id, leave the old keys for
decryption-only”. Cheap to clone (Arc<SseKey> per slot).
Implementations§
Source§impl SseKeyring
impl SseKeyring
Sourcepub fn new(active: u16, key: Arc<SseKey>) -> Self
pub fn new(active: u16, key: Arc<SseKey>) -> Self
Create a keyring seeded with one key, immediately marked
active. Add older keys later via SseKeyring::add so the
gateway can still decrypt pre-rotation objects.
Sourcepub fn add(&mut self, id: u16, key: Arc<SseKey>)
pub fn add(&mut self, id: u16, key: Arc<SseKey>)
Insert another key under id id. Does NOT change active. If
id == active, the slot is overwritten (useful for tests; in
production prefer minting a fresh id).
Sourcepub fn active(&self) -> (u16, &SseKey)
pub fn active(&self) -> (u16, &SseKey)
Active (id, key) — used by encrypt_v2 to pick the slot for
new objects.
Trait Implementations§
Source§impl Clone for SseKeyring
impl Clone for SseKeyring
Source§fn clone(&self) -> SseKeyring
fn clone(&self) -> SseKeyring
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SseKeyring
impl Debug for SseKeyring
Source§impl<'a> From<&'a SseKeyring> for SseSource<'a>
Back-compat coercion: existing call sites pass &SseKeyring
directly to decrypt. With this From impl the generic bound
Into<SseSource> accepts &SseKeyring without the caller writing
.into(), keeping v0.4 / v0.5 #29 service.rs callers compiling
untouched while v0.5 #27 SSE-C callers pass SseSource::CustomerKey
explicitly.
impl<'a> From<&'a SseKeyring> for SseSource<'a>
Back-compat coercion: existing call sites pass &SseKeyring
directly to decrypt. With this From impl the generic bound
Into<SseSource> accepts &SseKeyring without the caller writing
.into(), keeping v0.4 / v0.5 #29 service.rs callers compiling
untouched while v0.5 #27 SSE-C callers pass SseSource::CustomerKey
explicitly.