语言

RSAOpenSsl 构造函数

定义

初始化 RSAOpenSsl 类的新实例。

重载

名称 说明
RSAOpenSsl()

使用随机 2048 位密钥对初始化类的新实例 RSAOpenSsl 。

RSAOpenSsl(Int32)

使用指定大小的随机生成的键初始化类的新实例 RSAOpenSsl 。

RSAOpenSsl(IntPtr)

从表示为 <a0/a0> 的现有 OpenSSL 键初始化类的新实例。

RSAOpenSsl(RSAParameters)

使用指定的键参数初始化类的新实例 RSAOpenSsl 。

RSAOpenSsl(SafeEvpPKeyHandle)

从表示为 <a0/a0> 的现有 OpenSSL 键初始化类的新实例。

RSAOpenSsl()

Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs

使用随机 2048 位密钥对初始化类的新实例 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 RSAOpenSsl();
Public Sub New ()
特性

注解

此构造函数不会立即生成新的公钥/私钥对。 此构造函数将 KeySize 属性设置为 2048,当需要键时,将使用属性值生成一个。 如果通过 ImportParameters 方法或其他密钥导入方法加载密钥,则此构造函数中的密钥大小没有任何意义。

适用于

RSAOpenSsl(Int32)

Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs

使用指定大小的随机生成的键初始化类的新实例 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)

Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs

从表示为 <a0/a0> 的现有 OpenSSL 键初始化类的新实例。

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)

Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs

使用指定的键参数初始化类的新实例 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)

Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs

从表示为 <a0/a0> 的现有 OpenSSL 键初始化类的新实例。

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的外部修改也会影响此构造函数创建的实例中存储的句柄。

Important

OpenSSL 支持在同一进程中加载多个库版本。 在调用此构造函数之前,请验证指针值是否来自此类使用的相同版本的 OpenSSL。 有关详细信息,请参阅 OpenSslVersion。

适用于