Struct SeedStoreCreator

Source
pub struct SeedStoreCreator {}
Expand description

Helper class for creating the store from given data. Should be used only by the utility that creates the encrypted file. See also SeedStore.

Implementations§

Source§

impl SeedStoreCreator

Source

pub fn new_from_data( entropy: &Vec<u8>, network: Option<Network>, seed_passphrase: Option<&str>, ) -> Result<SeedStore, String>

Create a new store instance from given secret entropy bytes and network byte. The store can be written out to file using [write_to_file] Caution: unencrypted secret data is taken. entropy: the BIP39-style entropy bytes, with one of these lengths: 16 (12 BIP39 mnemonic words), 20 (15 words), 24 (18 words), 28 bytes (21 words), or 32 bytes (24 words).

  • network: Optionally a different bitcoin network can be specified, default is Mainnet/0 (also for None). seed_passphrase: Optional seed passphrase, needed to get the correct seed from the entropy (if it was used).
Source

pub fn write_to_file( seedstore: &SeedStore, path_for_secret_file: &str, encryption_password: &str, allow_weak_password: Option<Options>, ) -> Result<(), String>

Write out the encrypted contents to a file. [‘encryption_password’]: The passowrd to be used for encryption, should be strong. Minimal length of password is checked.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.