diff options
Diffstat (limited to 'examples/guide-exploring-openpgp.rs')
-rw-r--r-- | examples/guide-exploring-openpgp.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/guide-exploring-openpgp.rs b/examples/guide-exploring-openpgp.rs index e70c6361..05a777e4 100644 --- a/examples/guide-exploring-openpgp.rs +++ b/examples/guide-exploring-openpgp.rs @@ -2,8 +2,11 @@ extern crate sequoia_openpgp as openpgp; use crate::openpgp::parse::Parse; +use crate::openpgp::policy::StandardPolicy as P; fn main() { + let p = &P::new(); + let cert = "-----BEGIN PGP PUBLIC KEY BLOCK----- @@ -52,7 +55,7 @@ fn main() { println!("Fingerprint: {}", cert.fingerprint()); // List userids. - for (i, ca) in cert.userids().policy(None).enumerate() { + for (i, ca) in cert.userids().set_policy(p, None).enumerate() { println!("{}: UID: {}, {} self-signature(s), {} certification(s)", i, ca.userid(), ca.binding().self_signatures().len(), @@ -60,7 +63,7 @@ fn main() { } // List subkeys. - for (i, ka) in cert.keys().policy(None).skip(1).enumerate() { + for (i, ka) in cert.keys().set_policy(p, None).skip(1).enumerate() { println!("{}: Fingerprint: {}, {} self-signature(s), {} certification(s)", i, ka.key().fingerprint(), ka.binding().self_signatures().len(), |