CmsRecipient 构造函数

定义

初始化 CmsRecipient 类的新实例。Initializes a new instance of the CmsRecipient class.

重载

CmsRecipient(X509Certificate2)

使用指定的证书、公钥算法的默认加密模式以及 IssuerAndSerialNumber 使用者标识符来初始化 CmsRecipient 类的新实例。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)

使用指定的证书、收件人标识符类型以及公钥算法的默认加密模式来初始化 CmsRecipient 类的新实例。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)

使用指定的 RSA 证书、RSA 加密填充以及 IssuerAndSerialNumber 使用者标识符来初始化 CmsRecipient 类的新实例。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)

使用指定的 RSA 证书、RSA 加密填充和使用者标识符来初始化 CmsRecipient 类的新实例。Initializes a new instance of the CmsRecipient class with a specified RSA certificate, RSA encryption padding, and subject identifier.

CmsRecipient(X509Certificate2)

使用指定的证书、公钥算法的默认加密模式以及 IssuerAndSerialNumber 使用者标识符来初始化 CmsRecipient 类的新实例。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)

参数

certificate
X509Certificate2

为此收件人加密时要使用的证书。The certificate to use when encrypting for this recipient.

例外

certificate 参数为 nullThe certificate parameter is null.

注解

CmsRecipient类具有以下默认属性值。The CmsRecipient class has the following default property values.

PropertyProperty 默认值Default value
RecipientIdentifierType IssuerAndSerialNumber
RSAEncryptionPadding nullnull

另请参阅

适用于

CmsRecipient(SubjectIdentifierType, X509Certificate2)

使用指定的证书、收件人标识符类型以及公钥算法的默认加密模式来初始化 CmsRecipient 类的新实例。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)

参数

recipientIdentifierType
SubjectIdentifierType

用于标识所使用的收件人证书的方案。The scheme to use for identifying which recipient certificate was used.

certificate
X509Certificate2

为此收件人加密时要使用的证书。The certificate to use when encrypting for this recipient.

例外

certificate 参数为 nullThe certificate parameter is null.

不支持 recipientIdentifierType 值。The recipientIdentifierType value is not supported.

另请参阅

适用于

CmsRecipient(X509Certificate2, RSAEncryptionPadding)

使用指定的 RSA 证书、RSA 加密填充以及 IssuerAndSerialNumber 使用者标识符来初始化 CmsRecipient 类的新实例。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)

参数

certificate
X509Certificate2

为此收件人加密时要使用的证书。The certificate to use when encrypting for this recipient.

rsaEncryptionPadding
RSAEncryptionPadding

为此收件人加密时要使用的 RSA 填充模式。The RSA padding mode to use when encrypting for this recipient.

例外

certificatersaEncryptionPadding 参数为 nullThe certificate or rsaEncryptionPadding parameter is null.

certificate 参数公钥未被识别为 RSA 公钥。The certificate parameter public key is not recognized as an RSA public key.

- 或 --or-

不支持 recipientIdentifierType 值。The recipientIdentifierType value is not supported.

注解

CmsRecipient类具有以下默认属性值。The CmsRecipient class has the following default property values.

PropertyProperty 默认值Default value
RecipientIdentifierType IssuerAndSerialNumber

适用于

CmsRecipient(SubjectIdentifierType, X509Certificate2, RSAEncryptionPadding)

使用指定的 RSA 证书、RSA 加密填充和使用者标识符来初始化 CmsRecipient 类的新实例。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)

参数

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

为此收件人加密时要使用的 RSA 填充模式。The RSA padding mode to use when encrypting for this recipient.

例外

certificatersaEncryptionPadding 参数为 nullThe certificate or rsaEncryptionPadding parameter is null.

certificate 参数公钥未被识别为 RSA 公钥。The certificate parameter public key is not recognized as an RSA public key.

另请参阅

适用于