[][src]Struct ethkey::EthAccount

pub struct EthAccount { /* fields omitted */ }

An Ethereum Account keys with store. Allows to generate a new key pair and save it to disk as well as read existing keyfile. Provides sign and verify operations for ECC on curve Secp256k1.

Methods

impl EthAccount[src]

pub fn public(&self) -> &PublicKey[src]

public key

pub fn address(&self) -> &Address[src]

Ethereum address

pub fn sign(&self, msg: &Message) -> Result<Signature>[src]

signs given message with self secret key

pub fn verify(&self, sig: &Signature, msg: &Message) -> Result<bool>[src]

verifies signature for given message and self public key

pub fn load_or_generate<P, W>(file_path: P, password: W) -> Result<Box<Self>> where
    P: AsRef<Path>,
    W: Into<Password>, 
[src]

reads keys from disk or generates new ones and stores to disk; password needed

pub fn change_password<W: Into<Password>>(&self, new_password: W) -> Result<()>[src]

stores keys on disk with changed password

Trait Implementations

impl Display for EthAccount[src]

impl Debug for EthAccount[src]

Auto Trait Implementations

impl Send for EthAccount

impl Sync for EthAccount

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]