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.
Source§fn from(kr: &'a SseKeyring) -> Self
fn from(kr: &'a SseKeyring) -> Self
Auto Trait Implementations§
impl Freeze for SseKeyring
impl RefUnwindSafe for SseKeyring
impl Send for SseKeyring
impl Sync for SseKeyring
impl Unpin for SseKeyring
impl UnsafeUnpin for SseKeyring
impl UnwindSafe for SseKeyring
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more