AesCng 构造函数

定义

初始化 AesCng 类的新实例。

重载

名称 说明
AesCng()

使用临时键初始化类的新实例 AesCng

AesCng(CngKey)

用指定的AesCng值初始化类的新实例CngKey

AesCng(String)

使用指定的键名称初始化类的新实例 AesCng ,该名称表示现有的持久化 AES 键。

AesCng(String, CngProvider)

使用指定的密钥名称(表示现有的持久 AES 密钥和指定的密钥存储提供程序(KSP)初始化类的新实例 AesCng

AesCng(String, CngProvider, CngKeyOpenOptions)

使用指定的键名称初始化类的新实例 AesCng ,该名称表示现有的持久化 AES 密钥、指定的密钥存储提供程序 (KSP) 和密钥打开选项。

AesCng()

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

使用临时键初始化类的新实例 AesCng

public:
 AesCng();
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public AesCng();
public AesCng();
Public Sub New ()
属性

适用于

AesCng(CngKey)

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

用指定的AesCng值初始化类的新实例CngKey

public:
 AesCng(System::Security::Cryptography::CngKey ^ key);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public AesCng(System.Security.Cryptography.CngKey key);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.AesCng : System.Security.Cryptography.CngKey -> System.Security.Cryptography.AesCng
Public Sub New (key As CngKey)

参数

key
CngKey

将用作当前对象执行的加密操作的输入的密钥。

属性

例外

keynull

key 不表示 AES 键。

-或-

执行加密操作时出错。

此系统上不支持下一代加密(CNG)。

适用于

AesCng(String)

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

使用指定的键名称初始化类的新实例 AesCng ,该名称表示现有的持久化 AES 键。

public:
 AesCng(System::String ^ keyName);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public AesCng(string keyName);
public AesCng(string keyName);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.AesCng : string -> System.Security.Cryptography.AesCng
new System.Security.Cryptography.AesCng : string -> System.Security.Cryptography.AesCng
Public Sub New (keyName As String)

参数

keyName
String

密钥的名称。

属性

例外

keyNamenull

此系统上不支持下一代加密(CNG)。

所有其他错误。

注解

此构造函数使用默认值 CngKeyOpenOptionsNoneMicrosoftSoftwareKeyStorageProvider 作为默认密钥存储提供程序(KSP)打开密钥。

另请参阅

适用于

AesCng(String, CngProvider)

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

使用指定的密钥名称(表示现有的持久 AES 密钥和指定的密钥存储提供程序(KSP)初始化类的新实例 AesCng

public:
 AesCng(System::String ^ keyName, System::Security::Cryptography::CngProvider ^ provider);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public AesCng(string keyName, System.Security.Cryptography.CngProvider provider);
public AesCng(string keyName, System.Security.Cryptography.CngProvider provider);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.AesCng : string * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.AesCng
new System.Security.Cryptography.AesCng : string * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.AesCng
Public Sub New (keyName As String, provider As CngProvider)

参数

keyName
String

密钥的名称。

provider
CngProvider

包含密钥的 KSP。

属性

例外

keyNamenull

-或-

providernull

此系统上不支持下一代加密(CNG)。

所有其他错误。

注解

默认值CngKeyOpenOptionsNone用于打开密钥。

另请参阅

适用于

AesCng(String, CngProvider, CngKeyOpenOptions)

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

使用指定的键名称初始化类的新实例 AesCng ,该名称表示现有的持久化 AES 密钥、指定的密钥存储提供程序 (KSP) 和密钥打开选项。

public:
 AesCng(System::String ^ keyName, System::Security::Cryptography::CngProvider ^ provider, System::Security::Cryptography::CngKeyOpenOptions openOptions);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public AesCng(string keyName, System.Security.Cryptography.CngProvider provider, System.Security.Cryptography.CngKeyOpenOptions openOptions);
public AesCng(string keyName, System.Security.Cryptography.CngProvider provider, System.Security.Cryptography.CngKeyOpenOptions openOptions);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.AesCng : string * System.Security.Cryptography.CngProvider * System.Security.Cryptography.CngKeyOpenOptions -> System.Security.Cryptography.AesCng
new System.Security.Cryptography.AesCng : string * System.Security.Cryptography.CngProvider * System.Security.Cryptography.CngKeyOpenOptions -> System.Security.Cryptography.AesCng
Public Sub New (keyName As String, provider As CngProvider, openOptions As CngKeyOpenOptions)

参数

keyName
String

密钥的名称。

provider
CngProvider

包含密钥的 KSP。

openOptions
CngKeyOpenOptions

枚举值的按位组合,指定用于打开键的选项,例如从(计算机或用户存储)打开密钥的位置以及是否禁止显示 UI 提示。

属性

例外

keyNamenull

-或-

providernull

此系统上不支持下一代加密(CNG)。

所有其他错误。

另请参阅

适用于