diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-08-12 15:48:36 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-08-12 15:55:09 +0200 |
commit | d4fe2832c9bf1d49b87a301bd0a46caa45018477 (patch) | |
tree | 2dbdf9b430456aec4a7878cc6ab53abe92166876 /openpgp/src/cert/mod.rs | |
parent | 2aa8c003a99afef4e8199e92cfa403a5048cdf7c (diff) |
openpgp: Change accessors to return all issuers.
- Unlike the `Signature Creation Time` subpacket, there are
legitimate reasons to have multiple `Issuer` subpackets and
`Issuer Fingerprint` subpackets.
- Rename `SubpacketAreas::issuer` to `SubpacketAreas::issuers` and
return all `Issuer` subpackets.
- Likewise, Rename `SubpacketAreas::issuer_fingerprint` to
`SubpacketAreas::issuer_fingerprints` and return all `Issuer
Fingerprint` subpackets.
- Change `sq` to list all issuers. Deduplicate first, however.
Diffstat (limited to 'openpgp/src/cert/mod.rs')
-rw-r--r-- | openpgp/src/cert/mod.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/openpgp/src/cert/mod.rs b/openpgp/src/cert/mod.rs index b0c4b9e3..279635ab 100644 --- a/openpgp/src/cert/mod.rs +++ b/openpgp/src/cert/mod.rs @@ -3949,9 +3949,10 @@ mod test { .build(&mut keypair, &cert, None) .unwrap(); assert_eq!(sig.typ(), SignatureType::KeyRevocation); - assert_eq!(sig.issuer(), Some(&cert.keyid())); - assert_eq!(sig.issuer_fingerprint(), - Some(&cert.fingerprint())); + assert_eq!(sig.issuers().collect::<Vec<_>>(), + vec![ &cert.keyid() ]); + assert_eq!(sig.issuer_fingerprints().collect::<Vec<_>>(), + vec![ &cert.fingerprint() ]); let cert = cert.merge_packets(sig).unwrap(); assert_match!(RevocationStatus::Revoked(_) = cert.revocation_status(p, None)); @@ -3972,9 +3973,10 @@ mod test { .unwrap(); assert_eq!(sig.typ(), SignatureType::KeyRevocation); - assert_eq!(sig.issuer(), Some(&other.keyid())); - assert_eq!(sig.issuer_fingerprint(), - Some(&other.fingerprint())); + assert_eq!(sig.issuers().collect::<Vec<_>>(), + vec![ &other.keyid() ]); + assert_eq!(sig.issuer_fingerprints().collect::<Vec<_>>(), + vec![ &other.fingerprint() ]); } #[test] |