Struct linkspace_cryptography::schnorr::SigningKey
source · pub struct SigningKey { /* private fields */ }Expand description
Taproot Schnorr signing key.
Implementations§
source§impl SigningKey
impl SigningKey
sourcepub fn random(rng: impl CryptoRng + RngCore) -> SigningKey
pub fn random(rng: impl CryptoRng + RngCore) -> SigningKey
Generate a cryptographically random SigningKey.
sourcepub fn from_bytes(bytes: &[u8]) -> Result<SigningKey, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<SigningKey, Error>
Parse signing key from big endian-encoded bytes.
sourcepub fn to_bytes(
&self
) -> GenericArray<u8, <<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>
pub fn to_bytes( &self ) -> GenericArray<u8, <<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>
Serialize as bytes.
sourcepub fn verifying_key(&self) -> &VerifyingKey
pub fn verifying_key(&self) -> &VerifyingKey
Get the VerifyingKey that corresponds to this signing key.
sourcepub fn try_sign_prehashed(
&self,
msg_digest: &[u8; 32],
aux_rand: &[u8; 32]
) -> Result<Signature, Error>
pub fn try_sign_prehashed( &self, msg_digest: &[u8; 32], aux_rand: &[u8; 32] ) -> Result<Signature, Error>
Compute Schnorr signature.
⚠️ Warning
This is a low-level interface intended only for unusual use cases involving signing pre-hashed messages.
The preferred interfaces are the Signer or RandomizedSigner traits.
Trait Implementations§
source§impl Clone for SigningKey
impl Clone for SigningKey
source§fn clone(&self) -> SigningKey
fn clone(&self) -> SigningKey
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<D> DigestSigner<D, Signature> for SigningKeywhere
D: Digest<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>> + FixedOutput,
impl<D> DigestSigner<D, Signature> for SigningKeywhere D: Digest<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>> + FixedOutput,
source§fn try_sign_digest(&self, digest: D) -> Result<Signature, Error>
fn try_sign_digest(&self, digest: D) -> Result<Signature, Error>
Attempt to sign the given prehashed message
Digest, returning a
digital signature on success, or an error if something went wrong.§fn sign_digest(&self, digest: D) -> S
fn sign_digest(&self, digest: D) -> S
source§impl Drop for SigningKey
impl Drop for SigningKey
source§impl<D> RandomizedDigestSigner<D, Signature> for SigningKeywhere
D: Digest<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>> + FixedOutput,
impl<D> RandomizedDigestSigner<D, Signature> for SigningKeywhere D: Digest<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>> + FixedOutput,
source§fn try_sign_digest_with_rng(
&self,
rng: impl CryptoRng + RngCore,
digest: D
) -> Result<Signature, Error>
fn try_sign_digest_with_rng( &self, rng: impl CryptoRng + RngCore, digest: D ) -> Result<Signature, Error>
Attempt to sign the given prehashed message
Digest, returning a
digital signature on success, or an error if something went wrong.§fn sign_digest_with_rng(&self, rng: impl CryptoRng + RngCore, digest: D) -> S
fn sign_digest_with_rng(&self, rng: impl CryptoRng + RngCore, digest: D) -> S
Sign the given prehashed message
Digest, returning a signature. Read moresource§impl RandomizedSigner<Signature> for SigningKey
impl RandomizedSigner<Signature> for SigningKey
source§fn try_sign_with_rng(
&self,
rng: impl CryptoRng + RngCore,
msg: &[u8]
) -> Result<Signature, Error>
fn try_sign_with_rng( &self, rng: impl CryptoRng + RngCore, msg: &[u8] ) -> Result<Signature, Error>
Attempt to sign the given message, returning a digital signature on
success, or an error if something went wrong. Read more
§fn sign_with_rng(&self, rng: impl CryptoRng + RngCore, msg: &[u8]) -> S
fn sign_with_rng(&self, rng: impl CryptoRng + RngCore, msg: &[u8]) -> S
Sign the given message and return a digital signature