Struct fuels_core::signature::Signature
source · [−]pub struct Signature {
pub compact: Bytes64,
}
Expand description
An ECDSA signature. Encoded as:
| 32 bytes || 32 bytes |
[256-bit r value][1-bit v value][255-bit s value]
The encoding of the signature was derived from Compact Signature Representation.
Signatures are represented as the r
and s
(each 32 bytes),
and v
(1-bit) values of the signature. r
and s
take on
their usual meaning while v
is used for recovering the public
key from a signature more quickly.
Fields
compact: Bytes64
Implementations
pub fn verify<M, A>(&self, message: M, address: A) -> Result<(), SignatureError> where
M: Into<RecoveryMessage>,
A: Into<Address>,
pub fn verify<M, A>(&self, message: M, address: A) -> Result<(), SignatureError> where
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>,
pub fn recover<M>(&self, message: M) -> Result<Address, SignatureError> where
M: Into<RecoveryMessage>,
Recovers the Fuel address which was used to sign the given message. Note that this message can be either the original message or its digest (hashed message). Both can be used to recover the address of the signature.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Signature
impl UnwindSafe for Signature
Blanket Implementations
Mutably borrows from an owned value. Read more