pub fn decrypt<S>(
keystore: &KeyStore,
password: S,
) -> Result<Vec<u8>, KeyStoreError>Expand description
Decrypts an encrypted keystore using the provided password.
Decryption supports the Scrypt and PBKDF2 key derivation functions.
ยงExample
use web3_keystore::{decrypt, new_random};
let mut rng = rand::thread_rng();
let password = "super-secret-password";
let (keystore, secret) = new_random(&mut rng, password).unwrap();
let private_key = decrypt(&keystore, password).unwrap();
assert_eq!(secret, private_key);