[][src]Crate ethkey

Ethereum keys management supporting keystores in formats used by geth, parity and pyethereum.

Features

  • random key pair generation
  • key serialization/deserialization
  • keystore password change
  • signing and verification

Usage

[dependencies]
ethkey = "0.2"

Example

This code runs with edition 2018
use ethkey::prelude::*;

fn main() {
    let key = EthAccount::load_or_generate("/path/to/keystore", &"passwd".into())
        .expect("should load or generate new eth key");

    println!("{:?}", key.address())
}

Modules

prelude

A "prelude" for users of the ethkey crate.

Structs

Address

Ethereum address

Error

The Error type.

EthAccount

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.

PublicKey

Represents public part of the Ethereum key.

SecretKey

Represents the private part of the Ethereum key

Signature

Message signature

Enums

ErrorKind

The kind of an error.

Constants

KEY_ITERATIONS

HMAC fn iteration count; a compromise between security and performance

Traits

ResultExt

Additional methods for Result, for easy interaction with this crate.

Type Definitions

Message
Password
Result

Convenient wrapper around std::Result.