[−][src]Struct ethereum_rust_utils::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: Address
Address
uuid: Uuid
UUID v4
crypto: CryptoType
Methods
impl KeyFile[src]
impl KeyFilepub fn decode(f: &str) -> Result<KeyFile, Error>[src]
pub fn decode(f: &str) -> Result<KeyFile, Error>Decode Keyfile from JSON
Handles different variants of crypto section
impl KeyFile[src]
impl KeyFilepub fn new(
passphrase: &str,
sec_level: &KdfDepthLevel,
name: Option<String>,
description: Option<String>
) -> Result<KeyFile, Error>[src]
pub fn new(
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]
pub fn new_custom<R: Rng>(
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]
pub fn decrypt_address(&self, password: &str) -> Result<Address, Error>Decrypt public address from keystore file by a password
pub fn decrypt_key(&self, passphrase: &str) -> Result<PrivateKey, Error>[src]
pub fn decrypt_key(&self, passphrase: &str) -> Result<PrivateKey, Error>Decrypt private key from keystore file by a password
pub fn encrypt_key(&mut self, pk: PrivateKey, passphrase: &str)[src]
pub fn encrypt_key(&mut self, pk: PrivateKey, passphrase: &str)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]
pub fn encrypt_key_custom<R: Rng>(
&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 Clone for KeyFile[src]
impl Clone for KeyFilefn clone(&self) -> KeyFile[src]
fn clone(&self) -> KeyFilefn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl From<Uuid> for KeyFile[src]
impl From<Uuid> for KeyFileimpl From<KeyFile> for AccountInfo[src]
impl From<KeyFile> for AccountInfoimpl Into<KeyFile> for HdwalletCrypto[src]
impl Into<KeyFile> for HdwalletCryptoimpl Into<KeyFile> for CoreCrypto[src]
impl Into<KeyFile> for CoreCryptoimpl Into<KeyFile> for SerializableKeyFileCore[src]
impl Into<KeyFile> for SerializableKeyFileCoreimpl Into<KeyFile> for SerializableKeyFileHD[src]
impl Into<KeyFile> for SerializableKeyFileHDimpl Eq for KeyFile[src]
impl Eq for KeyFileimpl PartialOrd<KeyFile> for KeyFile[src]
impl PartialOrd<KeyFile> for KeyFilefn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>#[must_use]
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn lt(&self, other: &Rhs) -> boolThis 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]
#[must_use]
fn le(&self, other: &Rhs) -> boolThis 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]
#[must_use]
fn gt(&self, other: &Rhs) -> boolThis 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]
#[must_use]
fn ge(&self, other: &Rhs) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Default for KeyFile[src]
impl Default for KeyFileimpl PartialEq<KeyFile> for KeyFile[src]
impl PartialEq<KeyFile> for KeyFilefn eq(&self, other: &Self) -> bool[src]
fn eq(&self, other: &Self) -> bool#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Ord for KeyFile[src]
impl Ord for KeyFilefn cmp(&self, other: &Self) -> Ordering[src]
fn cmp(&self, other: &Self) -> Orderingfn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl Debug for KeyFile[src]
impl Debug for KeyFileimpl Display for KeyFile[src]
impl Display for KeyFileimpl Serialize for KeyFile[src]
impl Serialize for KeyFileimpl<'de> Deserialize<'de> for KeyFile[src]
impl<'de> Deserialize<'de> for KeyFilefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, Auto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> ToString for T where
T: Display + ?Sized, [src]
impl<T> ToString for T where
T: Display + ?Sized, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, 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]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
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]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut Timpl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeIdimpl<T> Same for T
impl<T> Same for Ttype Output = T
Should always be Self
impl<T> DeserializeOwned for T where
T: Deserialize<'de>, [src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>, impl<T> Erased for T
impl<T> Erased for Timpl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, fn equivalent(&self, key: &K) -> bool[src]
fn equivalent(&self, key: &K) -> bool