Trait cfxstore::SecretStore

source ·
pub trait SecretStore: SimpleSecretStore {
Show 14 methods // Required methods fn raw_secret( &self, account: &StoreAccountRef, password: &Password ) -> Result<OpaqueSecret, Error>; fn import_wallet( &self, vault: SecretVaultRef, json: &[u8], password: &Password, gen_id: bool ) -> Result<StoreAccountRef, Error>; fn copy_account( &self, new_store: &dyn SimpleSecretStore, new_vault: SecretVaultRef, account: &StoreAccountRef, password: &Password, new_password: &Password ) -> Result<(), Error>; fn test_password( &self, account: &StoreAccountRef, password: &Password ) -> Result<bool, Error>; fn public( &self, account: &StoreAccountRef, password: &Password ) -> Result<Public, Error>; fn uuid(&self, account: &StoreAccountRef) -> Result<Uuid, Error>; fn name(&self, account: &StoreAccountRef) -> Result<String, Error>; fn meta(&self, account: &StoreAccountRef) -> Result<String, Error>; fn set_name( &self, account: &StoreAccountRef, name: String ) -> Result<(), Error>; fn set_meta( &self, account: &StoreAccountRef, meta: String ) -> Result<(), Error>; fn local_path(&self) -> PathBuf; fn list_geth_accounts(&self, testnet: bool) -> Vec<Address>; fn import_geth_accounts( &self, vault: SecretVaultRef, desired: Vec<Address>, testnet: bool ) -> Result<Vec<StoreAccountRef>, Error>; // Provided method fn sign_with_secret( &self, secret: &OpaqueSecret, message: &Message ) -> Result<Signature, Error> { ... }
}
Expand description

Secret Store API

Required Methods§

source

fn raw_secret( &self, account: &StoreAccountRef, password: &Password ) -> Result<OpaqueSecret, Error>

Returns a raw opaque Secret that can be later used to sign a message.

source

fn import_wallet( &self, vault: SecretVaultRef, json: &[u8], password: &Password, gen_id: bool ) -> Result<StoreAccountRef, Error>

Imports existing JSON wallet

source

fn copy_account( &self, new_store: &dyn SimpleSecretStore, new_vault: SecretVaultRef, account: &StoreAccountRef, password: &Password, new_password: &Password ) -> Result<(), Error>

Copies account between stores and vaults.

source

fn test_password( &self, account: &StoreAccountRef, password: &Password ) -> Result<bool, Error>

Checks if password matches given account.

source

fn public( &self, account: &StoreAccountRef, password: &Password ) -> Result<Public, Error>

Returns a public key for given account.

source

fn uuid(&self, account: &StoreAccountRef) -> Result<Uuid, Error>

Returns uuid of an account.

source

fn name(&self, account: &StoreAccountRef) -> Result<String, Error>

Returns account’s name.

source

fn meta(&self, account: &StoreAccountRef) -> Result<String, Error>

Returns account’s metadata.

source

fn set_name(&self, account: &StoreAccountRef, name: String) -> Result<(), Error>

Modifies account metadata.

source

fn set_meta(&self, account: &StoreAccountRef, meta: String) -> Result<(), Error>

Modifies account name.

source

fn local_path(&self) -> PathBuf

Returns local path of the store.

source

fn list_geth_accounts(&self, testnet: bool) -> Vec<Address>

Lists all found geth accounts.

source

fn import_geth_accounts( &self, vault: SecretVaultRef, desired: Vec<Address>, testnet: bool ) -> Result<Vec<StoreAccountRef>, Error>

Imports geth accounts to the store/vault.

Provided Methods§

source

fn sign_with_secret( &self, secret: &OpaqueSecret, message: &Message ) -> Result<Signature, Error>

Signs a message with raw secret.

Implementors§