diff options
author | Neal H. Walfield <neal@pep.foundation> | 2019-12-20 14:22:09 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2019-12-20 14:22:09 +0100 |
commit | f078f93025b517609d25ce2cb2ebc41a01d81190 (patch) | |
tree | 32766c92a0a6e7877b538d373cced9c9f0a97019 /openpgp/src/crypto | |
parent | b3ba97146f534ac5cf67db7f72d8a633112d0a18 (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.rs | 2 | ||||
-rw-r--r-- | openpgp/src/crypto/mpis.rs | 2 |
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); } |