語言

DSACng 建構函式

定義

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

多載

名稱 Description
DSACng()

初始化類別的新實例 DSACng ,使用隨機的 2,048 位元金鑰對。

DSACng(Int32)

初始化類別的新實例 DSACng ,使用指定大小的隨機生成鍵。

DSACng(CngKey)

初始化一個新的類別實例 DSACng ,使用指定的鍵值。

DSACng()

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

初始化類別的新實例 DSACng ,使用隨機的 2,048 位元金鑰對。

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

適用於

DSACng(Int32)

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

初始化類別的新實例 DSACng ,使用指定大小的隨機生成鍵。

public:
 DSACng(int keySize);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public DSACng(int keySize);
public DSACng(int keySize);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.DSACng : int -> System.Security.Cryptography.DSACng
new System.Security.Cryptography.DSACng : int -> System.Security.Cryptography.DSACng
Public Sub New (keySize As Integer)

參數

keySize
Int32

金鑰的大小以位元為單位產生。

屬性

例外狀況

keySize 不成立。

備註

有效金鑰大小範圍為 512 至 3,072 位元,每 64 位元為增量。 我們建議所有金鑰的最小大小應為 2,048 位元。

Important

DSA 演算法的創建者已撤回對其的支持。 考慮用 class 或 RSA class 代替 ECDsa class DSA 。 僅用於 DSA 與舊有應用程式及資料相容性。

適用於

DSACng(CngKey)

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

初始化一個新的類別實例 DSACng ,使用指定的鍵值。

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

參數

key
CngKey

DSA 操作的關鍵。

屬性

例外狀況

key 不是有效的 DSA 金鑰。

key 是 null。

備註

CngKey.AlgorithmGroup的 key 必須是 CngAlgorithmGroup.Dsa。

此建構子會建立金鑰的副本。 即使 key 被丟棄,DSA 中這個金鑰物件的副本仍然存活。

適用於