[−][src]Struct hkd32::mnemonic::Phrase
BIP39 mnemonic phrases: sequences of words representing cryptographic keys.
Methods
impl Phrase
[src]
pub fn random(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]
S: AsRef<str>,
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 From<Phrase> for KeyMaterial
[src]
fn from(phrase: Phrase) -> KeyMaterial
[src]
Convert to KeyMaterial
using an empty password
impl Drop for Phrase
[src]
impl Clone for Phrase
[src]
Auto Trait Implementations
impl Unpin for Phrase
impl Send for Phrase
impl Sync for Phrase
impl UnwindSafe for Phrase
impl RefUnwindSafe for Phrase
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self