pub struct SecretKeyFactory(/* private fields */);Expand description
This class handles keyring material for Umbral, by allowing deterministic
derivation of SecretKey objects based on labels.
Implementations§
Source§impl SecretKeyFactory
impl SecretKeyFactory
Sourcepub fn random_with_rng(rng: &mut (impl CryptoRng + RngCore)) -> Self
pub fn random_with_rng(rng: &mut (impl CryptoRng + RngCore)) -> Self
Creates a secret key factory using the given RNG.
Sourcepub fn random() -> Self
Available on crate feature default-rng only.
pub fn random() -> Self
default-rng only.Creates a secret key factory using the default RNG.
Sourcepub fn seed_size() -> usize
pub fn seed_size() -> usize
Returns the seed size required by
from_secure_randomness.
Sourcepub fn from_secure_randomness(seed: &[u8]) -> Result<Self, SizeMismatchError>
pub fn from_secure_randomness(seed: &[u8]) -> Result<Self, SizeMismatchError>
Creates a secret key factory using the given random bytes.
Warning: make sure the given seed has been obtained from a cryptographically secure source of randomness!
Sourcepub fn make_secret(&self, label: &[u8]) -> SecretBox<GenericArray<u8, U64>>
pub fn make_secret(&self, label: &[u8]) -> SecretBox<GenericArray<u8, U64>>
Creates an untyped bytestring deterministically from the given label. This can be used externally to seed some kind of a secret key.
Sourcepub fn make_key(&self, label: &[u8]) -> SecretKey
pub fn make_key(&self, label: &[u8]) -> SecretKey
Creates a SecretKey deterministically from the given label.
Sourcepub fn make_factory(&self, label: &[u8]) -> Self
pub fn make_factory(&self, label: &[u8]) -> Self
Creates a SecretKeyFactory deterministically from the given label.
Trait Implementations§
Source§impl Clone for SecretKeyFactory
impl Clone for SecretKeyFactory
Source§fn clone(&self) -> SecretKeyFactory
fn clone(&self) -> SecretKeyFactory
Returns a duplicate 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 SecretKeyFactory
impl Display for SecretKeyFactory
Source§impl Drop for SecretKeyFactory
impl Drop for SecretKeyFactory
Source§impl PartialEq for SecretKeyFactory
impl PartialEq for SecretKeyFactory
impl StructuralPartialEq for SecretKeyFactory
Auto Trait Implementations§
impl Freeze for SecretKeyFactory
impl RefUnwindSafe for SecretKeyFactory
impl Send for SecretKeyFactory
impl Sync for SecretKeyFactory
impl Unpin for SecretKeyFactory
impl UnwindSafe for SecretKeyFactory
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