[][src]Function enc_file::decrypt_file

pub fn decrypt_file(enc: Vec<u8>, key: &str) -> Result<Vec<u8>, Box<dyn Error>>

Decrypts ciphertext (Vec) into cleartext (Vec) using provided key from keyfile. Returns result.

Examples

let key: &str = "an example very very secret key.";
let plaintext: Vec<u8> = decrypt_file(ciphertext, key).unwrap();
assert_eq!(format!("{:?}", text), format!("{:?}", plaintext));