diff options
author | Neal H. Walfield <neal@pep.foundation> | 2019-12-19 21:47:19 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2019-12-19 21:51:19 +0100 |
commit | b3ba97146f534ac5cf67db7f72d8a633112d0a18 (patch) | |
tree | 581c64936f0a857dd1f0fbf75c7a4ddf243d8656 /openpgp/examples/decrypt-with.rs | |
parent | 2b2b5c8905d0e823d03b5ba2a115298e80e08b74 (diff) |
openpgp: Change KeyIter to return a struct instead of a tuple.
- A tuple is just an unnamed, inflexible struct. Use a struct
instead.
- Fixes #400.
Diffstat (limited to 'openpgp/examples/decrypt-with.rs')
-rw-r--r-- | openpgp/examples/decrypt-with.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/openpgp/examples/decrypt-with.rs b/openpgp/examples/decrypt-with.rs index 224a8726..7c924cc9 100644 --- a/openpgp/examples/decrypt-with.rs +++ b/openpgp/examples/decrypt-with.rs @@ -58,16 +58,17 @@ impl Helper { // Map (sub)KeyIDs to secrets. let mut keys = HashMap::new(); for cert in certs { - for (sig, _, key) in cert.keys_all() { - if sig.map(|s| (s.key_flags().for_storage_encryption() - || s.key_flags().for_transport_encryption())) + for ka in cert.keys_all() { + if ka.binding_signature(None) + .map(|s| (s.key_flags().for_storage_encryption() + || s.key_flags().for_transport_encryption())) .unwrap_or(false) { // This only works for unencrypted secret keys. if let Ok(keypair) = - key.clone().mark_parts_secret().unwrap().into_keypair() + ka.key().clone().mark_parts_secret().unwrap().into_keypair() { - keys.insert(key.keyid(), keypair); + keys.insert(ka.key().keyid(), keypair); } } } |