pub struct LocalKek { /* private fields */ }Expand description
AES-256-GCM envelope under a machine-local key-encryption key (KEK).
Implementations§
Source§impl LocalKek
impl LocalKek
Sourcepub fn from_bytes(kek: [u8; 32]) -> Self
pub fn from_bytes(kek: [u8; 32]) -> Self
Build from a raw 32-byte KEK.
Sourcepub fn load_or_generate(path: &Path) -> Result<Self, EnvelopeError>
pub fn load_or_generate(path: &Path) -> Result<Self, EnvelopeError>
Load the KEK from path (raw 32 bytes), generating + persisting one
(0600) if the file does not exist. In a cluster the same file must
be present on every node (wrapped certs replicate).
Trait Implementations§
Source§impl KeyEnvelope for LocalKek
impl KeyEnvelope for LocalKek
Source§fn wrap<'life0, 'life1, 'async_trait>(
&'life0 self,
plaintext: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, EnvelopeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn wrap<'life0, 'life1, 'async_trait>(
&'life0 self,
plaintext: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, EnvelopeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Wrap
plaintext, returning an opaque blob to store at rest.Auto Trait Implementations§
impl Freeze for LocalKek
impl RefUnwindSafe for LocalKek
impl Send for LocalKek
impl Sync for LocalKek
impl Unpin for LocalKek
impl UnsafeUnpin for LocalKek
impl UnwindSafe for LocalKek
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 more