RSACng 建構函式

定義

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

多載

RSACng()

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

RSACng(Int32)

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

RSACng(CngKey)

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

RSACng()

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

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

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

備註

此建構函式不會立即產生新的公開/私密金鑰組。 此建構函式會將 KeySize 屬性設定為 2048,而且當需要使用 屬性值產生索引鍵時。 如果金鑰是透過 ImportParameters 方法或其他金鑰匯入方法載入,則此建構函式中的金鑰大小沒有任何意義。

適用於

RSACng(Int32)

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

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

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

參數

keySize
Int32

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

屬性

例外狀況

keySize 無效。

備註

有效的金鑰大小範圍從 384 到 16,384 位,遞增為 8。 建議針對所有金鑰使用最小大小 2,048 位。

此建構函式不會立即產生新的公開/私密金鑰組。 這個建構函式會 KeySize 使用 屬性值,將屬性設定為 keySize ,以及何時產生索引鍵。 如果金鑰是透過 ImportParameters 方法或其他金鑰匯入方法載入,則此建構函式中的金鑰大小沒有任何意義。

適用於

RSACng(CngKey)

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

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

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

參數

key
CngKey

RSA 作業所要使用的金鑰。

屬性

例外狀況

key 不是有效的 RSA 金鑰。

keynull

備註

CngKey.AlgorithmGroupkey 必須是 CngAlgorithmGroup.Rsa

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

適用於