Struct sequoia_openpgp::types::RevocationKey
source · pub struct RevocationKey { /* private fields */ }
Expand description
Designates a key as a valid third-party revoker.
This is described in Section 5.2.3.15 of RFC 4880.
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(None, Some("alice@example.org"))
.generate()?;
// Make Alice a designated revoker for Bob.
let (bob, _) =
CertBuilder::general_purpose(None, 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(None)
.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 or not 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 or not 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 copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
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§fn eq(&self, other: &RevocationKey) -> bool
fn eq(&self, other: &RevocationKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for RevocationKey
impl PartialOrd for RevocationKey
source§fn partial_cmp(&self, other: &RevocationKey) -> Option<Ordering>
fn partial_cmp(&self, other: &RevocationKey) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)