#[non_exhaustive]pub enum RecipientIdentifier {
IssuerAndSerialNumber {
issuer_der: Vec<u8>,
serial: Vec<u8>,
},
SubjectKeyIdentifier(Vec<u8>),
}Expand description
Identifies the recipient of an encrypted message.
Used by DecryptionKey::matches_recipient to find the right key.
The CMS standard defines two ways to identify a recipient certificate.
Your matches_recipient implementation should handle both variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
IssuerAndSerialNumber
Identified by certificate issuer name and serial number (PKCS #7 compatibility).
Fields
SubjectKeyIdentifier(Vec<u8>)
Identified by the raw bytes of the Subject Key Identifier extension value
(RFC 5652 §6.2.2).
Obtain from the cert’s Subject Key Identifier extension:
cert.tbs_certificate().get_extension::<SubjectKeyIdentifier>().
Trait Implementations§
Source§impl Clone for RecipientIdentifier
impl Clone for RecipientIdentifier
Source§fn clone(&self) -> RecipientIdentifier
fn clone(&self) -> RecipientIdentifier
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RecipientIdentifier
impl Debug for RecipientIdentifier
Source§impl<'de> Deserialize<'de> for RecipientIdentifier
impl<'de> Deserialize<'de> for RecipientIdentifier
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for RecipientIdentifier
impl Display for RecipientIdentifier
impl Eq for RecipientIdentifier
Source§impl PartialEq for RecipientIdentifier
impl PartialEq for RecipientIdentifier
Source§fn eq(&self, other: &RecipientIdentifier) -> bool
fn eq(&self, other: &RecipientIdentifier) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RecipientIdentifier
impl Serialize for RecipientIdentifier
impl StructuralPartialEq for RecipientIdentifier
Auto Trait Implementations§
impl Freeze for RecipientIdentifier
impl RefUnwindSafe for RecipientIdentifier
impl Send for RecipientIdentifier
impl Sync for RecipientIdentifier
impl Unpin for RecipientIdentifier
impl UnsafeUnpin for RecipientIdentifier
impl UnwindSafe for RecipientIdentifier
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