Struct ethstore::EthStore [−][src]
pub struct EthStore { /* fields omitted */ }
Accounts store.
Methods
impl EthStore
[src]
impl EthStore
pub fn open(directory: Box<KeyDirectory>) -> Result<Self, Error>
[src]
pub fn open(directory: Box<KeyDirectory>) -> Result<Self, Error>
Open a new accounts store with given key directory backend.
pub fn open_with_iterations(
directory: Box<KeyDirectory>,
iterations: u32
) -> Result<Self, Error>
[src]
pub fn open_with_iterations(
directory: Box<KeyDirectory>,
iterations: u32
) -> Result<Self, Error>
Open a new account store with given key directory backend and custom number of iterations.
pub fn set_refresh_time(&self, time: Duration)
[src]
pub fn set_refresh_time(&self, time: Duration)
Modify account refresh timeout - how often they are re-read from KeyDirectory
.
Setting this to low values (or 0) will cause new accounts to be picked up quickly, although it may induce heavy disk reads and is not recommended if you manage many keys (say over 10k).
By default refreshing is disabled, so only accounts created using this instance of EthStore
are taken into account.
Trait Implementations
impl SimpleSecretStore for EthStore
[src]
impl SimpleSecretStore for EthStore
fn insert_account(
&self,
vault: SecretVaultRef,
secret: Secret,
password: &Password
) -> Result<StoreAccountRef, Error>
[src]
fn insert_account(
&self,
vault: SecretVaultRef,
secret: Secret,
password: &Password
) -> Result<StoreAccountRef, Error>
Inserts new accounts to the store (or vault) with given password.
fn insert_derived(
&self,
vault: SecretVaultRef,
account_ref: &StoreAccountRef,
password: &Password,
derivation: Derivation
) -> Result<StoreAccountRef, Error>
[src]
fn insert_derived(
&self,
vault: SecretVaultRef,
account_ref: &StoreAccountRef,
password: &Password,
derivation: Derivation
) -> Result<StoreAccountRef, Error>
Inserts new derived account to the store (or vault) with given password.
fn generate_derived(
&self,
account_ref: &StoreAccountRef,
password: &Password,
derivation: Derivation
) -> Result<Address, Error>
[src]
fn generate_derived(
&self,
account_ref: &StoreAccountRef,
password: &Password,
derivation: Derivation
) -> Result<Address, Error>
Generates new derived account.
fn account_ref(&self, address: &Address) -> Result<StoreAccountRef, Error>
[src]
fn account_ref(&self, address: &Address) -> Result<StoreAccountRef, Error>
Get reference to some account with given address. This method could be removed if we will guarantee that there is max(1) account for given address. Read more
fn accounts(&self) -> Result<Vec<StoreAccountRef>, Error>
[src]
fn accounts(&self) -> Result<Vec<StoreAccountRef>, Error>
Returns all accounts in this secret store.
fn change_password(
&self,
account: &StoreAccountRef,
old_password: &Password,
new_password: &Password
) -> Result<(), Error>
[src]
fn change_password(
&self,
account: &StoreAccountRef,
old_password: &Password,
new_password: &Password
) -> Result<(), Error>
Changes accounts password.
fn export_account(
&self,
account: &StoreAccountRef,
password: &Password
) -> Result<OpaqueKeyFile, Error>
[src]
fn export_account(
&self,
account: &StoreAccountRef,
password: &Password
) -> Result<OpaqueKeyFile, Error>
Exports key details for account.
fn remove_account(
&self,
account: &StoreAccountRef,
password: &Password
) -> Result<(), Error>
[src]
fn remove_account(
&self,
account: &StoreAccountRef,
password: &Password
) -> Result<(), Error>
Entirely removes account from the store and underlying storage.
fn sign(
&self,
account: &StoreAccountRef,
password: &Password,
message: &Message
) -> Result<Signature, Error>
[src]
fn sign(
&self,
account: &StoreAccountRef,
password: &Password,
message: &Message
) -> Result<Signature, Error>
Sign a message with given account.
fn sign_derived(
&self,
account_ref: &StoreAccountRef,
password: &Password,
derivation: Derivation,
message: &Message
) -> Result<Signature, Error>
[src]
fn sign_derived(
&self,
account_ref: &StoreAccountRef,
password: &Password,
derivation: Derivation,
message: &Message
) -> Result<Signature, Error>
Sign a message with derived account.
fn agree(
&self,
account: &StoreAccountRef,
password: &Password,
other: &Public
) -> Result<Secret, Error>
[src]
fn agree(
&self,
account: &StoreAccountRef,
password: &Password,
other: &Public
) -> Result<Secret, Error>
Agree on shared key.
fn decrypt(
&self,
account: &StoreAccountRef,
password: &Password,
shared_mac: &[u8],
message: &[u8]
) -> Result<Vec<u8>, Error>
[src]
fn decrypt(
&self,
account: &StoreAccountRef,
password: &Password,
shared_mac: &[u8],
message: &[u8]
) -> Result<Vec<u8>, Error>
Decrypt a messages with given account.
fn create_vault(&self, name: &str, password: &Password) -> Result<(), Error>
[src]
fn create_vault(&self, name: &str, password: &Password) -> Result<(), Error>
Create new vault with given password
fn open_vault(&self, name: &str, password: &Password) -> Result<(), Error>
[src]
fn open_vault(&self, name: &str, password: &Password) -> Result<(), Error>
Open vault with given password
fn close_vault(&self, name: &str) -> Result<(), Error>
[src]
fn close_vault(&self, name: &str) -> Result<(), Error>
Close vault
fn list_vaults(&self) -> Result<Vec<String>, Error>
[src]
fn list_vaults(&self) -> Result<Vec<String>, Error>
List all vaults
fn list_opened_vaults(&self) -> Result<Vec<String>, Error>
[src]
fn list_opened_vaults(&self) -> Result<Vec<String>, Error>
List all currently opened vaults
fn change_vault_password(
&self,
name: &str,
new_password: &Password
) -> Result<(), Error>
[src]
fn change_vault_password(
&self,
name: &str,
new_password: &Password
) -> Result<(), Error>
Change vault password
fn change_account_vault(
&self,
vault: SecretVaultRef,
account: StoreAccountRef
) -> Result<StoreAccountRef, Error>
[src]
fn change_account_vault(
&self,
vault: SecretVaultRef,
account: StoreAccountRef
) -> Result<StoreAccountRef, Error>
Cnage account' vault
fn get_vault_meta(&self, name: &str) -> Result<String, Error>
[src]
fn get_vault_meta(&self, name: &str) -> Result<String, Error>
Get vault metadata string.
fn set_vault_meta(&self, name: &str, meta: &str) -> Result<(), Error>
[src]
fn set_vault_meta(&self, name: &str, meta: &str) -> Result<(), Error>
Set vault metadata string.
impl SecretStore for EthStore
[src]
impl SecretStore for EthStore
fn raw_secret(
&self,
account: &StoreAccountRef,
password: &Password
) -> Result<OpaqueSecret, Error>
[src]
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.
fn import_presale(
&self,
vault: SecretVaultRef,
json: &[u8],
password: &Password
) -> Result<StoreAccountRef, Error>
[src]
fn import_presale(
&self,
vault: SecretVaultRef,
json: &[u8],
password: &Password
) -> Result<StoreAccountRef, Error>
Imports presale wallet
fn import_wallet(
&self,
vault: SecretVaultRef,
json: &[u8],
password: &Password,
gen_id: bool
) -> Result<StoreAccountRef, Error>
[src]
fn import_wallet(
&self,
vault: SecretVaultRef,
json: &[u8],
password: &Password,
gen_id: bool
) -> Result<StoreAccountRef, Error>
Imports existing JSON wallet
fn test_password(
&self,
account: &StoreAccountRef,
password: &Password
) -> Result<bool, Error>
[src]
fn test_password(
&self,
account: &StoreAccountRef,
password: &Password
) -> Result<bool, Error>
Checks if password matches given account.
fn copy_account(
&self,
new_store: &SimpleSecretStore,
new_vault: SecretVaultRef,
account: &StoreAccountRef,
password: &Password,
new_password: &Password
) -> Result<(), Error>
[src]
fn copy_account(
&self,
new_store: &SimpleSecretStore,
new_vault: SecretVaultRef,
account: &StoreAccountRef,
password: &Password,
new_password: &Password
) -> Result<(), Error>
Copies account between stores and vaults.
fn public(
&self,
account: &StoreAccountRef,
password: &Password
) -> Result<Public, Error>
[src]
fn public(
&self,
account: &StoreAccountRef,
password: &Password
) -> Result<Public, Error>
Returns a public key for given account.
fn uuid(&self, account: &StoreAccountRef) -> Result<Uuid, Error>
[src]
fn uuid(&self, account: &StoreAccountRef) -> Result<Uuid, Error>
Returns uuid of an account.
fn name(&self, account: &StoreAccountRef) -> Result<String, Error>
[src]
fn name(&self, account: &StoreAccountRef) -> Result<String, Error>
Returns account's name.
fn meta(&self, account: &StoreAccountRef) -> Result<String, Error>
[src]
fn meta(&self, account: &StoreAccountRef) -> Result<String, Error>
Returns account's metadata.
fn set_name(
&self,
account_ref: &StoreAccountRef,
name: String
) -> Result<(), Error>
[src]
fn set_name(
&self,
account_ref: &StoreAccountRef,
name: String
) -> Result<(), Error>
Modifies account metadata.
fn set_meta(
&self,
account_ref: &StoreAccountRef,
meta: String
) -> Result<(), Error>
[src]
fn set_meta(
&self,
account_ref: &StoreAccountRef,
meta: String
) -> Result<(), Error>
Modifies account name.
fn local_path(&self) -> PathBuf
[src]
fn local_path(&self) -> PathBuf
Returns local path of the store.
fn list_geth_accounts(&self, testnet: bool) -> Vec<Address>
[src]
fn list_geth_accounts(&self, testnet: bool) -> Vec<Address>
Lists all found geth accounts.
fn import_geth_accounts(
&self,
vault: SecretVaultRef,
desired: Vec<Address>,
testnet: bool
) -> Result<Vec<StoreAccountRef>, Error>
[src]
fn import_geth_accounts(
&self,
vault: SecretVaultRef,
desired: Vec<Address>,
testnet: bool
) -> Result<Vec<StoreAccountRef>, Error>
Imports geth accounts to the store/vault.
fn sign_with_secret(
&self,
secret: &OpaqueSecret,
message: &Message
) -> Result<Signature, Error>
[src]
fn sign_with_secret(
&self,
secret: &OpaqueSecret,
message: &Message
) -> Result<Signature, Error>
Signs a message with raw secret.