Skip to main content

Recipient

Enum Recipient 

Source
pub enum Recipient<'a> {
    Transport {
        version: u64,
        identifier: SignerIdentifier<'a>,
        algorithm: AlgorithmIdentifier<'a>,
        encrypted: Octets<'a>,
    },
    Agreement {
        originator: Originator<'a>,
        ukm: Option<Octets<'a>>,
        algorithm: AlgorithmIdentifier<'a>,
        keys: OwnedVec<RecipientKey<'a>>,
    },
    Kek {
        identifier: KeyIdentifier<'a>,
        algorithm: AlgorithmIdentifier<'a>,
        encrypted: Octets<'a>,
    },
    Password {
        derivation: Option<AlgorithmIdentifier<'a>>,
        algorithm: AlgorithmIdentifier<'a>,
        encrypted: Octets<'a>,
    },
    Other {
        kind: Oid<'a>,
        value: EncodedValue<'a>,
    },
}
Expand description

All five CMS RecipientInfo alternatives, without engine dispatch or key lookup.

Variants§

§

Transport

Public-key transport (§6.2.1); version is 0 for issuer/serial, 2 for SKI.

Fields

§version: u64

Declared version, checked against the identifier alternative.

§identifier: SignerIdentifier<'a>

Original selected recipient identity; never an implicit key hint.

§algorithm: AlgorithmIdentifier<'a>

Actual key-encryption algorithm and original parameters.

§encrypted: Octets<'a>

Original encrypted content-encryption key.

§

Agreement

Key agreement (§6.2.2), always version3.

Fields

§originator: Originator<'a>

Original sender-key alternative.

§ukm: Option<Octets<'a>>

Optional explicit user-keying material; absence stays distinct.

§algorithm: AlgorithmIdentifier<'a>

Original key-encryption algorithm.

§keys: OwnedVec<RecipientKey<'a>>

All original recipient encrypted keys, not just the first.

§

Kek

Pre-distributed symmetric KEK (§6.2.3), always version4.

Fields

§identifier: KeyIdentifier<'a>

Original KEK identifier, date and additional open value.

§algorithm: AlgorithmIdentifier<'a>

Original key-encryption algorithm.

§encrypted: Octets<'a>

Original encrypted content-encryption key.

§

Password

Password/shared-secret recipient (§6.2.4), always version0.

Fields

§derivation: Option<AlgorithmIdentifier<'a>>

Optional original [0] IMPLICIT key derivation algorithm. Absence means externally supplied KEK, not an invented default KDF.

§algorithm: AlgorithmIdentifier<'a>

Original key-encryption algorithm.

§encrypted: Octets<'a>

Original encrypted content-encryption key.

§

Other

Named open key-management format (§6.2.5), including RFC9629 KEM.

Fields

§kind: Oid<'a>

Exact format OID. Unknown is not absence or key-transport fallback.

§value: EncodedValue<'a>

Whole original open value, to be interpreted by its actual owner.

Trait Implementations§

Source§

impl<'a> Debug for Recipient<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for Recipient<'a>

§

impl<'a> !RefUnwindSafe for Recipient<'a>

§

impl<'a> !Send for Recipient<'a>

§

impl<'a> !Sync for Recipient<'a>

§

impl<'a> !UnwindSafe for Recipient<'a>

§

impl<'a> Unpin for Recipient<'a>

§

impl<'a> UnsafeUnpin for Recipient<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.