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

pub struct KeyPair(_);

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

Methods

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

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl PartialOrd<KeyPair> for KeyPair[src]

impl Clone for KeyPair[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<KeyPair> for KeyPair[src]

impl Eq for KeyPair[src]

impl Copy for KeyPair[src]

impl Debug for KeyPair[src]

impl Hash for KeyPair[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Unpin for KeyPair

impl Sync for KeyPair

impl Send for KeyPair

impl UnwindSafe for KeyPair

impl RefUnwindSafe for KeyPair

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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.

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

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

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