[−]Struct keys::SECP256K1
Methods from __Deref<Target = Secp256k1>
pub fn sign_schnorr(
&self,
msg: &Message,
sk: &SecretKey
) -> Result<Signature, Error>
pub fn sign_schnorr(
&self,
msg: &Message,
sk: &SecretKey
) -> Result<Signature, Error>
Create a Schnorr signature
pub fn verify_schnorr(
&self,
msg: &Message,
sig: &Signature,
pk: &PublicKey
) -> Result<(), Error>
pub fn verify_schnorr(
&self,
msg: &Message,
sig: &Signature,
pk: &PublicKey
) -> Result<(), Error>
Verify a Schnorr signature
pub fn recover_schnorr(
&self,
msg: &Message,
sig: &Signature
) -> Result<PublicKey, Error>
pub fn recover_schnorr(
&self,
msg: &Message,
sig: &Signature
) -> Result<PublicKey, Error>
Retrieves the public key for which sig
is a valid signature for msg
.
Requires a verify-capable context.
pub fn generate_keypair<R>(
&self,
rng: &mut R
) -> Result<(SecretKey, PublicKey), Error> where
R: Rng,
pub fn generate_keypair<R>(
&self,
rng: &mut R
) -> Result<(SecretKey, PublicKey), Error> where
R: Rng,
Generates a random keypair. Convenience function for key::SecretKey::new
and key::PublicKey::from_secret_key
; call those functions directly for
batch key generation. Requires a signing-capable context.
pub fn sign(&self, msg: &Message, sk: &SecretKey) -> Result<Signature, Error>
pub fn sign(&self, msg: &Message, sk: &SecretKey) -> Result<Signature, Error>
Constructs a signature for msg
using the secret key sk
and RFC6979 nonce
Requires a signing-capable context.
pub fn sign_recoverable(
&self,
msg: &Message,
sk: &SecretKey
) -> Result<RecoverableSignature, Error>
pub fn sign_recoverable(
&self,
msg: &Message,
sk: &SecretKey
) -> Result<RecoverableSignature, Error>
Constructs a signature for msg
using the secret key sk
and RFC6979 nonce
Requires a signing-capable context.
pub fn recover(
&self,
msg: &Message,
sig: &RecoverableSignature
) -> Result<PublicKey, Error>
pub fn recover(
&self,
msg: &Message,
sig: &RecoverableSignature
) -> Result<PublicKey, Error>
Determines the public key for which sig
is a valid signature for
msg
. Requires a verify-capable context.
pub fn verify(
&self,
msg: &Message,
sig: &Signature,
pk: &PublicKey
) -> Result<(), Error>
pub fn verify(
&self,
msg: &Message,
sig: &Signature,
pk: &PublicKey
) -> Result<(), Error>
Checks that sig
is a valid ECDSA signature for msg
using the public
key pubkey
. Returns Ok(true)
on success. Note that this function cannot
be used for Bitcoin consensus checking since there may exist signatures
which OpenSSL would verify but not libsecp256k1, or vice-versa. Requires a
verify-capable context.
Trait Implementations
impl __Deref for SECP256K1
impl __Deref for SECP256K1
type Target = Secp256k1
The resulting type after dereferencing.
fn deref(&self) -> &Secp256k1
fn deref(&self) -> &Secp256k1
Dereferences the value.
impl LazyStatic for SECP256K1
impl LazyStatic for SECP256K1
fn initialize(lazy: &Self)
fn initialize(lazy: &Self)
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T
[src]
fn borrow(&self) -> &T
Immutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more