RSAOpenSsl 构造函数

定义

重载

RSAOpenSsl()

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

RSAOpenSsl(Int32)

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

RSAOpenSsl(IntPtr)

从表示为 RSA*的现有 RSAOpenSsl OpenSSL 键初始化 类的新实例。

RSAOpenSsl(RSAParameters)

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

RSAOpenSsl(SafeEvpPKeyHandle)

从表示为 EVP_PKEY*的现有 RSAOpenSsl OpenSSL 键初始化 类的新实例。

RSAOpenSsl()

Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
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)

Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
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)

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

从表示为 RSA*的现有 RSAOpenSsl OpenSSL 键初始化 类的新实例。

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)

Source:
RSAOpenSsl.cs
Source:
RSAOpenSsl.cs
Source:
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)

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

从表示为 EVP_PKEY*的现有 RSAOpenSsl OpenSSL 键初始化 类的新实例。

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

适用于