summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-03-06 10:41:55 +0100
committerNeal H. Walfield <neal@pep.foundation>2020-03-06 10:41:55 +0100
commitf88d347351551f34c747c77c87d6e0e18afc161a (patch)
treee18ed08d1dac35b56ea8807081843faed4c9ac31
parent026cc2a01dac518236c020f6d2cb6ada776698ed (diff)
openpgp: Make ValidCert::primary_key infallible.
- A `ValidCert` always has a `ValidPrimaryKeyAmalgamation`.
-rw-r--r--openpgp/src/cert/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/openpgp/src/cert/mod.rs b/openpgp/src/cert/mod.rs
index a0fb5ab5..8be42fb2 100644
--- a/openpgp/src/cert/mod.rs
+++ b/openpgp/src/cert/mod.rs
@@ -1429,9 +1429,10 @@ impl<'a> ValidCert<'a> {
/// Returns the amalgamated primary key.
pub fn primary_key(&self)
- -> Result<ValidPrimaryKeyAmalgamation<key::PublicParts>>
+ -> ValidPrimaryKeyAmalgamation<key::PublicParts>
{
self.cert.primary_key().with_policy(self.policy, self.time)
+ .expect("A ValidKeyAmalgamation must have a ValidPrimaryKeyAmalgamation")
}
/// Returns an iterator over the certificate's keys.