pub struct PubSecRecipient {
pub rid: RecipientIdRef,
pub public_key: RsaPublicKey,
}Expand description
Recipient identification + public key for an emitted public-key
envelope. Either form of RFC 5652 §6.2.1 RecipientIdentifier is
supported — IssuerAndSerial (CMS v0) or SubjectKeyIdentifier
(CMS v2).
Fields§
§rid: RecipientIdRefRecipient identifier — IAS or SKI.
public_key: RsaPublicKeyRecipient’s RSA public key. Used to wrap the
content-encryption key with RSAES-PKCS1-v1_5.
Implementations§
Source§impl PubSecRecipient
impl PubSecRecipient
Sourcepub fn from_issuer_and_serial(
issuer_der: Vec<u8>,
serial: Vec<u8>,
public_key: RsaPublicKey,
) -> Self
pub fn from_issuer_and_serial( issuer_der: Vec<u8>, serial: Vec<u8>, public_key: RsaPublicKey, ) -> Self
Build a recipient from an IssuerAndSerialNumber pair plus an
rsa::RsaPublicKey.
Sourcepub fn from_subject_key_identifier(
ski: Vec<u8>,
public_key: RsaPublicKey,
) -> Self
pub fn from_subject_key_identifier( ski: Vec<u8>, public_key: RsaPublicKey, ) -> Self
Build a recipient from a SubjectKeyIdentifier (20-byte SHA-1 of the cert’s SPKI BIT STRING contents — RFC 5280 §4.2.1.2 method
- plus an
rsa::RsaPublicKey.
Sourcepub fn from_certificate(cert: &Certificate, public_key: RsaPublicKey) -> Self
pub fn from_certificate(cert: &Certificate, public_key: RsaPublicKey) -> Self
Build a recipient from a parsed super::x509::Certificate.
Uses the IssuerAndSerial form by default; callers wanting
SKI matching should use Self::from_subject_key_identifier
after pulling the SKI out of the cert.
Trait Implementations§
Source§impl Clone for PubSecRecipient
impl Clone for PubSecRecipient
Source§fn clone(&self) -> PubSecRecipient
fn clone(&self) -> PubSecRecipient
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 moreAuto Trait Implementations§
impl Freeze for PubSecRecipient
impl RefUnwindSafe for PubSecRecipient
impl Send for PubSecRecipient
impl Sync for PubSecRecipient
impl Unpin for PubSecRecipient
impl UnsafeUnpin for PubSecRecipient
impl UnwindSafe for PubSecRecipient
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