[][src]Struct hkd32::mnemonic::Phrase

pub struct Phrase { /* fields omitted */ }

BIP39 mnemonic phrases: sequences of words representing cryptographic keys.

Implementations

impl Phrase[src]

pub fn random(rng: impl RngCore + CryptoRng, language: Language) -> Self[src]

Create a random BIP39 mnemonic phrase.

pub fn from_entropy(entropy: [u8; 32], language: Language) -> Self[src]

Create a new BIP39 mnemonic phrase from the given entropy

pub fn new<S>(phrase: S, language: Language) -> Result<Self, Error> where
    S: AsRef<str>, 
[src]

Create a new BIP39 mnemonic phrase from the given string.

The phrase supplied will be checked for word length and validated according to the checksum specified in BIP0039.

pub fn entropy(&self) -> &[u8; 32][src]

Get source entropy for this phrase.

pub fn phrase(&self) -> &str[src]

Get the mnemonic phrase as a string reference.

pub fn language(&self) -> Language[src]

Language this phrase's wordlist is for

pub fn derive_subkey(self, path: impl AsRef<Path>) -> KeyMaterial[src]

Convert this mnemonic phrase's entropy directly into key material. If you are looking for the shortest path between a mnemonic phrase and a key derivation hierarchy, this is it.

Note: that this does not follow the normal BIP39 derivation, which first applies PBKDF2 along with a secondary password. Use to_seed if you are interested in BIP39 compatibility. Derive a BIP32 subkey from this seed

pub fn to_seed(&self, password: &str) -> Seed[src]

Convert this mnemonic phrase into the BIP39 seed value.

This is only available when the bip39 Cargo feature is enabled.

Trait Implementations

impl Clone for Phrase[src]

impl Drop for Phrase[src]

impl From<Phrase> for KeyMaterial[src]

fn from(phrase: Phrase) -> KeyMaterial[src]

Convert to KeyMaterial using an empty password

Auto Trait Implementations

impl RefUnwindSafe for Phrase

impl Send for Phrase

impl Sync for Phrase

impl Unpin for Phrase

impl UnwindSafe for Phrase

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> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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.