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
sourceimpl 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
sourceimpl Clone for RevocationKey
impl Clone for RevocationKey
sourcefn clone(&self) -> RevocationKey
fn clone(&self) -> RevocationKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RevocationKey
impl Debug for RevocationKey
sourceimpl From<&Cert> for RevocationKey
impl From<&Cert> for RevocationKey
sourceimpl Hash for RevocationKey
impl Hash for RevocationKey
sourceimpl Marshal for RevocationKey
impl Marshal for RevocationKey
sourceimpl MarshalInto for RevocationKey
impl MarshalInto for RevocationKey
sourcefn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
Computes the maximal length of the serialized representation. Read more
sourcefn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
Serializes into the given buffer. Read more
sourceimpl Ord for RevocationKey
impl Ord for RevocationKey
sourceimpl PartialEq<RevocationKey> for RevocationKey
impl PartialEq<RevocationKey> for RevocationKey
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &RevocationKey) -> bool
fn ne(&self, other: &RevocationKey) -> bool
This method tests for !=
.
sourceimpl PartialOrd<RevocationKey> for RevocationKey
impl PartialOrd<RevocationKey> for RevocationKey
sourcefn partial_cmp(&self, other: &RevocationKey) -> Option<Ordering>
fn partial_cmp(&self, other: &RevocationKey) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl Eq for RevocationKey
impl StructuralEq for RevocationKey
impl StructuralPartialEq for RevocationKey
Auto Trait Implementations
impl RefUnwindSafe for RevocationKey
impl Send for RevocationKey
impl Sync for RevocationKey
impl Unpin for RevocationKey
impl UnwindSafe for RevocationKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more