pub struct RevocationKey { /* private fields */ }
Expand description
Designates a key as a valid third-party revoker.
This is described in Section 5.2.3.23 of RFC 9580.
Revocation keys can be retrieved using ValidAmalgamation::revocation_keys
and set using CertBuilder::set_revocation_keys
.
§Examples
use sequoia_openpgp as openpgp;
use openpgp::cert::prelude::*;
use openpgp::policy::StandardPolicy;
use openpgp::types::RevocationKey;
let p = &StandardPolicy::new();
let (alice, _) =
CertBuilder::general_purpose(Some("alice@example.org"))
.generate()?;
// Make Alice a designated revoker for Bob.
let (bob, _) =
CertBuilder::general_purpose(Some("bob@example.org"))
.set_revocation_keys(vec![(&alice).into()])
.generate()?;
// Make sure Alice is listed as a designated revoker for Bob.
assert_eq!(bob.with_policy(p, None)?.revocation_keys()
.collect::<Vec<&RevocationKey>>(),
vec![&(&alice).into()]);
Implementations§
Source§impl RevocationKey
impl RevocationKey
Sourcepub fn new(
pk_algo: PublicKeyAlgorithm,
fp: Fingerprint,
sensitive: bool,
) -> Self
pub fn new( pk_algo: PublicKeyAlgorithm, fp: Fingerprint, sensitive: bool, ) -> Self
Creates a new instance.
Sourcepub fn from_bits(
pk_algo: PublicKeyAlgorithm,
fp: Fingerprint,
class: u8,
) -> Result<Self>
pub fn from_bits( pk_algo: PublicKeyAlgorithm, fp: Fingerprint, class: u8, ) -> Result<Self>
Creates a new instance from the raw class
parameter.
Sourcepub fn revoker(&self) -> (PublicKeyAlgorithm, &Fingerprint)
pub fn revoker(&self) -> (PublicKeyAlgorithm, &Fingerprint)
Returns the revoker’s identity.
Sourcepub fn set_revoker(
&mut self,
pk_algo: PublicKeyAlgorithm,
fp: Fingerprint,
) -> (PublicKeyAlgorithm, Fingerprint)
pub fn set_revoker( &mut self, pk_algo: PublicKeyAlgorithm, fp: Fingerprint, ) -> (PublicKeyAlgorithm, Fingerprint)
Sets the revoker’s identity.
Sourcepub fn sensitive(&self) -> bool
pub fn sensitive(&self) -> bool
Returns whether the relation between revoker and revokee is of a sensitive nature.
Sourcepub fn set_sensitive(self, v: bool) -> Self
pub fn set_sensitive(self, v: bool) -> Self
Sets whether the relation between revoker and revokee is of a sensitive nature.
Trait Implementations§
Source§impl Clone for RevocationKey
impl Clone for RevocationKey
Source§fn clone(&self) -> RevocationKey
fn clone(&self) -> RevocationKey
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RevocationKey
impl Debug for RevocationKey
Source§impl From<&Cert> for RevocationKey
impl From<&Cert> for RevocationKey
Source§impl Hash for RevocationKey
impl Hash for RevocationKey
Source§impl Marshal for RevocationKey
impl Marshal for RevocationKey
Source§impl MarshalInto for RevocationKey
impl MarshalInto for RevocationKey
Source§fn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
Computes the maximal length of the serialized representation. Read more
Source§fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
Serializes into the given buffer. Read more
Source§impl Ord for RevocationKey
impl Ord for RevocationKey
Source§fn cmp(&self, other: &RevocationKey) -> Ordering
fn cmp(&self, other: &RevocationKey) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for RevocationKey
impl PartialEq for RevocationKey
Source§impl PartialOrd for RevocationKey
impl PartialOrd for RevocationKey
impl Eq for RevocationKey
impl StructuralPartialEq for RevocationKey
Auto Trait Implementations§
impl Freeze for RevocationKey
impl RefUnwindSafe for RevocationKey
impl Send for RevocationKey
impl Sync for RevocationKey
impl Unpin for RevocationKey
impl UnwindSafe for RevocationKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more