pub struct LocalKeyCustody { /* private fields */ }Expand description
Local-tier KeyCustody: real AES-256-GCM under a single process-held KEK.
The KEK is baked into an Aes256Gcm key schedule at construction and the raw bytes are
not retained. std::fmt::Debug is hand-written to redact it regardless.
Implementations§
Source§impl LocalKeyCustody
impl LocalKeyCustody
Sourcepub fn from_env() -> Result<Self, KeyCustodyError>
pub fn from_env() -> Result<Self, KeyCustodyError>
Load the KEK from the environment. Precedence: FIRSTPASS_KEK (hex), then
FIRSTPASS_KEK_FILE (32 raw bytes).
§Errors
KeyCustodyError::MissingKekif neither is set.KeyCustodyError::BadKekif the value is malformed, the wrong length, or the file is unreadable.
Sourcepub fn from_lookup(
lookup: impl Fn(&str) -> Option<String>,
) -> Result<Self, KeyCustodyError>
pub fn from_lookup( lookup: impl Fn(&str) -> Option<String>, ) -> Result<Self, KeyCustodyError>
from_env with an injectable variable lookup — the testable seam
(mirrors crate::config::ProxyConfig::from_lookup), so KEK-loading tests need no
process-global env mutation.
§Errors
Same as from_env.
Trait Implementations§
Source§impl Debug for LocalKeyCustody
impl Debug for LocalKeyCustody
Source§impl KeyCustody for LocalKeyCustody
impl KeyCustody for LocalKeyCustody
Auto Trait Implementations§
impl Freeze for LocalKeyCustody
impl RefUnwindSafe for LocalKeyCustody
impl Send for LocalKeyCustody
impl Sync for LocalKeyCustody
impl Unpin for LocalKeyCustody
impl UnsafeUnpin for LocalKeyCustody
impl UnwindSafe for LocalKeyCustody
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.