Struct ethers::types::Signature [−][src]
Expand description
An ECDSA signature
Fields
r: U256
R value
s: U256
S Value
v: u64
V value in ‘Electrum’ notation.
Implementations
pub fn verify<M, A>(&self, message: M, address: A) -> Result<(), SignatureError> where
M: Into<RecoveryMessage>,
A: Into<H160>,
pub fn verify<M, A>(&self, message: M, address: A) -> Result<(), SignatureError> where
M: Into<RecoveryMessage>,
A: Into<H160>,
Verifies that signature on message
was produced by address
pub fn recover<M>(&self, message: M) -> Result<H160, SignatureError> where
M: Into<RecoveryMessage>,
pub fn recover<M>(&self, message: M) -> Result<H160, SignatureError> where
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
.
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Signature, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Signature, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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.
type Error = SignatureError
type Error = SignatureError
The type returned in the event of a conversion error.
Auto Trait Implementations
impl RefUnwindSafe for Signature
impl UnwindSafe for Signature
Blanket Implementations
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 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