pub fn decrypt_key<P, S>(path: P, password: S) -> Result<Vec<u8>, KeystoreError> where
    P: AsRef<Path>,
    S: AsRef<[u8]>, 
Expand description

Decrypts an encrypted JSON keystore at the provided path using the provided password. Decryption supports the Scrypt and PBKDF2 key derivation functions.

Example

use eth_keystore::decrypt_key;
use std::path::Path;

let keypath = Path::new("./keys/my-key");
let private_key = decrypt_key(&keypath, "password_to_keystore")?;