RSACng 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 RSACng 类的新实例。
重载
| 名称 | 说明 |
|---|---|
| RSACng() |
使用随机 2,048 位密钥对初始化类的新实例 RSACng 。 |
| RSACng(Int32) |
使用指定大小的随机生成的键初始化类的新实例 RSACng 。 |
| RSACng(CngKey) |
使用指定的键初始化类的新实例 RSACng 。 |
RSACng()
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
使用随机 2,048 位密钥对初始化类的新实例 RSACng 。
public:
RSACng();
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public RSACng();
public RSACng();
Public Sub New ()
- 属性
注解
此构造函数不会立即生成新的公钥/私钥对。 此构造函数将 KeySize 属性设置为 2048,当需要使用属性值生成一个键时。 如果通过 ImportParameters 方法或其他密钥导入方法加载密钥,则此构造函数中的密钥大小没有任何意义。
适用于
RSACng(Int32)
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
使用指定大小的随机生成的键初始化类的新实例 RSACng 。
public:
RSACng(int keySize);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public RSACng(int keySize);
public RSACng(int keySize);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.RSACng : int -> System.Security.Cryptography.RSACng
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)
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
使用指定的键初始化类的新实例 RSACng 。
public:
RSACng(System::Security::Cryptography::CngKey ^ key);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public RSACng(System.Security.Cryptography.CngKey key);
public RSACng(System.Security.Cryptography.CngKey key);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.RSACng : System.Security.Cryptography.CngKey -> System.Security.Cryptography.RSACng
new System.Security.Cryptography.RSACng : System.Security.Cryptography.CngKey -> System.Security.Cryptography.RSACng
Public Sub New (key As CngKey)
参数
- key
- CngKey
用于 RSA 操作的密钥。
- 属性
例外
key 不是有效的 RSA 密钥。
key 是 null。
注解
CngKey.AlgorithmGroup
key必须是 CngAlgorithmGroup.Rsa 。
此构造函数创建密钥的副本。 即使 key 已释放,RSA 中的此密钥对象的副本仍然处于活动状态。