From d6ed2a3cbb18c50c2da73d5efbdade343e3bad12 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 6 Feb 2020 14:49:01 +0100 Subject: openpgp: Rename methods 'set_policy' to 'with_policy'. - Fixes #427. --- tool/src/commands/decrypt.rs | 2 +- tool/src/commands/inspect.rs | 4 ++-- tool/src/commands/mod.rs | 4 ++-- tool/tests/sq-sign.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tool') diff --git a/tool/src/commands/decrypt.rs b/tool/src/commands/decrypt.rs index c1a35dd6..ba71689e 100644 --- a/tool/src/commands/decrypt.rs +++ b/tool/src/commands/decrypt.rs @@ -55,7 +55,7 @@ impl<'a> Helper<'a> { for ka in tsk.keys() // XXX: Should use the message's creation time that we do not know. - .set_policy(policy, None) + .with_policy(policy, None) .for_transport_encryption().for_storage_encryption() .secret() { diff --git a/tool/src/commands/inspect.rs b/tool/src/commands/inspect.rs index a70524e5..53bf80e8 100644 --- a/tool/src/commands/inspect.rs +++ b/tool/src/commands/inspect.rs @@ -142,7 +142,7 @@ fn inspect_cert(policy: &dyn Policy, print_keygrips, print_certifications)?; writeln!(output)?; - for vka in cert.keys().skip_primary().set_policy(policy, None) { + for vka in cert.keys().skip_primary().with_policy(policy, None) { writeln!(output, " Subkey: {}", vka.key().fingerprint())?; inspect_revocation(output, "", vka.revoked())?; inspect_key(policy, output, "", vka.into(), @@ -214,7 +214,7 @@ fn inspect_key(policy: &dyn Policy, { let key = ka.key(); let binding = ka.bundle(); - let vka = match ka.set_policy(policy, None) { + let vka = match ka.with_policy(policy, None) { Ok(vka) => { if let Err(e) = vka.alive() { writeln!(output, "{} Invalid: {}", indent, e)?; diff --git a/tool/src/commands/mod.rs b/tool/src/commands/mod.rs index f4abe71f..d6c6f2b5 100644 --- a/tool/src/commands/mod.rs +++ b/tool/src/commands/mod.rs @@ -51,7 +51,7 @@ fn get_signing_keys(certs: &[openpgp::Cert], p: &dyn Policy, { let mut keys = Vec::new(); 'next_cert: for tsk in certs { - for key in tsk.keys().set_policy(p, timestamp).alive().revoked(false) + for key in tsk.keys().with_policy(p, timestamp).alive().revoked(false) .for_signing() .map(|ka| ka.key()) { @@ -116,7 +116,7 @@ pub fn encrypt(policy: &dyn Policy, let mut recipient_subkeys: Vec = Vec::new(); for cert in certs.iter() { let mut count = 0; - for key in cert.keys().set_policy(policy, None).alive().revoked(false) + for key in cert.keys().with_policy(policy, None).alive().revoked(false) .key_flags(&mode).map(|ka| ka.key()) { recipient_subkeys.push(key.into()); diff --git a/tool/tests/sq-sign.rs b/tool/tests/sq-sign.rs index c89142fc..49dc0714 100644 --- a/tool/tests/sq-sign.rs +++ b/tool/tests/sq-sign.rs @@ -211,7 +211,7 @@ fn sq_sign_append_on_compress_then_sign() { // message by foot. let tsk = Cert::from_file(&artifact("keys/dennis-simon-anton-private.pgp")) .unwrap(); - let key = tsk.keys().set_policy(p, None).for_signing().nth(0).unwrap().key(); + let key = tsk.keys().with_policy(p, None).for_signing().nth(0).unwrap().key(); let sec = match key.secret() { Some(SecretKeyMaterial::Unencrypted(ref u)) => u.clone(), _ => unreachable!(), -- cgit v1.2.3