[−][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 KeyFile
pub 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 KeyFile
pub 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 KeyFile
fn clone(&self) -> KeyFile
[src]
fn clone(&self) -> KeyFile
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
impl From<Uuid> for KeyFile
[src]
impl From<Uuid> for KeyFile
impl From<KeyFile> for AccountInfo
[src]
impl From<KeyFile> for AccountInfo
impl Into<KeyFile> for HdwalletCrypto
[src]
impl Into<KeyFile> for HdwalletCrypto
impl Into<KeyFile> for CoreCrypto
[src]
impl Into<KeyFile> for CoreCrypto
impl Into<KeyFile> for SerializableKeyFileCore
[src]
impl Into<KeyFile> for SerializableKeyFileCore
impl Into<KeyFile> for SerializableKeyFileHD
[src]
impl Into<KeyFile> for SerializableKeyFileHD
impl Eq for KeyFile
[src]
impl Eq for KeyFile
impl PartialOrd<KeyFile> for KeyFile
[src]
impl PartialOrd<KeyFile> for KeyFile
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
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) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
This 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 KeyFile
impl PartialEq<KeyFile> for KeyFile
[src]
impl PartialEq<KeyFile> for KeyFile
fn eq(&self, other: &Self) -> bool
[src]
fn eq(&self, other: &Self) -> bool
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Ord for KeyFile
[src]
impl Ord for KeyFile
fn cmp(&self, other: &Self) -> Ordering
[src]
fn cmp(&self, other: &Self) -> Ordering
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Debug for KeyFile
[src]
impl Debug for KeyFile
impl Display for KeyFile
[src]
impl Display for KeyFile
impl Serialize for KeyFile
[src]
impl Serialize for KeyFile
impl<'de> Deserialize<'de> for KeyFile
[src]
impl<'de> Deserialize<'de> for KeyFile
fn 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 T
impl<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 T
impl<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) -> TypeId
impl<T> Same for T
impl<T> Same for T
type 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 T
impl<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