CngKey.Import 方法

定义

通过将密钥材料导入密钥存储提供程序(KSP)来创建一个新密钥。

重载

名称 说明
Import(Byte[], CngKeyBlobFormat, CngProvider)

通过使用指定的格式将指定的密钥材料导入指定的密钥存储提供程序(KSP),创建一个新密钥。

Import(Byte[], CngKeyBlobFormat)

通过将指定的密钥材料导入默认密钥存储提供程序(KSP),并使用指定的格式来创建新密钥。

Import(Byte[], CngKeyBlobFormat, CngProvider)

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

通过使用指定的格式将指定的密钥材料导入指定的密钥存储提供程序(KSP),创建一个新密钥。

public:
 static System::Security::Cryptography::CngKey ^ Import(cli::array <System::Byte> ^ keyBlob, System::Security::Cryptography::CngKeyBlobFormat ^ format, System::Security::Cryptography::CngProvider ^ provider);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Import(byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format, System.Security.Cryptography.CngProvider provider);
public static System.Security.Cryptography.CngKey Import(byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format, System.Security.Cryptography.CngProvider provider);
[System.Security.SecurityCritical]
public static System.Security.Cryptography.CngKey Import(byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format, System.Security.Cryptography.CngProvider provider);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Import : byte[] * System.Security.Cryptography.CngKeyBlobFormat * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.CngKey
static member Import : byte[] * System.Security.Cryptography.CngKeyBlobFormat * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.CngKey
[<System.Security.SecurityCritical>]
static member Import : byte[] * System.Security.Cryptography.CngKeyBlobFormat * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.CngKey
Public Shared Function Import (keyBlob As Byte(), format As CngKeyBlobFormat, provider As CngProvider) As CngKey

参数

keyBlob
Byte[]

包含密钥信息的数组。

format
CngKeyBlobFormat

一个指定数组格式 keyBlob 的对象。

provider
CngProvider

KSP。

返回

新密钥。

属性

例外

keyBlobformatprovidernull

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

所有其他错误。

注解

Important

在 Windows 操作系统上,Windows 7和 Windows Server 2008 R2 之前,不支持某些 CNG 密钥二进制大型对象(BLOB)格式。

适用于

Import(Byte[], CngKeyBlobFormat)

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

通过将指定的密钥材料导入默认密钥存储提供程序(KSP),并使用指定的格式来创建新密钥。

public:
 static System::Security::Cryptography::CngKey ^ Import(cli::array <System::Byte> ^ keyBlob, System::Security::Cryptography::CngKeyBlobFormat ^ format);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Import(byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format);
public static System.Security.Cryptography.CngKey Import(byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Import : byte[] * System.Security.Cryptography.CngKeyBlobFormat -> System.Security.Cryptography.CngKey
static member Import : byte[] * System.Security.Cryptography.CngKeyBlobFormat -> System.Security.Cryptography.CngKey
Public Shared Function Import (keyBlob As Byte(), format As CngKeyBlobFormat) As CngKey

参数

keyBlob
Byte[]

包含密钥信息的数组。

format
CngKeyBlobFormat

一个指定数组格式 keyBlob 的对象。

返回

新密钥。

属性

例外

keyBlobformatnull.

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

所有其他错误。

注解

默认的 KSP 为 MicrosoftSoftwareKeyStorageProvider.

Important

在 Windows 操作系统上,Windows 7和 Windows Server 2008 R2 之前,不支持某些 CNG 密钥二进制大型对象(BLOB)格式。

适用于