Struct iop_keyvault::Bip32Node
source · [−]pub struct Bip32Node<C: KeyDerivationCrypto + 'static> { /* private fields */ }
Expand description
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
sourceimpl<C: KeyDerivationCrypto + 'static> Bip32Node<C>
impl<C: KeyDerivationCrypto + 'static> Bip32Node<C>
sourcepub fn new(
path: Path,
xsk: <C as KeyDerivationCrypto>::ExtendedPrivateKey,
subtree: &'static dyn Subtree<Suite = C>
) -> Self
pub fn new(
path: Path,
xsk: <C as KeyDerivationCrypto>::ExtendedPrivateKey,
subtree: &'static dyn Subtree<Suite = C>
) -> Self
Backdoor for advanced or fringe non-standard use-cases. Use [Bip32.master
] instead for normal use-cases.
sourcepub fn xsk(&self) -> &<C as KeyDerivationCrypto>::ExtendedPrivateKey
pub fn xsk(&self) -> &<C as KeyDerivationCrypto>::ExtendedPrivateKey
Accessor for the extended private key of this node
sourcepub fn neuter(&self) -> Bip32PublicNode<C>
pub fn neuter(&self) -> Bip32PublicNode<C>
Removes the ability to sign and derive hardened keys. The public node it returns is still able to provide normal derivation and signature verifications.
sourcepub fn derive_normal(&self, idx: i32) -> Result<Bip32Node<C>>
pub fn derive_normal(&self, idx: i32) -> Result<Bip32Node<C>>
Create a new node with normal (public) derivation with the given index.
sourcepub fn derive_hardened(&self, idx: i32) -> Result<Bip32Node<C>>
pub fn derive_hardened(&self, idx: i32) -> Result<Bip32Node<C>>
Create a new node with hardened (private) derivation with the given index.
sourcepub fn private_key(&self) -> C::PrivateKey
pub fn private_key(&self) -> C::PrivateKey
Creates the private key that belongs to this node for authenticating actions.
sourceimpl Bip32Node<Secp256k1>
impl Bip32Node<Secp256k1>
sourcepub fn from_xprv(
path: Path,
xprv: impl AsRef<str>,
network: &'static dyn Network<Suite = Secp256k1>
) -> Result<Bip32Node<Secp256k1>>
pub fn from_xprv(
path: Path,
xprv: impl AsRef<str>,
network: &'static dyn Network<Suite = Secp256k1>
) -> Result<Bip32Node<Secp256k1>>
Recreates the BIP32 node from its parts
Trait Implementations
sourceimpl<C: Clone + KeyDerivationCrypto + 'static> Clone for Bip32Node<C>
impl<C: Clone + KeyDerivationCrypto + 'static> Clone for Bip32Node<C>
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more