RSAOpenSsl 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 RSAOpenSsl 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| RSAOpenSsl() |
初始化類別的新實例 RSAOpenSsl ,使用隨機的 2048 位元金鑰對。 |
| RSAOpenSsl(Int32) |
初始化類別的新實例 RSAOpenSsl ,使用指定大小的隨機生成鍵。 |
| RSAOpenSsl(IntPtr) |
從現有的 OpenSSL 金鑰(以 RSAOpenSsl. 表示)初始化該 |
| RSAOpenSsl(RSAParameters) |
使用指定的金鑰參數初始化該類別的新實例 RSAOpenSsl 。 |
| RSAOpenSsl(SafeEvpPKeyHandle) |
從現有的 OpenSSL 金鑰(以 RSAOpenSsl. 表示)初始化該 |
RSAOpenSsl()
初始化類別的新實例 RSAOpenSsl ,使用隨機的 2048 位元金鑰對。
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 RSAOpenSsl();
Public Sub New ()
- 屬性
備註
此構造子不會立即產生新的公私鑰對。 此建構子將屬性設定 KeySize 為 2048,當需要鍵時,會利用屬性值產生鍵值。 若金鑰是透過該 ImportParameters 方法或其他金鑰匯入方法載入,該建構子的金鑰大小則無意義。
適用於
RSAOpenSsl(Int32)
初始化類別的新實例 RSAOpenSsl ,使用指定大小的隨機生成鍵。
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);
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")>]
new System.Security.Cryptography.RSAOpenSsl : int -> System.Security.Cryptography.RSAOpenSsl
new System.Security.Cryptography.RSAOpenSsl : int -> System.Security.Cryptography.RSAOpenSsl
Public Sub New (keySize As Integer)
參數
- keySize
- Int32
- 屬性
例外狀況
keySize 不成立。
適用於
RSAOpenSsl(IntPtr)
從現有的 OpenSSL 金鑰(以 RSAOpenSsl. 表示)初始化該RSA*類別的新實例。
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);
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")>]
new System.Security.Cryptography.RSAOpenSsl : nativeint -> System.Security.Cryptography.RSAOpenSsl
new System.Security.Cryptography.RSAOpenSsl : nativeint -> System.Security.Cryptography.RSAOpenSsl
Public Sub New (handle As IntPtr)
參數
- handle
-
IntPtr
nativeint
- 屬性
例外狀況
handle 不是有效的 RSA*。
handle 無效
備註
Important
OpenSSL 支援在同一程序中載入多個函式庫版本。 在呼叫這個建構子之前,請確認你的指標值是否來自與此類別相同的 OpenSSL 版本。 如需詳細資訊,請參閱OpenSslVersion。
適用於
RSAOpenSsl(RSAParameters)
使用指定的金鑰參數初始化該類別的新實例 RSAOpenSsl 。
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);
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")>]
new System.Security.Cryptography.RSAOpenSsl : System.Security.Cryptography.RSAParameters -> System.Security.Cryptography.RSAOpenSsl
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)
從現有的 OpenSSL 金鑰(以 RSAOpenSsl. 表示)初始化該EVP_PKEY*類別的新實例。
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);
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")>]
new System.Security.Cryptography.RSAOpenSsl : System.Security.Cryptography.SafeEvpPKeyHandle -> System.Security.Cryptography.RSAOpenSsl
new System.Security.Cryptography.RSAOpenSsl : System.Security.Cryptography.SafeEvpPKeyHandle -> System.Security.Cryptography.RSAOpenSsl
Public Sub New (pkeyHandle As SafeEvpPKeyHandle)
參數
- pkeyHandle
- SafeEvpPKeyHandle
- 屬性
例外狀況
pkeyHandle 不代表 RSA 金鑰。
pkeyHandle 是 null
pkeyHandle 根據 IsInvalid是無效的。
備註
在 .NET 9 及以後版本中,pkeyHandle 的外部修改也會影響該建構器所建立實例中儲存的 handle。
Important
OpenSSL 支援在同一程序中載入多個函式庫版本。 在呼叫這個建構子之前,請確認你的指標值是否來自與此類別相同的 OpenSSL 版本。 如需詳細資訊,請參閱OpenSslVersion。