pub struct EthereumWallet;
Expand description
Ethereum Wallet protocol.
Used in combination with the EthereumPersonalSignature2021
cryptographic
suite. The signer (the Ethereum Wallet) must prefix the message with
\x19Ethereum Signed Message:\n
followed by the byte length of the message
and send back the signature encoded in hexadecimal, with a 0x
prefix.
The recovery ID in the signature must start at 27 instead of 0.
Implementations§
Source§impl EthereumWallet
impl EthereumWallet
pub fn prepare_message(bytes: &[u8]) -> Vec<u8> ⓘ
pub fn encode_signature(signature: &[u8]) -> Vec<u8> ⓘ
pub fn decode_signature( encoded_signature: &[u8], ) -> Result<Vec<u8>, InvalidProtocolSignature>
Trait Implementations§
Source§impl Clone for EthereumWallet
impl Clone for EthereumWallet
Source§fn clone(&self) -> EthereumWallet
fn clone(&self) -> EthereumWallet
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for EthereumWallet
impl Debug for EthereumWallet
Source§impl<A> SignatureProtocol<A> for EthereumWallet
impl<A> SignatureProtocol<A> for EthereumWallet
fn prepare_message<'b>(&self, bytes: &'b [u8]) -> Cow<'b, [u8]>
fn encode_signature( &self, _algorithm: A, signature: Vec<u8>, ) -> Result<Vec<u8>, MessageSignatureError>
fn decode_signature<'s>( &self, encoded_signature: &'s [u8], ) -> Result<Cow<'s, [u8]>, InvalidProtocolSignature>
fn prepare_messages<'b>(&self, bytes: &'b [Vec<u8>]) -> Cow<'b, [Vec<u8>]>
impl Copy for EthereumWallet
Auto Trait Implementations§
impl Freeze for EthereumWallet
impl RefUnwindSafe for EthereumWallet
impl Send for EthereumWallet
impl Sync for EthereumWallet
impl Unpin for EthereumWallet
impl UnwindSafe for EthereumWallet
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
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
Returns a reference to the resource of type
T
.