From 1434843469109127f41c5dbd8aacf5400c537759 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Thu, 14 Mar 2019 09:20:10 +0100 Subject: openpgp: Replace TPK::select_keys with an iterator. - TPK::select_keys mixes iterating and filtering. - Make KeyIter an implicit builder, which supports convenient filtering. - Provide a convenience function to key an iterator with a reasonable filter default. --- openpgp/examples/sign.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openpgp/examples/sign.rs') diff --git a/openpgp/examples/sign.rs b/openpgp/examples/sign.rs index c3ee0728..33e7625e 100644 --- a/openpgp/examples/sign.rs +++ b/openpgp/examples/sign.rs @@ -25,7 +25,7 @@ fn main() { let tsk = openpgp::TPK::from_file(filename) .expect("Failed to read key"); - for key in tsk.select_signing_keys(None) { + for key in tsk.keys_valid().signing_capable().map(|k| k.2) { if let Some(mut secret) = key.secret() { let secret_mpis = match secret { SecretKey::Encrypted { .. } => { -- cgit v1.2.3