[−][src]Struct ethers_core::types::Signature
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]
M: Into<RecoveryMessage>,
A: Into<Address>,
Verifies that signature on message
was produced by address
pub fn recover<M>(&self, message: M) -> Result<Address, SignatureError> where
M: Into<RecoveryMessage>,
[src]
M: Into<RecoveryMessage>,
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl PartialEq<Signature> for Signature
[src]
impl Serialize for Signature
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,