Struct kaspa_bip32::ExtendedPrivateKey
source · pub struct ExtendedPrivateKey<K: PrivateKey> { /* private fields */ }
Expand description
Extended private keys derived using BIP32.
Generic around a PrivateKey
type.
Implementations§
source§impl<K> ExtendedPrivateKey<K>where
K: PrivateKey,
impl<K> ExtendedPrivateKey<K>where
K: PrivateKey,
sourcepub fn derive_child(&self, child_number: ChildNumber) -> Result<Self>
pub fn derive_child(&self, child_number: ChildNumber) -> Result<Self>
Derive a child key for a particular ChildNumber
.
pub fn derive_path(self, path: DerivationPath) -> Result<Self>
sourcepub fn private_key(&self) -> &K
pub fn private_key(&self) -> &K
Borrow the derived private key value.
sourcepub fn public_key(&self) -> ExtendedPublicKey<K::PublicKey>
pub fn public_key(&self) -> ExtendedPublicKey<K::PublicKey>
Serialize the derived public key as bytes.
sourcepub fn attrs(&self) -> &ExtendedKeyAttrs
pub fn attrs(&self) -> &ExtendedKeyAttrs
Get attributes for this key such as depth, parent fingerprint, child number, and chain code.
sourcepub fn to_bytes(&self) -> PrivateKeyBytes
pub fn to_bytes(&self) -> PrivateKeyBytes
Serialize the raw private key as a byte array.
sourcepub fn to_extended_key(&self, prefix: Prefix) -> ExtendedKey
pub fn to_extended_key(&self, prefix: Prefix) -> ExtendedKey
Serialize this key as an ExtendedKey
.
pub fn to_string(&self, prefix: Prefix) -> Zeroizing<String>
Trait Implementations§
source§impl<K: Clone + PrivateKey> Clone for ExtendedPrivateKey<K>
impl<K: Clone + PrivateKey> Clone for ExtendedPrivateKey<K>
source§fn clone(&self) -> ExtendedPrivateKey<K>
fn clone(&self) -> ExtendedPrivateKey<K>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<K> ConstantTimeEq for ExtendedPrivateKey<K>where
K: PrivateKey,
impl<K> ConstantTimeEq for ExtendedPrivateKey<K>where
K: PrivateKey,
source§impl<K> Debug for ExtendedPrivateKey<K>where
K: PrivateKey,
impl<K> Debug for ExtendedPrivateKey<K>where
K: PrivateKey,
source§impl<K> From<&ExtendedPrivateKey<K>> for ExtendedPublicKey<K::PublicKey>where
K: PrivateKey,
impl<K> From<&ExtendedPrivateKey<K>> for ExtendedPublicKey<K::PublicKey>where
K: PrivateKey,
source§fn from(xprv: &ExtendedPrivateKey<K>) -> ExtendedPublicKey<K::PublicKey>
fn from(xprv: &ExtendedPrivateKey<K>) -> ExtendedPublicKey<K::PublicKey>
Converts to this type from the input type.
source§impl<K> FromStr for ExtendedPrivateKey<K>where
K: PrivateKey,
impl<K> FromStr for ExtendedPrivateKey<K>where
K: PrivateKey,
source§impl<K> PartialEq for ExtendedPrivateKey<K>where
K: PrivateKey,
impl<K> PartialEq for ExtendedPrivateKey<K>where
K: PrivateKey,
NOTE: uses ConstantTimeEq
internally
source§impl<K> TryFrom<ExtendedKey> for ExtendedPrivateKey<K>where
K: PrivateKey,
impl<K> TryFrom<ExtendedKey> for ExtendedPrivateKey<K>where
K: PrivateKey,
source§fn try_from(extended_key: ExtendedKey) -> Result<ExtendedPrivateKey<K>>
fn try_from(extended_key: ExtendedKey) -> Result<ExtendedPrivateKey<K>>
Performs the conversion.
impl<K> Eq for ExtendedPrivateKey<K>where
K: PrivateKey,
NOTE: uses ConstantTimeEq
internally
Auto Trait Implementations§
impl<K> RefUnwindSafe for ExtendedPrivateKey<K>where
K: RefUnwindSafe,
impl<K> Send for ExtendedPrivateKey<K>where
K: Send,
impl<K> Sync for ExtendedPrivateKey<K>where
K: Sync,
impl<K> Unpin for ExtendedPrivateKey<K>where
K: Unpin,
impl<K> UnwindSafe for ExtendedPrivateKey<K>where
K: UnwindSafe,
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more