pub struct DUMMY_USER_KEY { /* private fields */ }Methods from Deref<Target = Keypair>§
Sourcepub fn display_secret(&self) -> DisplaySecret
pub fn display_secret(&self) -> DisplaySecret
Formats the explicit byte value of the secret key kept inside the type as a little-endian hexadecimal string using the provided formatter.
This is the only method that outputs the actual secret key value, and, thus, should be used with extreme precaution.
§Example
use secp256k1::{Keypair, Secp256k1, SecretKey};
let secp = Secp256k1::new();
let key = SecretKey::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap();
let key = Keypair::from_secret_key(&secp, &key);
// Here we explicitly display the secret value:
assert_eq!(
"0000000000000000000000000000000000000000000000000000000000000001",
format!("{}", key.display_secret())
);
// Also, we can explicitly display with `Debug`:
assert_eq!(
format!("{:?}", key.display_secret()),
format!("DisplaySecret(\"{}\")", key.display_secret())
);Sourcepub fn cmp_fast_unstable(&self, other: &Keypair) -> Ordering
pub fn cmp_fast_unstable(&self, other: &Keypair) -> Ordering
Like cmp::Cmp but faster and with no guarantees across library versions.
The Cmp implementation for FFI types is stable but slow because it first
serializes self and other before comparing them. This function provides a faster
comparison if you know that your types come from the same library version.
Sourcepub fn eq_fast_unstable(&self, other: &Keypair) -> bool
pub fn eq_fast_unstable(&self, other: &Keypair) -> bool
Like cmp::Eq but faster and with no guarantees across library versions.
The Eq implementation for FFI types is stable but slow because it first serializes
self and other before comparing them. This function provides a faster equality
check if you know that your types come from the same library version.
Sourcepub fn as_ptr(&self) -> *const Keypair
👎Deprecated since 0.25.0: Use Self::as_c_ptr if you need to access the FFI layer
pub fn as_ptr(&self) -> *const Keypair
Obtains a raw const pointer suitable for use with FFI functions.
Sourcepub fn secret_bytes(&self) -> [u8; 32]
pub fn secret_bytes(&self) -> [u8; 32]
Returns the secret bytes for this key pair.
Sourcepub fn secret_key(&self) -> SecretKey
pub fn secret_key(&self) -> SecretKey
Returns the SecretKey for this Keypair.
This is equivalent to using SecretKey::from_keypair.
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Returns the PublicKey for this Keypair.
This is equivalent to using PublicKey::from_keypair.
Sourcepub fn x_only_public_key(&self) -> (XOnlyPublicKey, Parity)
pub fn x_only_public_key(&self) -> (XOnlyPublicKey, Parity)
Returns the XOnlyPublicKey (and it’s Parity) for this Keypair.
This is equivalent to using XOnlyPublicKey::from_keypair.