pub struct PairingKeyMaterial(/* private fields */);Expand description
Opaque, serialized pairing key material as held by
crate::protocol::DeRecSecretStore under SecretValue::PairingSecret.
This is the store-boundary form of the ephemeral key pair the pairing
handshake produces. The protocol deliberately exposes it as an opaque
byte blob rather than a cryptographic type, so a store implementation can
persist and reload it without depending on derec-cryptography or any
serialization framework: call as_bytes to obtain the
bytes to persist on save, and hand the same bytes back to
from_bytes on load.
The byte layout is a library-internal detail, is not part of the public API, and may change between versions; treat the blob as opaque and never interpret it.
The bytes are held in zeroize::Zeroizing so the plaintext key material
is wiped from memory on drop.
Implementations§
Source§impl PairingKeyMaterial
impl PairingKeyMaterial
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Self
pub fn from_bytes(bytes: Vec<u8>) -> Self
Wrap raw bytes previously obtained from as_bytes
and persisted by a store.
Sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
The opaque bytes to persist. Round-trips through
from_bytes.
Trait Implementations§
Source§impl Clone for PairingKeyMaterial
impl Clone for PairingKeyMaterial
Source§fn clone(&self) -> PairingKeyMaterial
fn clone(&self) -> PairingKeyMaterial
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PairingKeyMaterial
impl RefUnwindSafe for PairingKeyMaterial
impl Send for PairingKeyMaterial
impl Sync for PairingKeyMaterial
impl Unpin for PairingKeyMaterial
impl UnsafeUnpin for PairingKeyMaterial
impl UnwindSafe for PairingKeyMaterial
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
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> 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