Struct keynesis::Seed[][src]

pub struct Seed(_);

Implementations

impl Seed[src]

pub const SIZE: usize[src]

pub fn generate<RNG>(rng: &mut RNG) -> Self where
    RNG: RngCore + CryptoRng
[src]

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.

pub fn derive_from_key<K, P>(key: K, password: P) -> Self where
    K: AsRef<[u8]>,
    P: AsRef<[u8]>, 
[src]

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.

pub fn into_rand_chacha(self) -> ChaChaRng[src]

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

impl AsRef<[u8]> for Seed[src]

impl Clone for Seed[src]

impl Debug for Seed[src]

impl Display for Seed[src]

impl Drop for Seed[src]

impl From<[u8; 32]> for Seed[src]

impl FromStr for Seed[src]

type Err = FromHexError

The associated error which can be returned from parsing.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToHex for T where
    T: AsRef<[u8]>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,