diff options
Diffstat (limited to 'openpgp/examples')
-rw-r--r-- | openpgp/examples/decrypt-with.rs | 2 | ||||
-rw-r--r-- | openpgp/examples/notarize.rs | 2 | ||||
-rw-r--r-- | openpgp/examples/sign-detached.rs | 2 | ||||
-rw-r--r-- | openpgp/examples/sign.rs | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/openpgp/examples/decrypt-with.rs b/openpgp/examples/decrypt-with.rs index 176e03de..a5b26baa 100644 --- a/openpgp/examples/decrypt-with.rs +++ b/openpgp/examples/decrypt-with.rs @@ -57,7 +57,7 @@ impl Helper { // Map (sub)KeyIDs to secrets. let mut keys = HashMap::new(); for tpk in tpks { - for (sig, _, key) in tpk.keys() { + for (sig, _, key) in tpk.keys_all() { if sig.map(|s| (s.key_flags().can_encrypt_at_rest() || s.key_flags().can_encrypt_for_transport())) .unwrap_or(false) diff --git a/openpgp/examples/notarize.rs b/openpgp/examples/notarize.rs index 5214ad9e..1b849376 100644 --- a/openpgp/examples/notarize.rs +++ b/openpgp/examples/notarize.rs @@ -30,7 +30,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 { .. } => { diff --git a/openpgp/examples/sign-detached.rs b/openpgp/examples/sign-detached.rs index 19dc771f..e558aa5e 100644 --- a/openpgp/examples/sign-detached.rs +++ b/openpgp/examples/sign-detached.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 { .. } => { 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 { .. } => { |