[][src]Struct k256::ecdsa::recoverable::Signature

pub struct Signature { /* fields omitted */ }
This is supported on feature="ecdsa-core" only.

Ethereum-style "recoverable signatures" which allow for the recovery of the signer's PublicKey from the signature itself.

This format consists of Signature followed by a 1-byte recovery Id (65-bytes total):

  • r: 32-byte integer, big endian
  • s: 32-byte integer, big endian
  • v: 1-byte recovery Id

Implementations

impl Signature[src]

pub fn new(signature: &Signature, recovery_id: Id) -> Self[src]

This is supported on feature="ecdsa-core" only.

Create a new recoverable ECDSA/secp256k1 signature from a regular fixed-size signature and an associated recovery Id.

This is an "unchecked" conversion and assumes the provided Id is valid for this signature.

pub fn from_trial_recovery(
    public_key: &PublicKey,
    msg: &[u8],
    signature: &Signature
) -> Result<Self, Error>
[src]

This is supported on feature="ecdsa-core" only.

Given a public key, message, and signature, use trial recovery for both possible recovery IDs in an attempt to determine if a suitable recovery ID exists, or return an error otherwise.

pub fn recovery_id(self) -> Id[src]

This is supported on feature="ecdsa-core" only.

Get the recovery Id for this signature

pub fn recover_pubkey(&self, msg: &[u8]) -> Result<PublicKey, Error>[src]

This is supported on feature="ecdsa-core" and feature="ecdsa" only.

Recover the PublicKey used to create the given signature

Trait Implementations

impl AsRef<[u8]> for Signature[src]

impl Clone for Signature[src]

impl Copy for Signature[src]

impl Debug for Signature[src]

impl Eq for Signature[src]

impl From<Signature> for Signature[src]

impl PartialEq<Signature> for Signature[src]

impl RandomizedSigner<Signature> for Signer[src]

impl Signature for Signature[src]

impl<'_> TryFrom<&'_ [u8]> for Signature[src]

type Error = Error

The type returned in the event of a conversion error.

impl Verifier<Signature> for Verifier[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.