<PackageReference Include="System.Security.Cryptography.Pkcs" Version="10.0.12" />

System.Security.Cryptography.Pkcs.CmsRecipient

public sealed class CmsRecipient
The CmsRecipient class defines the recipient of a CMS/PKCS #7 message.
public X509Certificate2 Certificate { get; }

Gets the certificate to use when encrypting for this recipient.

Gets the scheme to use for identifying which recipient certificate was used.

Gets the RSA encryption padding to use when encrypting for this recipient.

public CmsRecipient(X509Certificate2 certificate)

Initializes a new instance of the CmsRecipient class with a specified certificate, using the default encryption mode for the public key algorithm and an IssuerAndSerialNumber subject identifier.

public CmsRecipient(X509Certificate2 certificate, RSAEncryptionPadding rsaEncryptionPadding)

Initializes a new instance of the CmsRecipient class with a specified RSA certificate and RSA encryption padding, using an IssuerAndSerialNumber subject identifier.

public CmsRecipient(SubjectIdentifierType recipientIdentifierType, X509Certificate2 certificate, RSAEncryptionPadding rsaEncryptionPadding)

Initializes a new instance of the CmsRecipient class with a specified RSA certificate, RSA encryption padding, and subject identifier.

public CmsRecipient(SubjectIdentifierType recipientIdentifierType, X509Certificate2 certificate)

Initializes a new instance of the CmsRecipient class with a specified certificate and recipient identifier type, using the default encryption mode for the public key algorithm.