pub struct SessionSecretFactory(/* private fields */);
Expand description
This class handles keyring material for session keys, by allowing deterministic
derivation of SessionStaticSecret
objects based on labels.
Implementations§
Source§impl SessionSecretFactory
impl SessionSecretFactory
Sourcepub fn random_with_rng(rng: &mut (impl CryptoRng + RngCore)) -> Self
pub fn random_with_rng(rng: &mut (impl CryptoRng + RngCore)) -> Self
Creates a session secret factory using the given RNG.
Sourcepub fn from_secure_randomness(
seed: &[u8],
) -> Result<Self, InvalidSessionSecretFactorySeedLength>
pub fn from_secure_randomness( seed: &[u8], ) -> Result<Self, InvalidSessionSecretFactorySeedLength>
Creates a SessionSecretFactory
using the given random bytes.
Warning: make sure the given seed has been obtained from a cryptographically secure source of randomness!
Sourcepub fn make_key(&self, label: &[u8]) -> SessionStaticSecret
pub fn make_key(&self, label: &[u8]) -> SessionStaticSecret
Creates a SessionStaticSecret
deterministically from the given label.
Trait Implementations§
Source§impl Clone for SessionSecretFactory
impl Clone for SessionSecretFactory
Source§fn clone(&self) -> SessionSecretFactory
fn clone(&self) -> SessionSecretFactory
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Display for SessionSecretFactory
impl Display for SessionSecretFactory
Source§impl Drop for SessionSecretFactory
impl Drop for SessionSecretFactory
Source§impl PartialEq for SessionSecretFactory
impl PartialEq for SessionSecretFactory
impl StructuralPartialEq for SessionSecretFactory
Auto Trait Implementations§
impl Freeze for SessionSecretFactory
impl RefUnwindSafe for SessionSecretFactory
impl Send for SessionSecretFactory
impl Sync for SessionSecretFactory
impl Unpin for SessionSecretFactory
impl UnwindSafe for SessionSecretFactory
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> 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