Struct ethers::core::k256::ecdsa::recoverable::Signature [−][src]
pub struct Signature { /* fields omitted */ }
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
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.
Given a public key, message digest, and signature, use trial recovery to determine if a suitable recovery ID exists, or return an error otherwise.
Recover the public key used to create the given signature as a
VerifyingKey
.
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: &GenericArray<u8, <<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>
) -> Result<VerifyingKey, Error>
pub fn recover_verify_key_from_digest_bytes(
&self,
digest_bytes: &GenericArray<u8, <<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>
) -> Result<VerifyingKey, Error>
Recover the public key used to create the given signature as a
VerifyingKey
from the raw bytes of a message digest.
Parse the r
component of this signature to a NonZeroScalar
Parse the s
component of this signature to a NonZeroScalar
Trait Implementations
pub fn try_sign_digest(&self, digest: D) -> Result<Signature, Error>
pub fn try_sign_digest(&self, digest: D) -> Result<Signature, Error>
pub fn try_sign_digest(&self, digest: D) -> Result<Signature, Error>
pub fn try_sign_digest(&self, digest: D) -> Result<Signature, Error>
Compute an Ethereum-style ECDSA/secp256k1 signature of the given digest
type Digest = Keccak256
type Digest = Keccak256
Preferred Digest
algorithm to use when computing this signature type.
Parse a signature from its byte representation
Auto Trait Implementations
impl RefUnwindSafe for Signature
impl UnwindSafe for Signature
Blanket Implementations
pub fn as_slice_of<T>(&self) -> Result<&[T], Error> where
T: FromByteSlice,
pub fn base32_len(&self) -> usize
pub fn base32_len(&self) -> usize
Calculate the base32 serialized length
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn write_base32<W>(
&self,
writer: &mut W
) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32,
pub fn write_base32<W>(
&self,
writer: &mut W
) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32,
Encode as base32 and write it to the supplied writer Implementations shouldn’t allocate. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more