pub struct Keys { /* private fields */ }
Expand description
Keys
Implementations§
source§impl Keys
impl Keys
source§impl Keys
impl Keys
sourcepub fn new_with_ctx<C>(secp: &Secp256k1<C>, secret_key: SecretKey) -> Keyswhere
C: Signing,
pub fn new_with_ctx<C>(secp: &Secp256k1<C>, secret_key: SecretKey) -> Keyswhere C: Signing,
Initialize from secret key.
sourcepub fn from_public_key(public_key: XOnlyPublicKey) -> Keys
pub fn from_public_key(public_key: XOnlyPublicKey) -> Keys
Initialize with public key only (no secret key).
sourcepub fn generate_with_ctx<C, R>(secp: &Secp256k1<C>, rng: &mut R) -> Keyswhere
C: Signing,
R: Rng + ?Sized,
pub fn generate_with_ctx<C, R>(secp: &Secp256k1<C>, rng: &mut R) -> Keyswhere C: Signing, R: Rng + ?Sized,
sourcepub fn generate_without_keypair_with_ctx<C, R>(
secp: &Secp256k1<C>,
rng: &mut R
) -> Keyswhere
C: Signing,
R: Rng + ?Sized,
pub fn generate_without_keypair_with_ctx<C, R>( secp: &Secp256k1<C>, rng: &mut R ) -> Keyswhere C: Signing, R: Rng + ?Sized,
sourcepub fn public_key(&self) -> XOnlyPublicKey
pub fn public_key(&self) -> XOnlyPublicKey
Get XOnlyPublicKey
sourcepub fn secret_key(&self) -> Result<SecretKey, Error>
pub fn secret_key(&self) -> Result<SecretKey, Error>
Get secret key
sourcepub fn normalized_public_key_with_ctx<C>(
&self,
secp: &Secp256k1<C>
) -> Result<PublicKey, Error>where
C: Signing,
pub fn normalized_public_key_with_ctx<C>( &self, secp: &Secp256k1<C> ) -> Result<PublicKey, Error>where C: Signing,
Get PublicKey
Trait Implementations§
source§impl FromMnemonic for Keys
impl FromMnemonic for Keys
source§fn from_mnemonic<S>(
mnemonic: S,
passphrase: Option<S>
) -> Result<Keys, <Keys as FromMnemonic>::Err>where
S: Into<String>,
fn from_mnemonic<S>( mnemonic: S, passphrase: Option<S> ) -> Result<Keys, <Keys as FromMnemonic>::Err>where S: Into<String>,
Derive keys from BIP-39 mnemonics (ENGLISH wordlist).
source§fn from_mnemonic_with_ctx<C>(
secp: &Secp256k1<C>,
mnemonic: &str,
passphrase: Option<&str>
) -> Result<Keys, <Keys as FromMnemonic>::Err>where
C: Signing,
fn from_mnemonic_with_ctx<C>( secp: &Secp256k1<C>, mnemonic: &str, passphrase: Option<&str> ) -> Result<Keys, <Keys as FromMnemonic>::Err>where C: Signing,
Derive keys from BIP-39 mnemonics (ENGLISH wordlist).
type Err = Error
source§impl GenerateMnemonic for Keys
impl GenerateMnemonic for Keys
source§impl PartialEq<Keys> for Keys
impl PartialEq<Keys> for Keys
impl Copy for Keys
impl Eq for Keys
impl StructuralEq for Keys
impl StructuralPartialEq for Keys
Auto Trait Implementations§
impl RefUnwindSafe for Keys
impl Send for Keys
impl Sync for Keys
impl Unpin for Keys
impl UnwindSafe for Keys
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.