Crate crypto_keystore_rs

Crate crypto_keystore_rs 

Source
Expand description

§crypto-keystore-rs

A multi-chain keystore library supporting Ethereum and Solana with the Web3 Secret Storage format.

§Example

use crypto_keystore_rs::{EthereumKeystore, ChainKey};

let keystore = EthereumKeystore::new("my_password").unwrap();
let uuid = keystore.save_to_file("./keystores").unwrap();

let loaded = EthereumKeystore::load_from_file(
    format!("./keystores/{}.json", uuid),
    "my_password"
).unwrap();

println!("Ethereum address: {}", loaded.key().unwrap().address());

Re-exports§

pub use chains::ChainKey;
pub use error::KeystoreError;
pub use error::Result;
pub use kdf_config::KdfConfig;
pub use kdf_config::KdfParams;
pub use kdf_config::KdfType;
pub use keystore::Keystore;
pub use keystore::KeystoreBuilder;
pub use keystore::KeystoreVersion;
pub use keystore::VERSION_3;
pub use keystore::VERSION_4;
pub use chains::EthereumKey;
pub use chains::SolanaKey;

Modules§

chains
error
kdf_config
keystore

Macros§

define_chain_key
Extended macro that includes ChainKey trait implementation skeleton.
impl_chain_key_boilerplate
Macro to reduce boilerplate when implementing new blockchain key types.

Type Aliases§

EthereumKeystore
SolanaKeystore