Struct keynesis_core::Seed
source · [−]pub struct Seed(_);
Implementations
sourceimpl Seed
impl Seed
pub const SIZE: usize
sourcepub fn generate<RNG>(rng: &mut RNG) -> Self where
RNG: RngCore + CryptoRng,
pub fn generate<RNG>(rng: &mut RNG) -> Self where
RNG: RngCore + CryptoRng,
Generate a random see with the given Cryptographically secure Random Number Generator (RNG).
This is useful to generate one time only Seed
that does not
need to be remembered or saved.
sourcepub fn derive_from_key<K, P>(key: K, password: P) -> Self where
K: AsRef<[u8]>,
P: AsRef<[u8]>,
pub fn derive_from_key<K, P>(key: K, password: P) -> Self where
K: AsRef<[u8]>,
P: AsRef<[u8]>,
it is possible to derive the Seed from a given key
the key may be given by a secure hardware or simply be a mnemonic phrase given by a user and a password.
It is possible, but not recommended, that the password is left empty. However, the key needs to be large enough to generate enough entropy for the derived seed.
sourcepub fn into_rand_chacha(self) -> ChaChaRng
pub fn into_rand_chacha(self) -> ChaChaRng
use this to seed a ChaCha RNG
then you can use the RNG to create new private key. This is an handy way to derive a private key from a key and a password (or an HSM and a password?)
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Seed
impl Send for Seed
impl Sync for Seed
impl Unpin for Seed
impl UnwindSafe for Seed
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToHex for T where
T: AsRef<[u8]>,
impl<T> ToHex for T where
T: AsRef<[u8]>,
sourcepub fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
pub fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
Encode the hex strict representing self
into the result. Lower case
letters are used (e.g. f9b4ca
) Read more
sourcepub fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
pub fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
Encode the hex strict representing self
into the result. Upper case
letters are used (e.g. F9B4CA
) Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more