Struct bitcoin::util::schnorr::KeyPair [−][src]
pub struct KeyPair(_);
Opaque data structure that holds a keypair consisting of a secret and a public key.
Implementations
impl KeyPair
[src]
impl KeyPair
[src]pub fn as_ptr(&self) -> *const KeyPair
[src]
Obtains a raw const pointer suitable for use with FFI functions
pub fn as_mut_ptr(&mut self) -> *mut KeyPair
[src]
Obtains a raw mutable pointer suitable for use with FFI functions
pub fn from_secret_key<C>(secp: &Secp256k1<C>, sk: SecretKey) -> KeyPair where
C: Signing,
[src]
C: Signing,
Creates a Schnorr KeyPair directly from generic Secp256k1 secret key
Panics if internal representation of the provided [SecretKey
] does not
holds correct secret key value obtained from Secp256k1 library
previously
pub fn from_seckey_slice<C>(
secp: &Secp256k1<C>,
data: &[u8]
) -> Result<KeyPair, Error> where
C: Signing,
[src]
secp: &Secp256k1<C>,
data: &[u8]
) -> Result<KeyPair, Error> where
C: Signing,
Creates a Schnorr KeyPair directly from a secret key slice
pub fn from_seckey_str<C>(
secp: &Secp256k1<C>,
s: &str
) -> Result<KeyPair, Error> where
C: Signing,
[src]
secp: &Secp256k1<C>,
s: &str
) -> Result<KeyPair, Error> where
C: Signing,
Creates a Schnorr KeyPair directly from a secret key string
pub fn tweak_add_assign<C>(
&mut self,
secp: &Secp256k1<C>,
tweak: &[u8]
) -> Result<(), Error> where
C: Verification,
[src]
&mut self,
secp: &Secp256k1<C>,
tweak: &[u8]
) -> Result<(), Error> where
C: Verification,
Tweak a keypair by adding the given tweak to the secret key and updating the public key accordingly. Will return an error if the resulting key would be invalid or if the tweak was not a 32-byte length slice.
Trait Implementations
impl PartialOrd<KeyPair> for KeyPair
[src]
impl PartialOrd<KeyPair> for KeyPair
[src]