diff options
Diffstat (limited to 'openpgp/src/types/revocation_key.rs')
-rw-r--r-- | openpgp/src/types/revocation_key.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/openpgp/src/types/revocation_key.rs b/openpgp/src/types/revocation_key.rs index 79c1fc7f..4bacf5ff 100644 --- a/openpgp/src/types/revocation_key.rs +++ b/openpgp/src/types/revocation_key.rs @@ -1,6 +1,7 @@ use quickcheck::{Arbitrary, Gen}; use crate::{ + cert::prelude::*, Error, Fingerprint, Result, @@ -27,6 +28,14 @@ pub struct RevocationKey { unknown: u8, } +impl From<&Cert> for RevocationKey { + fn from(cert: &Cert) -> Self { + RevocationKey::new(cert.primary_key().pk_algo(), + cert.fingerprint(), + false) + } +} + impl RevocationKey { /// Creates a new instance. pub fn new(pk_algo: PublicKeyAlgorithm, fp: Fingerprint, sensitive: bool) |