pub struct SigningKey { /* private fields */ }Expand description
Taproot Schnorr signing key.
Implementations§
Source§impl SigningKey
impl SigningKey
Sourcepub fn from_bytes(bytes: &FieldBytes) -> Result<Self>
pub fn from_bytes(bytes: &FieldBytes) -> Result<Self>
Sourcepub fn from_slice(bytes: &[u8]) -> Result<Self>
pub fn from_slice(bytes: &[u8]) -> Result<Self>
Sourcepub fn to_bytes(&self) -> FieldBytes
pub fn to_bytes(&self) -> FieldBytes
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 as_nonzero_scalar(&self) -> &NonZeroScalar
pub fn as_nonzero_scalar(&self) -> &NonZeroScalar
Borrow the secret NonZeroScalar value for this key.
Security Warning
This value is key material. Please treat it with the care it deserves!
Trait Implementations§
Source§impl AsRef<VerifyingKey> for SigningKey
impl AsRef<VerifyingKey> for SigningKey
Source§fn as_ref(&self) -> &VerifyingKey
fn as_ref(&self) -> &VerifyingKey
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for SigningKey
impl Clone for SigningKey
Source§fn clone(&self) -> SigningKey
fn clone(&self) -> SigningKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SigningKey
impl Debug for SigningKey
Source§impl<D> DigestSigner<D, Signature> for SigningKey
impl<D> DigestSigner<D, Signature> for SigningKey
Source§impl Drop for SigningKey
impl Drop for SigningKey
Source§impl From<&SecretKey<Secp256k1>> for SigningKey
impl From<&SecretKey<Secp256k1>> for SigningKey
Source§fn from(secret_key: &SecretKey) -> SigningKey
fn from(secret_key: &SecretKey) -> SigningKey
Converts to this type from the input type.
Source§impl From<NonZeroScalar<Secp256k1>> for SigningKey
impl From<NonZeroScalar<Secp256k1>> for SigningKey
Source§fn from(secret_key: NonZeroScalar) -> SigningKey
fn from(secret_key: NonZeroScalar) -> SigningKey
Converts to this type from the input type.
Source§impl From<SecretKey<Secp256k1>> for SigningKey
impl From<SecretKey<Secp256k1>> for SigningKey
Source§fn from(secret_key: SecretKey) -> SigningKey
fn from(secret_key: SecretKey) -> SigningKey
Converts to this type from the input type.
Source§impl Generate for SigningKey
impl Generate for SigningKey
Source§fn try_generate_from_rng<R: TryCryptoRng + ?Sized>(
rng: &mut R,
) -> Result<Self, R::Error>
fn try_generate_from_rng<R: TryCryptoRng + ?Sized>( rng: &mut R, ) -> Result<Self, R::Error>
Generate random key using the provided
TryCryptoRng. Read moreSource§fn generate_from_rng<R>(rng: &mut R) -> Self
fn generate_from_rng<R>(rng: &mut R) -> Self
Generate random key using the provided
CryptoRng.Source§impl KeypairRef for SigningKey
impl KeypairRef for SigningKey
Source§type VerifyingKey = VerifyingKey
type VerifyingKey = VerifyingKey
Verifying key type for this keypair.
Source§impl MultipartSigner<Signature> for SigningKey
impl MultipartSigner<Signature> for SigningKey
Source§fn try_multipart_sign(&self, msg: &[&[u8]]) -> Result<Signature>
fn try_multipart_sign(&self, msg: &[&[u8]]) -> Result<Signature>
Equivalent of
Signer::try_sign() but the message is provided in non-contiguous byte
slices. Read moreSource§fn multipart_sign(&self, msg: &[&[u8]]) -> S
fn multipart_sign(&self, msg: &[&[u8]]) -> S
Equivalent of
Signer::sign() but the message is provided in non-contiguous byte slices.Source§impl PrehashSigner<Signature> for SigningKey
impl PrehashSigner<Signature> for SigningKey
Source§impl<D> RandomizedDigestSigner<D, Signature> for SigningKey
impl<D> RandomizedDigestSigner<D, Signature> for SigningKey
Source§impl RandomizedMultipartSigner<Signature> for SigningKey
impl RandomizedMultipartSigner<Signature> for SigningKey
Source§fn try_multipart_sign_with_rng<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
msg: &[&[u8]],
) -> Result<Signature>
fn try_multipart_sign_with_rng<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, msg: &[&[u8]], ) -> Result<Signature>
Equivalent of
RandomizedSigner::try_sign_with_rng() but the message is provided in
non-contiguous byte slices. Read moreSource§fn multipart_sign_with_rng<R>(&self, rng: &mut R, msg: &[&[u8]]) -> S
fn multipart_sign_with_rng<R>(&self, rng: &mut R, msg: &[&[u8]]) -> S
Equivalent of
RandomizedSigner::sign_with_rng() but the message is provided in
non-contiguous byte slices.Source§impl RandomizedPrehashSigner<Signature> for SigningKey
impl RandomizedPrehashSigner<Signature> for SigningKey
Source§fn sign_prehash_with_rng<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
prehash: &[u8],
) -> Result<Signature>
fn sign_prehash_with_rng<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, prehash: &[u8], ) -> Result<Signature>
Attempt to sign the given message digest, returning a digital signature on success, or an
error if something went wrong. Read more
Source§impl RandomizedSigner<Signature> for SigningKey
impl RandomizedSigner<Signature> for SigningKey
Source§fn try_sign_with_rng<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
msg: &[u8],
) -> Result<Signature>
fn try_sign_with_rng<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, msg: &[u8], ) -> Result<Signature>
Attempt to sign the given message, returning a digital signature on success, or an error if
something went wrong. Read more
Source§impl Signer<Signature> for SigningKey
impl Signer<Signature> for SigningKey
Source§impl TryFrom<&[u8]> for SigningKey
impl TryFrom<&[u8]> for SigningKey
impl ZeroizeOnDrop for SigningKey
Auto Trait Implementations§
impl Freeze for SigningKey
impl RefUnwindSafe for SigningKey
impl Send for SigningKey
impl Sync for SigningKey
impl Unpin for SigningKey
impl UnsafeUnpin for SigningKey
impl UnwindSafe for SigningKey
Blanket Implementations§
Source§impl<S, T> AsyncRandomizedSigner<S> for Twhere
T: RandomizedSigner<S>,
impl<S, T> AsyncRandomizedSigner<S> for Twhere
T: RandomizedSigner<S>,
Source§async fn try_sign_with_rng_async<R>(
&self,
rng: &mut R,
msg: &[u8],
) -> Result<S, Error>where
R: TryCryptoRng + ?Sized,
async fn try_sign_with_rng_async<R>(
&self,
rng: &mut R,
msg: &[u8],
) -> Result<S, Error>where
R: TryCryptoRng + ?Sized,
Attempt to sign the given message, returning a digital signature on success, or an error if
something went wrong. Read more
Source§impl<S, T> AsyncSigner<S> for Twhere
T: Signer<S>,
impl<S, T> AsyncSigner<S> for Twhere
T: Signer<S>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<K> Keypair for Kwhere
K: KeypairRef,
impl<K> Keypair for Kwhere
K: KeypairRef,
Source§type VerifyingKey = <K as KeypairRef>::VerifyingKey
type VerifyingKey = <K as KeypairRef>::VerifyingKey
Verifying key type for this keypair.
Source§fn verifying_key(&self) -> <K as Keypair>::VerifyingKey
fn verifying_key(&self) -> <K as Keypair>::VerifyingKey
Get the verifying key which can verify signatures produced by the
signing key portion of this keypair.
Source§impl<S, T> RandomizedSignerMut<S> for Twhere
T: RandomizedSigner<S>,
impl<S, T> RandomizedSignerMut<S> for Twhere
T: RandomizedSigner<S>,
Source§fn try_sign_with_rng<R>(&mut self, rng: &mut R, msg: &[u8]) -> Result<S, Error>where
R: TryCryptoRng + ?Sized,
fn try_sign_with_rng<R>(&mut self, rng: &mut R, msg: &[u8]) -> Result<S, Error>where
R: TryCryptoRng + ?Sized,
Attempt to sign the given message, updating the state, and returning a digital signature on
success, or an error if something went wrong. Read more