Struct ethstore::SafeAccount [−][src]
pub struct SafeAccount { pub id: [u8; 16], pub version: Version, pub address: Address, pub crypto: Crypto, pub filename: Option<String>, pub name: String, pub meta: String, }
Account representation.
Fields
id: [u8; 16]
Account ID
version: Version
Account version
address: Address
Account address
crypto: Crypto
Account private key derivation definition.
filename: Option<String>
Account filename
name: String
Account name
meta: String
Account metadata
Methods
impl SafeAccount
[src]
impl SafeAccount
pub fn create(
keypair: &KeyPair,
id: [u8; 16],
password: &Password,
iterations: u32,
name: String,
meta: String
) -> Result<Self, Error>
[src]
pub fn create(
keypair: &KeyPair,
id: [u8; 16],
password: &Password,
iterations: u32,
name: String,
meta: String
) -> Result<Self, Error>
Create a new account
pub fn from_file(json: KeyFile, filename: Option<String>) -> Self
[src]
pub fn from_file(json: KeyFile, filename: Option<String>) -> Self
Create a new SafeAccount
from the given json
; if it was read from a
file, the filename
should be Some
name. If it is as yet anonymous, then it
can be left None
.
pub fn from_vault_file(
password: &Password,
json: VaultKeyFile,
filename: Option<String>
) -> Result<Self, Error>
[src]
pub fn from_vault_file(
password: &Password,
json: VaultKeyFile,
filename: Option<String>
) -> Result<Self, Error>
Create a new SafeAccount
from the given vault json
; if it was read from a
file, the filename
should be Some
name. If it is as yet anonymous, then it
can be left None
.
pub fn into_vault_file(
self,
iterations: u32,
password: &Password
) -> Result<VaultKeyFile, Error>
[src]
pub fn into_vault_file(
self,
iterations: u32,
password: &Password
) -> Result<VaultKeyFile, Error>
Create a new VaultKeyFile
from the given self
pub fn sign(
&self,
password: &Password,
message: &Message
) -> Result<Signature, Error>
[src]
pub fn sign(
&self,
password: &Password,
message: &Message
) -> Result<Signature, Error>
Sign a message.
pub fn decrypt(
&self,
password: &Password,
shared_mac: &[u8],
message: &[u8]
) -> Result<Vec<u8>, Error>
[src]
pub fn decrypt(
&self,
password: &Password,
shared_mac: &[u8],
message: &[u8]
) -> Result<Vec<u8>, Error>
Decrypt a message.
pub fn agree(
&self,
password: &Password,
other: &Public
) -> Result<Secret, Error>
[src]
pub fn agree(
&self,
password: &Password,
other: &Public
) -> Result<Secret, Error>
Agree on shared key.
pub fn public(&self, password: &Password) -> Result<Public, Error>
[src]
pub fn public(&self, password: &Password) -> Result<Public, Error>
Derive public key.
pub fn change_password(
&self,
old_password: &Password,
new_password: &Password,
iterations: u32
) -> Result<Self, Error>
[src]
pub fn change_password(
&self,
old_password: &Password,
new_password: &Password,
iterations: u32
) -> Result<Self, Error>
Change account's password.
pub fn check_password(&self, password: &Password) -> bool
[src]
pub fn check_password(&self, password: &Password) -> bool
Check if password matches the account.
Trait Implementations
impl Debug for SafeAccount
[src]
impl Debug for SafeAccount
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for SafeAccount
[src]
impl PartialEq for SafeAccount
fn eq(&self, other: &SafeAccount) -> bool
[src]
fn eq(&self, other: &SafeAccount) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &SafeAccount) -> bool
[src]
fn ne(&self, other: &SafeAccount) -> bool
This method tests for !=
.
impl Clone for SafeAccount
[src]
impl Clone for SafeAccount
fn clone(&self) -> SafeAccount
[src]
fn clone(&self) -> SafeAccount
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl Send for SafeAccount
impl Send for SafeAccount
impl Sync for SafeAccount
impl Sync for SafeAccount