pub struct Signature { /* private fields */ }
ecdsa-core
only.Expand description
Ethereum-style “recoverable signatures” which allow for the recovery of
the signer’s VerifyingKey
from the signature itself.
This format consists of Signature
followed by a 1-byte recovery Id
(65-bytes total):
r
: 32-byte integer, big endians
: 32-byte integer, big endianv
: 1-byte recoveryId
Implementations
Get the recovery Id
for this signature
pub fn from_trial_recovery(
public_key: &VerifyingKey,
msg: &[u8],
signature: &Signature
) -> Result<Self>
This is supported on crate features ecdsa
and keccak256
only.
pub fn from_trial_recovery(
public_key: &VerifyingKey,
msg: &[u8],
signature: &Signature
) -> Result<Self>
ecdsa
and keccak256
only.Given a public key, message, and signature, use trial recovery to determine if a suitable recovery ID exists, or return an error otherwise.
Assumes Keccak256 as the message digest function. Use
Signature::from_digest_trial_recovery
to support other
digest functions.
pub fn from_digest_trial_recovery<D>(
public_key: &VerifyingKey,
digest: D,
signature: &Signature
) -> Result<Self> where
D: Clone + Digest + FixedOutput<OutputSize = U32>,
This is supported on crate feature ecdsa
only.
pub fn from_digest_trial_recovery<D>(
public_key: &VerifyingKey,
digest: D,
signature: &Signature
) -> Result<Self> where
D: Clone + Digest + FixedOutput<OutputSize = U32>,
ecdsa
only.Given a public key, message digest, and signature, use trial recovery to determine if a suitable recovery ID exists, or return an error otherwise.
This is supported on crate features ecdsa
and keccak256
only.
ecdsa
and keccak256
only.Recover the public key used to create the given signature as a
VerifyingKey
.
pub fn recover_verify_key_from_digest<D>(
&self,
msg_digest: D
) -> Result<VerifyingKey> where
D: Digest<OutputSize = U32>,
This is supported on crate feature ecdsa
only.
pub fn recover_verify_key_from_digest<D>(
&self,
msg_digest: D
) -> Result<VerifyingKey> where
D: Digest<OutputSize = U32>,
ecdsa
only.Recover the public key used to create the given signature as a
VerifyingKey
from the provided precomputed Digest
.
pub fn recover_verify_key_from_digest_bytes(
&self,
digest_bytes: &FieldBytes
) -> Result<VerifyingKey>
This is supported on crate feature ecdsa
only.
pub fn recover_verify_key_from_digest_bytes(
&self,
digest_bytes: &FieldBytes
) -> Result<VerifyingKey>
ecdsa
only.Recover the public key used to create the given signature as a
VerifyingKey
from the raw bytes of a message digest.
This is supported on crate feature ecdsa
only.
ecdsa
only.Parse the r
component of this signature to a NonZeroScalar
This is supported on crate feature ecdsa
only.
ecdsa
only.Parse the s
component of this signature to a NonZeroScalar
Trait Implementations
impl<D> DigestSigner<D, Signature> for SigningKey where
D: CoreProxy + Digest + FixedOutput<OutputSize = U32>,
D::Core: BlockSizeUser + BufferKindUser<BufferKind = Eager> + Clone + Default + FixedOutputCore + HashMarker + OutputSizeUser<OutputSize = D::OutputSize>,
<D::Core as BlockSizeUser>::BlockSize: IsLess<U256>,
Le<<D::Core as BlockSizeUser>::BlockSize, U256>: NonZero,
impl<D> DigestSigner<D, Signature> for SigningKey where
D: CoreProxy + Digest + FixedOutput<OutputSize = U32>,
D::Core: BlockSizeUser + BufferKindUser<BufferKind = Eager> + Clone + Default + FixedOutputCore + HashMarker + OutputSizeUser<OutputSize = D::OutputSize>,
<D::Core as BlockSizeUser>::BlockSize: IsLess<U256>,
Le<<D::Core as BlockSizeUser>::BlockSize, U256>: NonZero,
impl<D> DigestVerifier<D, Signature> for VerifyingKey where
D: Digest + FixedOutput<OutputSize = U32>,
impl<D> DigestVerifier<D, Signature> for VerifyingKey where
D: Digest + FixedOutput<OutputSize = U32>,
impl<D> RandomizedDigestSigner<D, Signature> for SigningKey where
D: CoreProxy + Digest + FixedOutput<OutputSize = U32>,
D::Core: BlockSizeUser + BufferKindUser<BufferKind = Eager> + Clone + Default + FixedOutputCore + HashMarker + OutputSizeUser<OutputSize = D::OutputSize>,
<D::Core as BlockSizeUser>::BlockSize: IsLess<U256>,
Le<<D::Core as BlockSizeUser>::BlockSize, U256>: NonZero,
impl<D> RandomizedDigestSigner<D, Signature> for SigningKey where
D: CoreProxy + Digest + FixedOutput<OutputSize = U32>,
D::Core: BlockSizeUser + BufferKindUser<BufferKind = Eager> + Clone + Default + FixedOutputCore + HashMarker + OutputSizeUser<OutputSize = D::OutputSize>,
<D::Core as BlockSizeUser>::BlockSize: IsLess<U256>,
Le<<D::Core as BlockSizeUser>::BlockSize, U256>: NonZero,
Auto Trait Implementations
impl RefUnwindSafe for Signature
impl UnwindSafe for Signature
Blanket Implementations
Mutably borrows from an owned value. Read more