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 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: BlockInput + FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update,
impl<D> DigestSigner<D, Signature<Secp256k1>> for SigningKeywhere
D: BlockInput + FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update,
source§fn sign_digest(&self, digest: D) -> S
fn sign_digest(&self, digest: D) -> S
source§impl<D> DigestSigner<D, Signature> for SigningKeywhere
D: BlockInput + FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update,
impl<D> DigestSigner<D, Signature> for SigningKeywhere
D: BlockInput + FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update,
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.