summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2019-12-20 14:22:09 +0100
committerNeal H. Walfield <neal@pep.foundation>2019-12-20 14:22:09 +0100
commitf078f93025b517609d25ce2cb2ebc41a01d81190 (patch)
tree32766c92a0a6e7877b538d373cced9c9f0a97019 /openpgp/src/crypto
parentb3ba97146f534ac5cf67db7f72d8a633112d0a18 (diff)
openpgp: Simplify key iteration interface.
- Cert::keys_valid() is just a short-cut for Cert::keys_all().alive().revoked(false). - Remove Cert::keys_valid() and rename Cert::keys_all() to Cert::keys().
Diffstat (limited to 'openpgp/src/crypto')
-rw-r--r--openpgp/src/crypto/keygrip.rs2
-rw-r--r--openpgp/src/crypto/mpis.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/openpgp/src/crypto/keygrip.rs b/openpgp/src/crypto/keygrip.rs
index ecc1d4e7..cff25e6f 100644
--- a/openpgp/src/crypto/keygrip.rs
+++ b/openpgp/src/crypto/keygrip.rs
@@ -340,7 +340,7 @@ mod tests {
.iter().map(|n| (n, crate::Cert::from_bytes(crate::tests::key(n)).unwrap()))
{
eprintln!("{}", name);
- for key in cert.keys_all().map(|ka| ka.key()) {
+ for key in cert.keys().map(|ka| ka.key()) {
let fp = key.fingerprint();
eprintln!("(sub)key: {}", fp);
assert_eq!(&key.mpis().keygrip().unwrap(),
diff --git a/openpgp/src/crypto/mpis.rs b/openpgp/src/crypto/mpis.rs
index 2c62a82b..37f75213 100644
--- a/openpgp/src/crypto/mpis.rs
+++ b/openpgp/src/crypto/mpis.rs
@@ -1047,7 +1047,7 @@ mod tests {
("erika-corinna-daniela-simone-antonia-nistp521.pgp", 0, 521),
] {
let cert = crate::Cert::from_bytes(crate::tests::key(name)).unwrap();
- let key = cert.keys_all().nth(*key_no).unwrap().key();
+ let key = cert.keys().nth(*key_no).unwrap().key();
assert_eq!(key.mpis().bits().unwrap(), *bits,
"Cert {}, key no {}", name, *key_no);
}