pub enum SseSource<'a> {
Keyring(&'a SseKeyring),
CustomerKey {
key: &'a [u8; 32],
key_md5: &'a [u8; 16],
},
Kms {
dek: &'a [u8; 32],
wrapped: &'a WrappedDek,
},
}Expand description
Source of the encryption key for encrypt_with_source /
decrypt. SSE-S4 (server-managed, rotation-aware) goes through
Keyring; SSE-C (customer-supplied) goes through CustomerKey.
Borrowed (not owned) so the caller can hold a long-lived
CustomerKeyMaterial next to the request and just lend it for the
duration of one PUT/GET.
Variants§
Keyring(&'a SseKeyring)
Server-managed keyring path → produces / consumes S4E1 (legacy) or S4E2 (rotation-aware) frames.
CustomerKey
Client-supplied AES-256 key + its MD5 fingerprint → produces /
consumes S4E3 frames. The server never persists the key; it
stores key_md5 only.
Kms
SSE-KMS envelope → produces / consumes S4E4 frames. The server
holds a per-object plaintext DEK (from a fresh
KmsBackend::generate_dek call) and the wrapped form to
persist alongside the body. The DEK is dropped after one
PUT/GET; only the wrapped form survives at rest.
Fields
wrapped: &'a WrappedDekWrapped form to persist in the S4E4 frame (PUT) or the one read out of the frame (GET, after a successful unwrap).
Trait Implementations§
impl<'a> Copy for SseSource<'a>
Source§impl<'a> From<&'a Arc<SseKeyring>> for SseSource<'a>
service.rs holds keyring as Option<Arc<SseKeyring>> and unwraps to
&Arc<SseKeyring> — let that coerce too, otherwise every existing
call site needs .as_ref() boilerplate.
impl<'a> From<&'a Arc<SseKeyring>> for SseSource<'a>
service.rs holds keyring as Option<Arc<SseKeyring>> and unwraps to
&Arc<SseKeyring> — let that coerce too, otherwise every existing
call site needs .as_ref() boilerplate.
Source§fn from(kr: &'a Arc<SseKeyring>) -> Self
fn from(kr: &'a Arc<SseKeyring>) -> Self
Source§impl<'a> From<&'a CustomerKeyMaterial> for SseSource<'a>
impl<'a> From<&'a CustomerKeyMaterial> for SseSource<'a>
Source§fn from(m: &'a CustomerKeyMaterial) -> Self
fn from(m: &'a CustomerKeyMaterial) -> Self
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<'a> Freeze for SseSource<'a>
impl<'a> RefUnwindSafe for SseSource<'a>
impl<'a> Send for SseSource<'a>
impl<'a> Sync for SseSource<'a>
impl<'a> Unpin for SseSource<'a>
impl<'a> UnsafeUnpin for SseSource<'a>
impl<'a> UnwindSafe for SseSource<'a>
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