RSAOpenSsl 建構函式

定義

多載

RSAOpenSsl()

使用隨機 2048 位元金鑰組,以初始化 RSAOpenSsl 類別的新執行個體。

RSAOpenSsl(Int32)

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

RSAOpenSsl(IntPtr)

從以 表示 RSA* 的現有 OpenSSL 索引鍵,初始化 類別的新實例 RSAOpenSsl

RSAOpenSsl(RSAParameters)

使用指定的金鑰參數,以初始化 RSAOpenSsl 類別的新執行個體。

RSAOpenSsl(SafeEvpPKeyHandle)

從以 表示 EVP_PKEY* 的現有 OpenSSL 索引鍵,初始化 類別的新實例 RSAOpenSsl

RSAOpenSsl()

來源:
RSAOpenSsl.cs
來源:
RSAOpenSsl.cs
來源:
RSAOpenSsl.cs

使用隨機 2048 位元金鑰組,以初始化 RSAOpenSsl 類別的新執行個體。

public:
 RSAOpenSsl();
public RSAOpenSsl ();
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("windows")]
public RSAOpenSsl ();
Public Sub New ()
屬性

備註

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

適用於

RSAOpenSsl(Int32)

來源:
RSAOpenSsl.cs
來源:
RSAOpenSsl.cs
來源:
RSAOpenSsl.cs

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

public:
 RSAOpenSsl(int keySize);
public RSAOpenSsl (int keySize);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("windows")]
public RSAOpenSsl (int keySize);
new System.Security.Cryptography.RSAOpenSsl : int -> System.Security.Cryptography.RSAOpenSsl
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("windows")>]
new System.Security.Cryptography.RSAOpenSsl : int -> System.Security.Cryptography.RSAOpenSsl
Public Sub New (keySize As Integer)

參數

keySize
Int32

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

屬性

例外狀況

keySize 無效。

適用於

RSAOpenSsl(IntPtr)

來源:
RSAOpenSsl.cs
來源:
RSAOpenSsl.cs
來源:
RSAOpenSsl.cs

從以 表示 RSA* 的現有 OpenSSL 索引鍵,初始化 類別的新實例 RSAOpenSsl

public:
 RSAOpenSsl(IntPtr handle);
public RSAOpenSsl (IntPtr handle);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("windows")]
public RSAOpenSsl (IntPtr handle);
new System.Security.Cryptography.RSAOpenSsl : nativeint -> System.Security.Cryptography.RSAOpenSsl
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("windows")>]
new System.Security.Cryptography.RSAOpenSsl : nativeint -> System.Security.Cryptography.RSAOpenSsl
Public Sub New (handle As IntPtr)

參數

handle
IntPtr

nativeint

要當做索引鍵使用的 OpenSSL RSA* 值。

屬性

例外狀況

handle 不是有效的 RSA*

handle 無效

備註

重要

OpenSSL 支援在相同進程中載入多個程式庫版本。 呼叫這個建構函式之前,請確認您的指標值來自這個類別所使用的相同 OpenSSL 版本。 如需詳細資訊,請參閱OpenSslVersion

適用於

RSAOpenSsl(RSAParameters)

來源:
RSAOpenSsl.cs
來源:
RSAOpenSsl.cs
來源:
RSAOpenSsl.cs

使用指定的金鑰參數,以初始化 RSAOpenSsl 類別的新執行個體。

public:
 RSAOpenSsl(System::Security::Cryptography::RSAParameters parameters);
public RSAOpenSsl (System.Security.Cryptography.RSAParameters parameters);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("windows")]
public RSAOpenSsl (System.Security.Cryptography.RSAParameters parameters);
new System.Security.Cryptography.RSAOpenSsl : System.Security.Cryptography.RSAParameters -> System.Security.Cryptography.RSAOpenSsl
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("windows")>]
new System.Security.Cryptography.RSAOpenSsl : System.Security.Cryptography.RSAParameters -> System.Security.Cryptography.RSAOpenSsl
Public Sub New (parameters As RSAParameters)

參數

parameters
RSAParameters

金鑰的參數。

屬性

例外狀況

parameters 不是有效的 RSA 金鑰。

備註

此建構函式相當於使用預設建構函式並呼叫 ImportParameters

適用於

RSAOpenSsl(SafeEvpPKeyHandle)

來源:
RSAOpenSsl.cs
來源:
RSAOpenSsl.cs
來源:
RSAOpenSsl.cs

從以 表示 EVP_PKEY* 的現有 OpenSSL 索引鍵,初始化 類別的新實例 RSAOpenSsl

public:
 RSAOpenSsl(System::Security::Cryptography::SafeEvpPKeyHandle ^ pkeyHandle);
public RSAOpenSsl (System.Security.Cryptography.SafeEvpPKeyHandle pkeyHandle);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("windows")]
public RSAOpenSsl (System.Security.Cryptography.SafeEvpPKeyHandle pkeyHandle);
new System.Security.Cryptography.RSAOpenSsl : System.Security.Cryptography.SafeEvpPKeyHandle -> System.Security.Cryptography.RSAOpenSsl
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("windows")>]
new System.Security.Cryptography.RSAOpenSsl : System.Security.Cryptography.SafeEvpPKeyHandle -> System.Security.Cryptography.RSAOpenSsl
Public Sub New (pkeyHandle As SafeEvpPKeyHandle)

參數

pkeyHandle
SafeEvpPKeyHandle

要當做索引鍵使用的 OpenSSL EVP_PKEY* 值,表示為 SafeEvpPKeyHandle

屬性

例外狀況

pkeyHandle 不代表 RSA 金鑰。

pkeyHandlenull

pkeyHandle 根據 IsInvalid 無效。

備註

重要

OpenSSL 支援在相同進程中載入多個程式庫版本。 呼叫這個建構函式之前,請確認您的指標值來自這個類別所使用的相同 OpenSSL 版本。 如需詳細資訊,請參閱OpenSslVersion

適用於