openpgp Add KeyAmalgamation::primary.

  - Add `KeyAmalgamation::primary` to return whether the
    `KeyAmalgamation` contains a primary key.
parent 19580f8d
......@@ -63,6 +63,15 @@ impl<'a, P: 'a + key::KeyParts> KeyAmalgamation<'a, P> {
}
}
/// Returns whether the key is a primary key.
pub fn primary(&self) -> bool {
if let KeyAmalgamationBundle::Primary() = self.bundle {
true
} else {
false
}
}
/// Returns the key.
pub fn key(&self) -> &'a Key<P, key::UnspecifiedRole> {
match self {
......
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