Struct iop_keyvault::Bip32Node[][src]

pub struct Bip32Node<C: KeyDerivationCrypto + 'static> { /* fields omitted */ }

In BIP-0032 each extended private key has the same operations, independently from the actual path. This struct represents such an extended private key in a given subtree.

Implementations

impl<C: KeyDerivationCrypto + 'static> Bip32Node<C>[src]

pub fn new(
    path: Path,
    xsk: <C as KeyDerivationCrypto>::ExtendedPrivateKey,
    subtree: &'static dyn Subtree<Suite = C>
) -> Self
[src]

Backdoor for advanced or fringe non-standard use-cases. Use [Bip32.master] instead for normal use-cases.

pub fn path(&self) -> &Path[src]

Accessor for the BIP32 path of this node

pub fn xsk(&self) -> &<C as KeyDerivationCrypto>::ExtendedPrivateKey[src]

Accessor for the extended private key of this node

pub fn subtree(&self) -> &'static dyn Subtree<Suite = C>[src]

Accessor for the subtree of this node

pub fn neuter(&self) -> Bip32PublicNode<C>[src]

Removes the ability to sign and derive hardened keys. The public node it returns is still able to provide normal derivation and signature verifications.

pub fn derive_normal(&self, idx: i32) -> Result<Bip32Node<C>>[src]

Create a new node with normal (public) derivation with the given index.

pub fn derive_hardened(&self, idx: i32) -> Result<Bip32Node<C>>[src]

Create a new node with hardened (private) derivation with the given index.

pub fn private_key(&self) -> C::PrivateKey[src]

Creates the private key that belongs to this node for authenticating actions.

impl Bip32Node<Secp256k1>[src]

pub fn from_xprv(
    path: Path,
    xprv: impl AsRef<str>,
    network: &'static dyn Network<Suite = Secp256k1>
) -> Result<Bip32Node<Secp256k1>>
[src]

Recreates the BIP32 node from its parts

pub fn to_xprv(
    &self,
    network: &'static dyn Network<Suite = Secp256k1>
) -> String
[src]

Returns the extended private key in the BIP32 readable format with the version bytes of the network.

pub fn to_wif(&self, network: &'static dyn Network<Suite = Secp256k1>) -> String[src]

Returns the private key in the Wallet Import Format with the version byte of the network.

Trait Implementations

impl<C: Clone + KeyDerivationCrypto + 'static> Clone for Bip32Node<C>[src]

impl<C: KeyDerivationCrypto + 'static> Debug for Bip32Node<C>[src]

Auto Trait Implementations

impl<C> !RefUnwindSafe for Bip32Node<C>

impl<C> !Send for Bip32Node<C>

impl<C> !Sync for Bip32Node<C>

impl<C> Unpin for Bip32Node<C> where
    <C as KeyDerivationCrypto>::ExtendedPrivateKey: Unpin

impl<C> !UnwindSafe for Bip32Node<C>

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.

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