Function gpgrv::verify_message
source · pub fn verify_message<R: BufRead, W: Write>(
from: R,
to: W,
keyring: &Keyring
) -> Result<(), Error>
Expand description
Verify the data in a document
Note that some data may be written out before the signature is verified, and you must not process this until the method has returned success.
§Example
use std::io::{stdin, stdout, BufReader, Seek, SeekFrom};
fn check_stdin(keyring: &gpgrv::Keyring) {
let mut temp = tempfile::tempfile().unwrap();
gpgrv::verify_message(BufReader::new(stdin()), &mut temp, keyring)
.expect("verification");
temp.seek(SeekFrom::Start(0)).unwrap();
std::io::copy(&mut temp, &mut stdout()).unwrap();
}