Struct k256::ecdsa::SigningKey
source · pub struct SigningKey { /* private fields */ }
Expand description
ECDSA/secp256k1 signing key
Implementations§
source§impl SigningKey
impl SigningKey
sourcepub fn random(rng: impl CryptoRng + RngCore) -> Self
pub fn random(rng: impl CryptoRng + RngCore) -> Self
Generate a cryptographically random SigningKey
.
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Initialize SigningKey
from a raw scalar value (big endian).
sourcepub fn verifying_key(&self) -> VerifyingKey
pub fn verifying_key(&self) -> VerifyingKey
Get the VerifyingKey
which corresponds to this SigningKey
.
sourcepub fn to_bytes(&self) -> FieldBytes
pub fn to_bytes(&self) -> FieldBytes
Serialize this SigningKey
as bytes
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 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 ConstantTimeEq for SigningKey
impl ConstantTimeEq for SigningKey
source§impl Debug for SigningKey
impl Debug for SigningKey
source§impl<D> DigestSigner<D, Signature<Secp256k1>> for SigningKeywhere
D: Digest + FixedOutput<OutputSize = U32>,
impl<D> DigestSigner<D, Signature<Secp256k1>> for SigningKeywhere D: Digest + FixedOutput<OutputSize = U32>,
source§fn try_sign_digest(&self, msg_digest: D) -> Result<Signature>
fn try_sign_digest(&self, msg_digest: D) -> Result<Signature>
Attempt to sign the given prehashed message
Digest
, returning a
digital signature on success, or an error if something went wrong.source§fn sign_digest(&self, digest: D) -> S
fn sign_digest(&self, digest: D) -> S
source§impl<D> DigestSigner<D, Signature> for SigningKeywhere
D: Digest + FixedOutput<OutputSize = U32>,
impl<D> DigestSigner<D, Signature> for SigningKeywhere D: Digest + FixedOutput<OutputSize = U32>,
source§fn try_sign_digest(&self, msg_digest: D) -> Result<Signature>
fn try_sign_digest(&self, msg_digest: D) -> Result<Signature>
Attempt to sign the given prehashed message
Digest
, returning a
digital signature on success, or an error if something went wrong.source§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 From<&NonZeroScalar<Secp256k1>> for SigningKey
impl From<&NonZeroScalar<Secp256k1>> for SigningKey
source§fn from(secret_scalar: &NonZeroScalar) -> Self
fn from(secret_scalar: &NonZeroScalar) -> Self
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 From<&SigningKey> for SecretKey
impl From<&SigningKey> for SecretKey
source§fn from(signing_key: &SigningKey) -> SecretKey
fn from(signing_key: &SigningKey) -> SecretKey
Converts to this type from the input type.
source§impl From<&SigningKey> for VerifyingKey
impl From<&SigningKey> for VerifyingKey
source§fn from(signing_key: &SigningKey) -> VerifyingKey
fn from(signing_key: &SigningKey) -> VerifyingKey
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_scalar: NonZeroScalar) -> Self
fn from(secret_scalar: NonZeroScalar) -> Self
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 From<SigningKey> for SecretKey
impl From<SigningKey> for SecretKey
source§fn from(signing_key: SigningKey) -> SecretKey
fn from(signing_key: SigningKey) -> SecretKey
Converts to this type from the input type.
source§impl From<SigningKey> for VerifyingKey
impl From<SigningKey> for VerifyingKey
source§fn from(signing_key: SigningKey) -> VerifyingKey
fn from(signing_key: SigningKey) -> VerifyingKey
Converts to this type from the input type.
source§impl Keypair<Signature<Secp256k1>> for SigningKey
impl Keypair<Signature<Secp256k1>> for SigningKey
§type VerifyingKey = VerifyingKey
type VerifyingKey = VerifyingKey
Verifying key type for this keypair.
source§fn verifying_key(&self) -> &Self::VerifyingKey
fn verifying_key(&self) -> &Self::VerifyingKey
Get the verifying key which can verify signatures produced by the
signing key portion of this keypair.
source§impl PartialEq<SigningKey> for SigningKey
impl PartialEq<SigningKey> for SigningKey
source§fn eq(&self, other: &SigningKey) -> bool
fn eq(&self, other: &SigningKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PrehashSigner<Signature<Secp256k1>> for SigningKey
impl PrehashSigner<Signature<Secp256k1>> for SigningKey
source§impl PrehashSigner<Signature> for SigningKey
impl PrehashSigner<Signature> for SigningKey
source§impl<D> RandomizedDigestSigner<D, Signature<Secp256k1>> for SigningKeywhere
D: Digest + FixedOutput<OutputSize = U32>,
impl<D> RandomizedDigestSigner<D, Signature<Secp256k1>> for SigningKeywhere D: Digest + FixedOutput<OutputSize = U32>,
source§impl<D> RandomizedDigestSigner<D, Signature> for SigningKeywhere
D: Digest + FixedOutput<OutputSize = U32>,
impl<D> RandomizedDigestSigner<D, Signature> for SigningKeywhere D: Digest + FixedOutput<OutputSize = U32>,
source§impl<S> RandomizedSigner<S> for SigningKeywhere
S: PrehashSignature,
Self: RandomizedDigestSigner<S::Digest, S>,
impl<S> RandomizedSigner<S> for SigningKeywhere S: PrehashSignature, Self: RandomizedDigestSigner<S::Digest, S>,
source§impl<S> Signer<S> for SigningKeywhere
S: PrehashSignature,
Self: DigestSigner<S::Digest, S>,
impl<S> Signer<S> for SigningKeywhere S: PrehashSignature, Self: DigestSigner<S::Digest, S>,
impl Eq for SigningKey
impl ZeroizeOnDrop for SigningKey
Auto Trait Implementations§
impl RefUnwindSafe for SigningKey
impl Send for SigningKey
impl Sync for SigningKey
impl Unpin for SigningKey
impl UnwindSafe for SigningKey
Blanket Implementations§
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