pub struct KeyPair { /* private fields */ }Expand description
HDWallet extended key pair (Ed25519 extended private key + BIP32 ChainCode)
Implementations§
Source§impl KeyPair
impl KeyPair
Sourcepub fn chain_code(&self) -> ChainCode
pub fn chain_code(&self) -> ChainCode
Get BIP32 chain code
Sourcepub fn derive(&self, derivation_path: PrivateDerivationPath) -> Self
pub fn derive(&self, derivation_path: PrivateDerivationPath) -> Self
BIP32 derivation
Sourcepub fn from_mnemonic(mnemonic: &Mnemonic) -> Self
pub fn from_mnemonic(mnemonic: &Mnemonic) -> Self
Create key-pair from a mnemonic
Trait Implementations§
Source§impl KeyPair for KeyPair
impl KeyPair for KeyPair
Source§fn generate_signator(&self) -> Self::Signator
fn generate_signator(&self) -> Self::Signator
Generate signator.
Source§fn public_key(&self) -> PublicKey
fn public_key(&self) -> PublicKey
Get
PublicKeySource§fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), SigError>
fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), SigError>
Verify a signature with public key.
Source§fn upcast(self) -> KeyPairEnum
fn upcast(self) -> KeyPairEnum
Upcast to KeyPairEnum
impl Eq for KeyPair
impl StructuralPartialEq for KeyPair
Auto Trait Implementations§
impl Freeze for KeyPair
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnwindSafe for KeyPair
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more