語言

CngKey.Import 方法

定義

透過將金鑰資料匯入金鑰儲存提供者(KSP)來建立新金鑰。

多載

名稱 Description
Import(Byte[], CngKeyBlobFormat, CngProvider)

透過將指定的金鑰材料匯入指定的金鑰儲存提供者(KSP),並使用指定格式來建立新的金鑰。

Import(Byte[], CngKeyBlobFormat)

透過將指定的金鑰材料匯入預設金鑰儲存提供者(KSP)並使用指定格式來建立新金鑰。

Import(Byte[], CngKeyBlobFormat, CngProvider)

來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
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。

傳回

一把新鑰匙。

屬性

例外狀況

keyBlob, , format或 provider 是 null。

此系統不支援密碼學下一代(CNG)。

其他所有錯誤。

備註

Important

在 Windows 7 及 Windows Server 2008 R2 之前的 Windows 作業系統中,不支援某些 CNG 鍵二進位大型物件(BLOB)格式。

適用於

Import(Byte[], CngKeyBlobFormat)

來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
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 的物件。

傳回

一把新鑰匙。

屬性

例外狀況

keyBlob 或 format 為 null。

此系統不支援密碼學下一代(CNG)。

其他所有錯誤。

備註

預設的 KSP 為 MicrosoftSoftwareKeyStorageProvider。

Important

在 Windows 7 及 Windows Server 2008 R2 之前的 Windows 作業系統中,不支援某些 CNG 鍵二進位大型物件(BLOB)格式。

適用於