CmsRecipient 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 CmsRecipient 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| CmsRecipient(X509Certificate2) |
以指定的憑證初始化該類別的新實例 CmsRecipient ,使用公鑰演算法的預設加密模式及 IssuerAndSerialNumber 主體識別碼。 |
| CmsRecipient(SubjectIdentifierType, X509Certificate2) |
初始化一個以指定憑證與接收者識別碼類型的新實例 CmsRecipient ,使用公鑰演算法的預設加密模式。 |
| CmsRecipient(X509Certificate2, RSAEncryptionPadding) |
初始化一個新的類別實例 CmsRecipient ,使用指定的 RSA 憑證及 RSA 加密填充,並使用 IssuerAndSerialNumber 主題識別碼。 |
| CmsRecipient(SubjectIdentifierType, X509Certificate2, RSAEncryptionPadding) |
初始化該類別的新實例 CmsRecipient ,包含指定的 RSA 憑證、RSA 加密填充及主題識別碼。 |
CmsRecipient(X509Certificate2)
以指定的憑證初始化該類別的新實例 CmsRecipient ,使用公鑰演算法的預設加密模式及 IssuerAndSerialNumber 主體識別碼。
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
為此收件人加密時所使用的憑證。
例外狀況
參數 certificate 為 null。
備註
該 CmsRecipient 類別具有以下預設屬性值。
| 房產 | 預設值 |
|---|---|
| RecipientIdentifierType | IssuerAndSerialNumber |
| RSAEncryptionPadding | null |
另請參閱
- CmsRecipient(SubjectIdentifierType, X509Certificate2)
- CmsRecipient(X509Certificate2, RSAEncryptionPadding)
適用於
CmsRecipient(SubjectIdentifierType, X509Certificate2)
初始化一個以指定憑證與接收者識別碼類型的新實例 CmsRecipient ,使用公鑰演算法的預設加密模式。
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
用於識別所使用的接收憑證的方案。
- certificate
- X509Certificate2
為此收件人加密時所使用的憑證。
例外狀況
參數 certificate 為 null。
recipientIdentifierType這個數值沒有被支援。
另請參閱
- CmsRecipient(X509Certificate2)
- CmsRecipient(SubjectIdentifierType, X509Certificate2, RSAEncryptionPadding)
適用於
CmsRecipient(X509Certificate2, RSAEncryptionPadding)
初始化一個新的類別實例 CmsRecipient ,使用指定的 RSA 憑證及 RSA 加密填充,並使用 IssuerAndSerialNumber 主題識別碼。
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
為此收件人加密時所使用的憑證。
- rsaEncryptionPadding
- RSAEncryptionPadding
RSA 填充模式用於此收件人加密時。
例外狀況
certificate或rsaEncryptionPadding參數為 null。
certificate參數公鑰不被視為 RSA 公鑰。
備註
該 CmsRecipient 類別具有以下預設屬性值。
| 房產 | 預設值 |
|---|---|
| RecipientIdentifierType | IssuerAndSerialNumber |
適用於
CmsRecipient(SubjectIdentifierType, X509Certificate2, RSAEncryptionPadding)
初始化該類別的新實例 CmsRecipient ,包含指定的 RSA 憑證、RSA 加密填充及主題識別碼。
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
用於識別所使用的接收憑證的方案。
- certificate
- X509Certificate2
為此收件人加密時所使用的憑證。
- rsaEncryptionPadding
- RSAEncryptionPadding
RSA 填充模式用於此收件人加密時。
例外狀況
certificate或rsaEncryptionPadding參數為 null。
certificate參數公鑰不被視為 RSA 公鑰。