Redigera

Dela via


CmsRecipient Constructors

Definition

Initializes a new instance of the CmsRecipient class.

Overloads

CmsRecipient(X509Certificate2)

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.

CmsRecipient(SubjectIdentifierType, X509Certificate2)

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.

CmsRecipient(X509Certificate2, RSAEncryptionPadding)

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

CmsRecipient(SubjectIdentifierType, X509Certificate2, RSAEncryptionPadding)

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

CmsRecipient(X509Certificate2)

Source:
CmsRecipient.cs
Source:
CmsRecipient.cs
Source:
CmsRecipient.cs
Source:
CmsRecipient.cs
Source:
CmsRecipient.cs

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(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate);
public CmsRecipient (System.Security.Cryptography.X509Certificates.X509Certificate2 certificate);
new System.Security.Cryptography.Pkcs.CmsRecipient : System.Security.Cryptography.X509Certificates.X509Certificate2 -> System.Security.Cryptography.Pkcs.CmsRecipient
Public Sub New (certificate As X509Certificate2)

Parameters

certificate
X509Certificate2

The certificate to use when encrypting for this recipient.

Exceptions

The certificate parameter is null.

Remarks

The CmsRecipient class has the following default property values.

Property Default value
RecipientIdentifierType IssuerAndSerialNumber
RSAEncryptionPadding null

See also

Applies to

CmsRecipient(SubjectIdentifierType, X509Certificate2)

Source:
CmsRecipient.cs
Source:
CmsRecipient.cs
Source:
CmsRecipient.cs
Source:
CmsRecipient.cs
Source:
CmsRecipient.cs

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.

public:
 CmsRecipient(System::Security::Cryptography::Pkcs::SubjectIdentifierType recipientIdentifierType, System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate);
public CmsRecipient (System.Security.Cryptography.Pkcs.SubjectIdentifierType recipientIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2 certificate);
new System.Security.Cryptography.Pkcs.CmsRecipient : System.Security.Cryptography.Pkcs.SubjectIdentifierType * System.Security.Cryptography.X509Certificates.X509Certificate2 -> System.Security.Cryptography.Pkcs.CmsRecipient
Public Sub New (recipientIdentifierType As SubjectIdentifierType, certificate As X509Certificate2)

Parameters

recipientIdentifierType
SubjectIdentifierType

The scheme to use for identifying which recipient certificate was used.

certificate
X509Certificate2

The certificate to use when encrypting for this recipient.

Exceptions

The certificate parameter is null.

The recipientIdentifierType value is not supported.

See also

Applies to

CmsRecipient(X509Certificate2, RSAEncryptionPadding)

Source:
CmsRecipient.cs
Source:
CmsRecipient.cs
Source:
CmsRecipient.cs
Source:
CmsRecipient.cs
Source:
CmsRecipient.cs

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

public:
 CmsRecipient(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate, System::Security::Cryptography::RSAEncryptionPadding ^ rsaEncryptionPadding);
public CmsRecipient (System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, System.Security.Cryptography.RSAEncryptionPadding rsaEncryptionPadding);
new System.Security.Cryptography.Pkcs.CmsRecipient : System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.RSAEncryptionPadding -> System.Security.Cryptography.Pkcs.CmsRecipient
Public Sub New (certificate As X509Certificate2, rsaEncryptionPadding As RSAEncryptionPadding)

Parameters

certificate
X509Certificate2

The certificate to use when encrypting for this recipient.

rsaEncryptionPadding
RSAEncryptionPadding

The RSA padding mode to use when encrypting for this recipient.

Exceptions

The certificate or rsaEncryptionPadding parameter is null.

The certificate parameter public key is not recognized as an RSA public key.

-or-

The recipientIdentifierType value is not supported.

Remarks

The CmsRecipient class has the following default property values.

Property Default value
RecipientIdentifierType IssuerAndSerialNumber

Applies to

CmsRecipient(SubjectIdentifierType, X509Certificate2, RSAEncryptionPadding)

Source:
CmsRecipient.cs
Source:
CmsRecipient.cs
Source:
CmsRecipient.cs
Source:
CmsRecipient.cs
Source:
CmsRecipient.cs

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

public:
 CmsRecipient(System::Security::Cryptography::Pkcs::SubjectIdentifierType recipientIdentifierType, System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate, System::Security::Cryptography::RSAEncryptionPadding ^ rsaEncryptionPadding);
public CmsRecipient (System.Security.Cryptography.Pkcs.SubjectIdentifierType recipientIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, System.Security.Cryptography.RSAEncryptionPadding rsaEncryptionPadding);
new System.Security.Cryptography.Pkcs.CmsRecipient : System.Security.Cryptography.Pkcs.SubjectIdentifierType * System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.RSAEncryptionPadding -> System.Security.Cryptography.Pkcs.CmsRecipient
Public Sub New (recipientIdentifierType As SubjectIdentifierType, certificate As X509Certificate2, rsaEncryptionPadding As RSAEncryptionPadding)

Parameters

recipientIdentifierType
SubjectIdentifierType

The scheme to use for identifying which recipient certificate was used.

certificate
X509Certificate2

The certificate to use when encrypting for this recipient.

rsaEncryptionPadding
RSAEncryptionPadding

The RSA padding mode to use when encrypting for this recipient.

Exceptions

The certificate or rsaEncryptionPadding parameter is null.

The certificate parameter public key is not recognized as an RSA public key.

See also

Applies to