Struct nucypher_core::SessionSecretFactory
source · pub struct SessionSecretFactory(_);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<SessionSecretFactory> for SessionSecretFactory
impl PartialEq<SessionSecretFactory> for SessionSecretFactory
source§fn eq(&self, other: &SessionSecretFactory) -> bool
fn eq(&self, other: &SessionSecretFactory) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for SessionSecretFactory
Auto Trait Implementations§
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