[−][src]Struct ethereum_keystore::keystore::KeyFile
A keystore file (account private core encrypted with a passphrase)
Fields
visible: Option<bool>Specifies if Keyfile is visible
name: Option<String>User specified name
description: Option<String>User specified description
address: AddressAddress
uuid: UuidUUID v4
crypto: CryptoTypeMethods
impl KeyFile[src]
pub fn decode(f: &str) -> Result<KeyFile, Error>[src]
Decode Keyfile from JSON
Handles different variants of crypto section
impl KeyFile[src]
pub fn new(
passphrase: &str,
sec_level: &KdfDepthLevel,
name: Option<String>,
description: Option<String>
) -> Result<KeyFile, Error>[src]
passphrase: &str,
sec_level: &KdfDepthLevel,
name: Option<String>,
description: Option<String>
) -> Result<KeyFile, Error>
Creates a new KeyFile with specified passphrase at random (rand::OsRng)
Arguments
passphrase- password for key derivation function
pub fn new_custom<R: Rng>(
pk: PrivateKey,
passphrase: &str,
kdf: Kdf,
rng: &mut R,
name: Option<String>,
description: Option<String>
) -> Result<KeyFile, Error>[src]
pk: PrivateKey,
passphrase: &str,
kdf: Kdf,
rng: &mut R,
name: Option<String>,
description: Option<String>
) -> Result<KeyFile, Error>
Creates a new KeyFile with specified PrivateKey, passphrase, key derivation function
and with given custom random generator
Arguments
pk- a private keypassphrase- password for key derivation functionkdf- customized key derivation functionrnd- predefined random number generator
pub fn decrypt_address(&self, password: &str) -> Result<Address, Error>[src]
Decrypt public address from keystore file by a password
pub fn decrypt_key(&self, passphrase: &str) -> Result<PrivateKey, Error>[src]
Decrypt private key from keystore file by a password
pub fn encrypt_key(&mut self, pk: PrivateKey, passphrase: &str)[src]
Encrypt a new private key for keystore file with a passphrase
pub fn encrypt_key_custom<R: Rng>(
&mut self,
pk: PrivateKey,
passphrase: &str,
rng: &mut R
)[src]
&mut self,
pk: PrivateKey,
passphrase: &str,
rng: &mut R
)
Encrypt a new private key for keystore file with a passphrase and with given custom random generator
Trait Implementations
impl Default for KeyFile[src]
impl Clone for KeyFile[src]
fn clone(&self) -> KeyFile[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Ord for KeyFile[src]
fn cmp(&self, other: &Self) -> Ordering[src]
fn max(self, other: Self) -> Self1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
Compares and returns the minimum of two values. Read more
impl From<KeyFile> for AccountInfo[src]
impl From<Uuid> for KeyFile[src]
impl Eq for KeyFile[src]
impl Into<KeyFile> for CoreCrypto[src]
impl Into<KeyFile> for SerializableKeyFileCore[src]
impl PartialOrd<KeyFile> for KeyFile[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool1.0.0[src]
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
This method tests greater than (for self and other) and is used by the > operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl PartialEq<KeyFile> for KeyFile[src]
fn eq(&self, other: &Self) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl Display for KeyFile[src]
impl Debug for KeyFile[src]
impl Serialize for KeyFile[src]
impl<'de> Deserialize<'de> for KeyFile[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Same for T
type Output = T
Should always be Self
impl<T> DeserializeOwned for T where
T: Deserialize<'de>, [src]
T: Deserialize<'de>,