[][src]Macro sequoia_openpgp::armored

macro_rules! armored {
    ($data:expr) => { ... };
}

Constructs a reader from an armored string literal.

Example

use std::io::Read;
#[macro_use] extern crate sequoia_openpgp as openpgp;

let mut reader = armored!(
    "-----BEGIN PGP ARMORED FILE-----

     SGVsbG8gd29ybGQh
     =s4Gu
     -----END PGP ARMORED FILE-----"
);

let mut content = String::new();
reader.read_to_string(&mut content)?;
assert_eq!(content, "Hello world!");