pub struct Keystore {
pub encoded: String,
pub encoding: Encoding,
pub address: String,
pub meta: Meta,
}Expand description
JSON keystore for storing sr25519 key pair.
Fields§
§encoded: StringThe encoded keypair in base64.
encoding: EncodingEncoding format.
address: StringThe address of the keypair.
meta: MetaThe meta data of the keypair.
Implementations§
Source§impl Keystore
impl Keystore
Sourcepub fn encrypt(keypair: Keypair, passphrase: Option<&[u8]>) -> Result<Self>
pub fn encrypt(keypair: Keypair, passphrase: Option<&[u8]>) -> Result<Self>
Encrypt the provided keypair with the given password.
Sourcepub fn encrypt_scrypt(info: KeypairInfo, passphrase: &[u8]) -> Result<Self>
pub fn encrypt_scrypt(info: KeypairInfo, passphrase: &[u8]) -> Result<Self>
Encrypt keypair info with scrypt.
Sourcepub fn encrypt_none(info: KeypairInfo) -> Result<Self>
pub fn encrypt_none(info: KeypairInfo) -> Result<Self>
Encrypt keypair without encryption.
Sourcepub fn decrypt(&self, passphrase: Option<&[u8]>) -> Result<Keypair>
pub fn decrypt(&self, passphrase: Option<&[u8]>) -> Result<Keypair>
Decrypt keypair from encrypted data.
Sourcepub fn decrypt_scrypt(&self, passphrase: &[u8]) -> Result<Keypair>
pub fn decrypt_scrypt(&self, passphrase: &[u8]) -> Result<Keypair>
Decrypt keypair from encrypted data with scrypt.
Sourcepub fn decrypt_none(&self) -> Result<Keypair>
pub fn decrypt_none(&self) -> Result<Keypair>
Decrypt keypair from data without encryption.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Keystore
impl<'de> Deserialize<'de> for Keystore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Keystore
impl RefUnwindSafe for Keystore
impl Send for Keystore
impl Sync for Keystore
impl Unpin for Keystore
impl UnwindSafe for Keystore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more