[−][src]Struct emerald_rs::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
Implementations
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 Clone for KeyFile
[src]
impl Debug for KeyFile
[src]
impl Default 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>,
impl Display for KeyFile
[src]
impl Eq for KeyFile
[src]
impl From<KeyFile> for AccountInfo
[src]
impl From<Uuid> for KeyFile
[src]
impl Into<KeyFile> for HdwalletCrypto
[src]
impl Into<KeyFile> for CoreCrypto
[src]
impl Into<KeyFile> for SerializableKeyFileCore
[src]
impl Into<KeyFile> for SerializableKeyFileHD
[src]
impl Ord for KeyFile
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<KeyFile> for KeyFile
[src]
impl PartialOrd<KeyFile> for KeyFile
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for KeyFile
[src]
impl StructuralEq for KeyFile
[src]
Auto Trait Implementations
impl RefUnwindSafe for KeyFile
impl Send for KeyFile
impl Sync for KeyFile
impl Unpin for KeyFile
impl UnwindSafe for KeyFile
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,