DSACng 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 DSACng 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| DSACng() |
初始化類別的新實例 DSACng ,使用隨機的 2,048 位元金鑰對。 |
| DSACng(Int32) |
初始化類別的新實例 DSACng ,使用指定大小的隨機生成鍵。 |
| DSACng(CngKey) |
初始化一個新的類別實例 DSACng ,使用指定的鍵值。 |
DSACng()
初始化類別的新實例 DSACng ,使用隨機的 2,048 位元金鑰對。
public:
DSACng();
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public DSACng();
public DSACng();
Public Sub New ()
- 屬性
適用於
DSACng(Int32)
初始化類別的新實例 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 位元。
適用於
DSACng(CngKey)
初始化一個新的類別實例 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 中這個金鑰物件的副本仍然存活。