[][src]Struct ethers_core::types::Signature

pub struct Signature {
    pub r: H256,
    pub s: H256,
    pub v: u64,
}

An ECDSA signature

Fields

r: H256

R value

s: H256

S Value

v: u64

V value in 'Electrum' notation.

Implementations

impl Signature[src]

pub fn verify<M, A>(&self, message: M, address: A) -> Result<(), SignatureError> where
    M: Into<RecoveryMessage>,
    A: Into<Address>, 
[src]

Verifies that signature on message was produced by address

pub fn recover<M>(&self, message: M) -> Result<Address, SignatureError> where
    M: Into<RecoveryMessage>, 
[src]

Recovers the Ethereum address which was used to sign the given message.

Recovery signature data uses 'Electrum' notation, this means the v value is expected to be either 27 or 28.

pub fn to_vec(&self) -> Vec<u8>[src]

Copies and serializes self into a new Vec with the recovery id included

Trait Implementations

impl Clone for Signature[src]

impl Debug for Signature[src]

impl<'de> Deserialize<'de> for Signature[src]

impl Display for Signature[src]

impl Eq for Signature[src]

impl<'_> From<&'_ Signature> for [u8; 65][src]

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

impl From<Signature> for [u8; 65][src]

impl From<Signature> for Vec<u8>[src]

impl FromStr for Signature[src]

type Err = SignatureError

The associated error which can be returned from parsing.

impl PartialEq<Signature> for Signature[src]

impl Serialize for Signature[src]

impl StructuralEq for Signature[src]

impl StructuralPartialEq for Signature[src]

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

type Error = SignatureError

The type returned in the event of a conversion error.

fn try_from(bytes: &'a [u8]) -> Result<Self, Self::Error>[src]

Parses a raw signature which is expected to be 65 bytes long where the first 32 bytes is the r value, the second 32 bytes the s value and the final byte is the v value in 'Electrum' notation.

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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> ToString for T where
    T: Display + ?Sized
[src]

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,