Redigera

Dela via


CngKey.Import Method

Definition

Creates a new key by importing key material into the key storage provider (KSP).

Overloads

Import(Byte[], CngKeyBlobFormat, CngProvider)

Creates a new key by importing the specified key material into the specified key storage provider (KSP), using the specified format.

Import(Byte[], CngKeyBlobFormat)

Creates a new key by importing the specified key material into the default key storage provider (KSP) and using the specified format.

Import(Byte[], CngKeyBlobFormat, CngProvider)

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

Creates a new key by importing the specified key material into the specified key storage provider (KSP), using the specified format.

public:
 static System::Security::Cryptography::CngKey ^ Import(cli::array <System::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.Runtime.Versioning.SupportedOSPlatform("windows")]
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);
static member Import : byte[] * System.Security.Cryptography.CngKeyBlobFormat * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.CngKey
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
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

Parameters

keyBlob
Byte[]

An array that contains the key information.

format
CngKeyBlobFormat

An object that specifies the format of the keyBlob array.

provider
CngProvider

The KSP.

Returns

A new key.

Attributes

Exceptions

keyBlob, format, or provider is null.

Cryptography Next Generation (CNG) is not supported on this system.

All other errors.

Remarks

Important

On Windows operating systems before Windows 7 and Windows Server 2008 R2, some CNG key binary large object (BLOB) formats are not supported.

Applies to

Import(Byte[], CngKeyBlobFormat)

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

Creates a new key by importing the specified key material into the default key storage provider (KSP) and using the specified format.

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

Parameters

keyBlob
Byte[]

An array that contains the key information.

format
CngKeyBlobFormat

An object that specifies the format of the keyBlob array.

Returns

A new key.

Attributes

Exceptions

keyBlob or format is null.

Cryptography Next Generation (CNG) is not supported on this system.

All other errors.

Remarks

The default KSP is MicrosoftSoftwareKeyStorageProvider.

Important

On Windows operating systems before Windows 7 and Windows Server 2008 R2, some CNG key binary large object (BLOB) formats are not supported.

Applies to