openpgp: Improve error messages.

parent b0267b73
......@@ -176,7 +176,7 @@ impl<'a, P: 'a + key::KeyParts> KeyAmalgamation<'a, P> {
policy.key(
key::PublicParts::convert_valid_amalgamation_ref(
(&ka).mark_parts_unspecified_ref())
.expect("secret key amalgamations contain secret keys"))?;
.expect("unspecified parts"))?;
Ok(ka)
} else {
Err(Error::NoBindingSignature(time).into())
......
......@@ -598,7 +598,10 @@ impl Cert {
where T: Into<Option<time::SystemTime>>
{
let t = t.into();
self.primary_key().with_policy(policy, t).context("Primary key")?.alive()
self.primary_key()
.with_policy(policy, t).context(
"primary key rejected by policy")?
.alive()
}
/// Sets the key to expire in delta seconds.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment