語言

AesCng 建構函式

定義

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

多載

名稱 Description
AesCng()

初始化一個帶有短暫鍵的類別新實例 AesCng 。

AesCng(CngKey)

使用指定的 AesCng,初始化 CngKey 類別的新實例。

AesCng(String)

初始化一個以指定鍵名(代表已存在的持久化 AES 鍵)的新類別實例 AesCng 。

AesCng(String, CngProvider)

初始化一個以指定金鑰名稱(代表現有持久化 AES 金鑰)及指定金鑰儲存提供者(KSP)的新類別實例 AesCng 。

AesCng(String, CngProvider, CngKeyOpenOptions)

初始化一個以指定金鑰名稱的新類別實例 AesCng ,該名稱代表一個現有的持久化 AES 金鑰、指定的金鑰儲存提供者(KSP)以及金鑰開啟選項。

AesCng()

來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs

初始化一個帶有短暫鍵的類別新實例 AesCng 。

public:
 AesCng();
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public AesCng();
public AesCng();
Public Sub New ()
屬性

適用於

AesCng(CngKey)

來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs

使用指定的 AesCng,初始化 CngKey 類別的新實例。

public:
 AesCng(System::Security::Cryptography::CngKey ^ key);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public AesCng(System.Security.Cryptography.CngKey key);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.AesCng : System.Security.Cryptography.CngKey -> System.Security.Cryptography.AesCng
Public Sub New (key As CngKey)

參數

key
CngKey

將用作當前物件執行密碼運算輸入的金鑰。

屬性

例外狀況

key 是 null。

key 不代表 AES 金鑰。

-或-

執行密碼操作時發生錯誤。

此系統不支援密碼學下一代(CNG)。

適用於

AesCng(String)

來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs

初始化一個以指定鍵名(代表已存在的持久化 AES 鍵)的新類別實例 AesCng 。

public:
 AesCng(System::String ^ keyName);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public AesCng(string keyName);
public AesCng(string keyName);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.AesCng : string -> System.Security.Cryptography.AesCng
new System.Security.Cryptography.AesCng : string -> System.Security.Cryptography.AesCng
Public Sub New (keyName As String)

參數

keyName
String

索引鍵的名稱。

屬性

例外狀況

keyName 是 null。

此系統不支援密碼學下一代(CNG)。

其他所有錯誤。

備註

此建構器使用預設 CngKeyOpenOptions 值 和 NoneMicrosoftSoftwareKeyStorageProvider 作為預設金鑰儲存提供者(KSP)來開啟金鑰。

另請參閱

適用於

AesCng(String, CngProvider)

來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs

初始化一個以指定金鑰名稱(代表現有持久化 AES 金鑰)及指定金鑰儲存提供者(KSP)的新類別實例 AesCng 。

public:
 AesCng(System::String ^ keyName, System::Security::Cryptography::CngProvider ^ provider);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public AesCng(string keyName, System.Security.Cryptography.CngProvider provider);
public AesCng(string keyName, System.Security.Cryptography.CngProvider provider);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.AesCng : string * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.AesCng
new System.Security.Cryptography.AesCng : string * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.AesCng
Public Sub New (keyName As String, provider As CngProvider)

參數

keyName
String

索引鍵的名稱。

provider
CngProvider

包含金鑰的 KSP。

屬性

例外狀況

keyName 是 null。

-或-

provider 是 null。

此系統不支援密碼學下一代(CNG)。

其他所有錯誤。

備註

CngKeyOpenOptions預設值 是None開啟金鑰。

另請參閱

適用於

AesCng(String, CngProvider, CngKeyOpenOptions)

來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs

初始化一個以指定金鑰名稱的新類別實例 AesCng ,該名稱代表一個現有的持久化 AES 金鑰、指定的金鑰儲存提供者(KSP)以及金鑰開啟選項。

public:
 AesCng(System::String ^ keyName, System::Security::Cryptography::CngProvider ^ provider, System::Security::Cryptography::CngKeyOpenOptions openOptions);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public AesCng(string keyName, System.Security.Cryptography.CngProvider provider, System.Security.Cryptography.CngKeyOpenOptions openOptions);
public AesCng(string keyName, System.Security.Cryptography.CngProvider provider, System.Security.Cryptography.CngKeyOpenOptions openOptions);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.AesCng : string * System.Security.Cryptography.CngProvider * System.Security.Cryptography.CngKeyOpenOptions -> System.Security.Cryptography.AesCng
new System.Security.Cryptography.AesCng : string * System.Security.Cryptography.CngProvider * System.Security.Cryptography.CngKeyOpenOptions -> System.Security.Cryptography.AesCng
Public Sub New (keyName As String, provider As CngProvider, openOptions As CngKeyOpenOptions)

參數

keyName
String

索引鍵的名稱。

provider
CngProvider

包含金鑰的 KSP。

openOptions
CngKeyOpenOptions

以位元組合列舉值,指定開啟鍵的選項,例如鍵鑰從哪裡開啟(機器或使用者儲存)以及是否要抑制 UI 提示。

屬性

例外狀況

keyName 是 null。

-或-

provider 是 null。

此系統不支援密碼學下一代(CNG)。

其他所有錯誤。

另請參閱

適用於