pub enum Secrecy {
TransportOnly,
Psk([u8; 32]),
Static {
our_secret: [u8; 32],
peer_public: [u8; 32],
},
}Expand description
End-to-end payload confidentiality, layered inside whatever the transport already provides.
Variants§
TransportOnly
No extra layer. Payloads are protected only by the transport (QUIC/TLS 1.3). Correct when both endpoints terminate their own TLS and you trust every hop; wrong if traffic crosses a relay you do not control.
Psk([u8; 32])
Ephemeral X25519 with a pre-shared key mixed into the KDF. Both sides must hold the same 32-byte secret; it authenticates the exchange and gives forward secrecy for recorded traffic.
Static
Static X25519 identity with the peer’s public key pinned, plus an ephemeral share. Mutual authentication without a PSK.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Secrecy
impl RefUnwindSafe for Secrecy
impl Send for Secrecy
impl Sync for Secrecy
impl Unpin for Secrecy
impl UnsafeUnpin for Secrecy
impl UnwindSafe for Secrecy
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
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> ⓘ
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