diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-01-14 08:04:03 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-01-14 08:05:06 +0100 |
commit | 5e636b7352cc709597895944b88067961664a0c5 (patch) | |
tree | cc8303831adba68b0ec39168debe9df21b376826 /openpgp/src | |
parent | 78ebbf05c9839771ae5dc3ce0c1c3cd278f0bde4 (diff) |
openpgp: Add KeyAmalgamation::cert.
- Add a method to KeyAmalgamation to return the key's certificate.
Diffstat (limited to 'openpgp/src')
-rw-r--r-- | openpgp/src/cert/key_amalgamation.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/openpgp/src/cert/key_amalgamation.rs b/openpgp/src/cert/key_amalgamation.rs index 62f846ae..2a4326c1 100644 --- a/openpgp/src/cert/key_amalgamation.rs +++ b/openpgp/src/cert/key_amalgamation.rs @@ -172,6 +172,17 @@ impl<'a, P: 'a + key::KeyParts> KeyAmalgamation<'a, P> { } } + /// Returns the certificate that the key came from. + pub fn cert(&self) -> &'a Cert + { + match self { + KeyAmalgamation(KeyAmalgamation0::Primary(ref h)) => + h.cert, + KeyAmalgamation(KeyAmalgamation0::Subordinate(ref h)) => + h.cert, + } + } + /// Returns the amalgamation's reference time. /// /// For queries that are with respect to a point in time, this |