AesCng AesCng AesCng AesCng Constructors

定义

重载

AesCng() AesCng() AesCng()

使用临时密钥初始化 AesCng 类的新实例。Initializes a new instance of the AesCng class with an ephemeral key.

AesCng(String) AesCng(String) AesCng(String) AesCng(String)

使用指定密钥名称初始化 AesCng 类的新实例,该密钥名称表示现有的保留的 AES 密钥。Initializes a new instance of the AesCng class with the specified key name, which represents an existing persisted AES key.

AesCng(String, CngProvider) AesCng(String, CngProvider) AesCng(String, CngProvider) AesCng(String, CngProvider)

使用指定的密钥名称和密钥存储提供者 (KSP) 初始化 AesCng 类的新实例,其中指定的密钥名称表示现有的保留的 AES 密钥。Initializes a new instance of the AesCng class with the specified key name, which represents an existing persisted AES key, and the specified key storage provider (KSP).

AesCng(String, CngProvider, CngKeyOpenOptions) AesCng(String, CngProvider, CngKeyOpenOptions) AesCng(String, CngProvider, CngKeyOpenOptions) AesCng(String, CngProvider, CngKeyOpenOptions)

使用指定的密钥名称、密钥存储提供者 (KSP) 和密钥打开选项初始化 AesCng 类的新实例,其中指定的密钥名称表示现有的保留的 AES 密钥。Initializes a new instance of the AesCng class with the specified key name, which represents an existing persisted AES key, the specified key storage provider (KSP) and key open options.

AesCng() AesCng() AesCng()

使用临时密钥初始化 AesCng 类的新实例。Initializes a new instance of the AesCng class with an ephemeral key.

public:
 AesCng();
public AesCng ();
Public Sub New ()

AesCng(String) AesCng(String) AesCng(String) AesCng(String)

使用指定密钥名称初始化 AesCng 类的新实例,该密钥名称表示现有的保留的 AES 密钥。Initializes a new instance of the AesCng class with the specified key name, which represents an existing persisted AES key.

public:
 AesCng(System::String ^ keyName);
public AesCng (string keyName);
new System.Security.Cryptography.AesCng : string -> System.Security.Cryptography.AesCng
Public Sub New (keyName As String)

参数

keyName
String String String String

密钥名称。The name of the key.

异常

此系统上不支持下一代加密技术 (CNG)。Cryptography Next Generation (CNG) is not supported on this system.

注解

此构造函数使用默认值CngKeyOpenOptions的值NoneMicrosoftSoftwareKeyStorageProvider作为默认密钥存储提供程序 (KSP) 以打开密钥。This constructor uses a default CngKeyOpenOptions value of None and MicrosoftSoftwareKeyStorageProvider as the default key storage provider (KSP) to open the key.

另请参阅

AesCng(String, CngProvider) AesCng(String, CngProvider) AesCng(String, CngProvider) AesCng(String, CngProvider)

使用指定的密钥名称和密钥存储提供者 (KSP) 初始化 AesCng 类的新实例,其中指定的密钥名称表示现有的保留的 AES 密钥。Initializes a new instance of the AesCng class with the specified key name, which represents an existing persisted AES key, and the specified key storage provider (KSP).

public:
 AesCng(System::String ^ keyName, System::Security::Cryptography::CngProvider ^ provider);
public AesCng (string keyName, System.Security.Cryptography.CngProvider provider);
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 String String String

密钥名称。The name of the key.

provider
CngProvider CngProvider CngProvider CngProvider

包含密钥的 KSP。The KSP that contains the key.

异常

keyNamenullkeyName is null.

- 或 --or- providernullprovider is null.

此系统上不支持下一代加密技术 (CNG)。Cryptography Next Generation (CNG) is not supported on this system.

注解

默认值CngKeyOpenOptions的值None用于打开密钥。A default CngKeyOpenOptions value of None is used to open the key.

另请参阅

AesCng(String, CngProvider, CngKeyOpenOptions) AesCng(String, CngProvider, CngKeyOpenOptions) AesCng(String, CngProvider, CngKeyOpenOptions) AesCng(String, CngProvider, CngKeyOpenOptions)

使用指定的密钥名称、密钥存储提供者 (KSP) 和密钥打开选项初始化 AesCng 类的新实例,其中指定的密钥名称表示现有的保留的 AES 密钥。Initializes a new instance of the AesCng class with the specified key name, which represents an existing persisted AES key, the specified key storage provider (KSP) and key open options.

public:
 AesCng(System::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);
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 String String String

密钥名称。The name of the key.

provider
CngProvider CngProvider CngProvider CngProvider

包含密钥的 KSP。The KSP that contains the key.

openOptions
CngKeyOpenOptions CngKeyOpenOptions CngKeyOpenOptions CngKeyOpenOptions

枚举值的一个按位组合,这些值指定打开密钥的选项,例如打开密钥的位置(计算机或用户存储)以及是否取消 UI 提示。A bitwise combination of the enumeration values that specify options for opening the key, such as where the key is opened from (machine or user storage) and whether to suppress UI prompting.

异常

keyNamenullkeyName is null.

- 或 --or- providernullprovider is null.

此系统上不支持下一代加密技术 (CNG)。Cryptography Next Generation (CNG) is not supported on this system.

另请参阅

适用于