DSACng 建構函式

定義

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

多載

DSACng()

使用隨機 2,048 位元金鑰組,初始化 DSACng 類別的新執行個體。

DSACng(Int32)

使用指定大小之隨機產生的金鑰,初始化 DSACng 類別的新執行個體。

DSACng(CngKey)

使用指定的金鑰,初始化 DSACng 類別的新執行個體。

DSACng()

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

使用隨機 2,048 位元金鑰組,初始化 DSACng 類別的新執行個體。

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

適用於

DSACng(Int32)

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

使用指定大小之隨機產生的金鑰,初始化 DSACng 類別的新執行個體。

public:
 DSACng(int keySize);
public DSACng (int keySize);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public DSACng (int keySize);
new System.Security.Cryptography.DSACng : int -> System.Security.Cryptography.DSACng
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
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 位。

重要

DSA 演算法的建立者已撤銷其支援。 請考慮使用 RSA 類別或 ECDsa 類別,而不是 類別 DSADSA僅用於與繼承應用程式和資料的相容性。

適用於

DSACng(CngKey)

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

使用指定的金鑰,初始化 DSACng 類別的新執行個體。

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

參數

key
CngKey

DSA 作業所要使用的金鑰。

屬性

例外狀況

key 不是有效的 DSA 金鑰。

keynull

備註

CngKey.AlgorithmGroupkey 必須是 CngAlgorithmGroup.Dsa

此建構函式會建立金鑰的複本。 即使 key 已處置,DSA 中的此金鑰組象的複本仍會保持運作。

適用於