Skip to main content

decrypt

Function decrypt 

Source
pub fn decrypt(data: &[u8], passphrase: &str) -> Result<Vec<u8>>
Expand description

Decrypt age-encrypted data with passphrase.

data must have been produced by encrypt (passphrase mode only — public-key recipients are rejected).

§Errors

Returns an error if:

  • the age header cannot be parsed,
  • the file was encrypted with a public-key recipient instead of a passphrase,
  • the passphrase is wrong, or
  • the underlying I/O fails.