pub struct EthereumVerifier { /* private fields */ }Expand description
Ethereum ECDSA verifier.
Implementations§
Source§impl EthereumVerifier
impl EthereumVerifier
Sourcepub fn from_public_key_bytes(bytes: &[u8]) -> Result<Self, SignerError>
pub fn from_public_key_bytes(bytes: &[u8]) -> Result<Self, SignerError>
Create a verifier from raw compressed or uncompressed public key bytes.
Source§impl EthereumVerifier
impl EthereumVerifier
Sourcepub fn verify_typed_data(
&self,
domain_separator: &[u8; 32],
struct_hash: &[u8; 32],
signature: &EthereumSignature,
) -> Result<bool, SignerError>
pub fn verify_typed_data( &self, domain_separator: &[u8; 32], struct_hash: &[u8; 32], signature: &EthereumSignature, ) -> Result<bool, SignerError>
EIP-712: Verify a typed data signature.
Recomputes keccak256("\x19\x01" || domain_separator || struct_hash) and verifies.
Sourcepub fn verify_personal_sign(
&self,
message: &[u8],
signature: &EthereumSignature,
) -> Result<bool, SignerError>
pub fn verify_personal_sign( &self, message: &[u8], signature: &EthereumSignature, ) -> Result<bool, SignerError>
EIP-191: Verify a personal message signature.
Recomputes keccak256("\x19Ethereum Signed Message:\n{len}{message}") and verifies.
Trait Implementations§
Source§impl Verifier for EthereumVerifier
impl Verifier for EthereumVerifier
Source§type Signature = EthereumSignature
type Signature = EthereumSignature
The signature type this verifier accepts.
Source§type Error = SignerError
type Error = SignerError
The error type returned on failure.
Source§fn verify(
&self,
message: &[u8],
signature: &EthereumSignature,
) -> Result<bool, SignerError>
fn verify( &self, message: &[u8], signature: &EthereumSignature, ) -> Result<bool, SignerError>
Verify a signature against a raw message. The implementation applies
chain-specific hashing internally.
Source§fn verify_prehashed(
&self,
digest: &[u8],
signature: &EthereumSignature,
) -> Result<bool, SignerError>
fn verify_prehashed( &self, digest: &[u8], signature: &EthereumSignature, ) -> Result<bool, SignerError>
Verify a signature against a pre-hashed digest.
Auto Trait Implementations§
impl Freeze for EthereumVerifier
impl RefUnwindSafe for EthereumVerifier
impl Send for EthereumVerifier
impl Sync for EthereumVerifier
impl Unpin for EthereumVerifier
impl UnsafeUnpin for EthereumVerifier
impl UnwindSafe for EthereumVerifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more