[][src]Struct secp256k1::schnorrsig::KeyPair

pub struct KeyPair(_);

Opaque data structure that holds a keypair consisting of a secret and a public key.

Implementations

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_seckey_slice<C: Signing>(
    secp: &Secp256k1<C>,
    data: &[u8]
) -> Result<KeyPair, Error>
[src]

Creates a Schnorr KeyPair directly from a secret key slice

pub fn from_seckey_str<C: Signing>(
    secp: &Secp256k1<C>,
    s: &str
) -> Result<KeyPair, Error>
[src]

Creates a Schnorr KeyPair directly from a secret key string

pub fn new<R: Rng + ?Sized, C: Signing>(
    secp: &Secp256k1<C>,
    rng: &mut R
) -> KeyPair
[src]

Creates a new random secret key. Requires compilation with the "rand" feature.

pub fn tweak_add_assign<C: Verification>(
    &mut self,
    secp: &Secp256k1<C>,
    tweak: &[u8]
) -> Result<(), Error>
[src]

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 Clone for KeyPair[src]

impl Copy for KeyPair[src]

impl Debug for KeyPair[src]

impl Eq for KeyPair[src]

impl Hash for KeyPair[src]

impl Ord for KeyPair[src]

impl PartialEq<KeyPair> for KeyPair[src]

impl PartialOrd<KeyPair> for KeyPair[src]

impl StructuralEq for KeyPair[src]

impl StructuralPartialEq for KeyPair[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.