summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-01-17 13:35:19 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-01-18 14:24:48 +0100
commit94c64d7a831227888c2ab6b5fe9ec0c29781caec (patch)
tree0ae422738338e85d11b10f366b11ab02113510b4
parent6ade8430c79683ad252fbde6fa67108f214e6d0a (diff)
openpgp: Add KeyAmalgamation::component.
-rw-r--r--openpgp/src/cert/key_amalgamation.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/openpgp/src/cert/key_amalgamation.rs b/openpgp/src/cert/key_amalgamation.rs
index d71b4569..12860c8f 100644
--- a/openpgp/src/cert/key_amalgamation.rs
+++ b/openpgp/src/cert/key_amalgamation.rs
@@ -345,4 +345,12 @@ impl<'a, P: 'a + key::KeyParts> KeyAmalgamation<'a, P> {
false
}
}
+
+ /// Returns this key's component.
+ pub fn component(&self) -> &'a KeyBinding<P, key::UnspecifiedRole> {
+ match &self.0 {
+ KeyAmalgamation0::Primary(h) => h.binding.into(),
+ KeyAmalgamation0::Subordinate(h) => h.binding.into(),
+ }
+ }
}