語言

EncryptedKeyEncryptingCredentials 建構函式

定義

初始化 EncryptedKeyEncryptingCredentials 類別的新執行個體。

多載

名稱 Description
EncryptedKeyEncryptingCredentials(X509Certificate2)

根據指定的 X.509 憑證初始化該 EncryptedKeyEncryptingCredentials 類別的新實例。

EncryptedKeyEncryptingCredentials(EncryptingCredentials, Int32, String)

根據指定的EncryptedKeyEncryptingCredentials物件、金鑰大小及加密演算法初始化該EncryptingCredentials類別的新實例。

EncryptedKeyEncryptingCredentials(X509Certificate2, String, Int32, String)

根據指定的 X.509 憑證、包裝演算法、金鑰大小及加密演算法,初始化該類別的新 EncryptedKeyEncryptingCredentials 實例。

EncryptedKeyEncryptingCredentials(X509Certificate2)

根據指定的 X.509 憑證初始化該 EncryptedKeyEncryptingCredentials 類別的新實例。

public:
 EncryptedKeyEncryptingCredentials(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate);
public EncryptedKeyEncryptingCredentials(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate);
new System.IdentityModel.Tokens.EncryptedKeyEncryptingCredentials : System.Security.Cryptography.X509Certificates.X509Certificate2 -> System.IdentityModel.Tokens.EncryptedKeyEncryptingCredentials
Public Sub New (certificate As X509Certificate2)

參數

certificate
X509Certificate2

用來加密金鑰的憑證。

備註

如果包裝憑證是 X.509 憑證,且你想使用預設的包裝演算法和加密演算法,分別是 RSA-OAEP 和 AES256,則使用這個構造子。

適用於

EncryptedKeyEncryptingCredentials(EncryptingCredentials, Int32, String)

根據指定的EncryptedKeyEncryptingCredentials物件、金鑰大小及加密演算法初始化該EncryptingCredentials類別的新實例。

public:
 EncryptedKeyEncryptingCredentials(System::IdentityModel::Tokens::EncryptingCredentials ^ wrappingCredentials, int keySizeInBits, System::String ^ encryptionAlgorithm);
public EncryptedKeyEncryptingCredentials(System.IdentityModel.Tokens.EncryptingCredentials wrappingCredentials, int keySizeInBits, string encryptionAlgorithm);
new System.IdentityModel.Tokens.EncryptedKeyEncryptingCredentials : System.IdentityModel.Tokens.EncryptingCredentials * int * string -> System.IdentityModel.Tokens.EncryptedKeyEncryptingCredentials
Public Sub New (wrappingCredentials As EncryptingCredentials, keySizeInBits As Integer, encryptionAlgorithm As String)

參數

wrappingCredentials
EncryptingCredentials

用於加密會話金鑰的金鑰包裝憑證。

keySizeInBits
Int32

是包裹會話金鑰的鍵大小。

encryptionAlgorithm
String

一個 URI,代表使用會話金鑰時的加密演算法。 這應該是一個對稱密鑰演算法。

例外狀況

wrappingCredentials 是 null。

備註

如果你已經有一個 EncryptingCredentials 物件,想用它作為包裝憑證,請使用這個建構子。

適用於

EncryptedKeyEncryptingCredentials(X509Certificate2, String, Int32, String)

根據指定的 X.509 憑證、包裝演算法、金鑰大小及加密演算法,初始化該類別的新 EncryptedKeyEncryptingCredentials 實例。

public:
 EncryptedKeyEncryptingCredentials(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate, System::String ^ keyWrappingAlgorithm, int keySizeInBits, System::String ^ encryptionAlgorithm);
public EncryptedKeyEncryptingCredentials(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, string keyWrappingAlgorithm, int keySizeInBits, string encryptionAlgorithm);
new System.IdentityModel.Tokens.EncryptedKeyEncryptingCredentials : System.Security.Cryptography.X509Certificates.X509Certificate2 * string * int * string -> System.IdentityModel.Tokens.EncryptedKeyEncryptingCredentials
Public Sub New (certificate As X509Certificate2, keyWrappingAlgorithm As String, keySizeInBits As Integer, encryptionAlgorithm As String)

參數

certificate
X509Certificate2

用來加密金鑰的憑證。

keyWrappingAlgorithm
String

一個代表金鑰包裝演算法的 URI。 這應該是一個非對稱演算法。

keySizeInBits
Int32

是包裹會話金鑰的鍵大小。

encryptionAlgorithm
String

一個 URI,代表使用會話金鑰時的加密演算法。 這應該是一個對稱密鑰演算法。

備註

如果包裝憑證是 X.509 證書,且你想提供自己的包裝演算法和加密演算法,可以使用這個建構器。

適用於