<PackageReference Include="BouncyCastle.Cryptography" Version="2.8.0-beta.349" />

Org.BouncyCastle.Cms.RecipientInformation

public abstract class RecipientInformation
Base class for CMS recipient information. Use RecipientID to select a recipient, then supply the matching key material to GetContentStream or GetContent.
public string KeyEncryptionAlgOid { get; }

Return the object identifier for the key encryption algorithm.

Gets the algorithm identifier used to encrypt or wrap the content-encryption key.

Return the ASN.1 encoded key encryption algorithm parameters, or null if there aren't any.

public RecipientID RecipientID { get; }

Gets the identifier used to match this recipient.

public byte[] GetContent(ICipherParameters key)

Decrypts the content using key and returns all of its bytes.

Returns a stream that exposes the recovered content.

public byte[] GetMac()

Return the MAC calculated for the content stream. Note: this call is only meaningful once all the content has been read.