CngKey.Import Метод

Определение

Создает новый ключ путем импорта ключевого материала в KSP.

Перегрузки

Import(Byte[], CngKeyBlobFormat, CngProvider)

Создает ключ путем импорта заданных сведений о ключе в указанный поставщик хранилища ключей (KSP), используя указанный формат.

Import(Byte[], CngKeyBlobFormat)

Создает новый ключ путем импорта заданного ключевого материала в KSP по умолчанию, используя заданный формат.

Import(Byte[], CngKeyBlobFormat, CngProvider)

Создает ключ путем импорта заданных сведений о ключе в указанный поставщик хранилища ключей (KSP), используя указанный формат.

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

Параметры

keyBlob
Byte[]

Массив, содержащий сведения о ключе.

format
CngKeyBlobFormat

Объект, который указывает формат массива keyBlob.

provider
CngProvider

KSP.

Возвращаемое значение

CngKey

Новый ключ.

Атрибуты

Исключения

Значение параметра keyBlob, format или provider равно null.

Криптография следующего поколения (CNG) не поддерживается в этой системе.

Все остальные ошибки.

Комментарии

Важно!

В операционных системах Windows до Windows 7 и Windows Server 2008 R2 некоторые форматы больших двоичных объектов CNG не поддерживаются.

Применяется к

Import(Byte[], CngKeyBlobFormat)

Создает новый ключ путем импорта заданного ключевого материала в KSP по умолчанию, используя заданный формат.

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

Параметры

keyBlob
Byte[]

Массив, содержащий сведения о ключе.

format
CngKeyBlobFormat

Объект, который указывает формат массива keyBlob.

Возвращаемое значение

CngKey

Новый ключ.

Атрибуты

Исключения

Параметр keyBlob или format имеет значение null.

Криптография следующего поколения (CNG) не поддерживается в этой системе.

Все остальные ошибки.

Комментарии

По умолчанию используется MicrosoftSoftwareKeyStorageProviderKSP.

Важно!

В операционных системах Windows до Windows 7 и Windows Server 2008 R2 некоторые форматы больших двоичных объектов CNG не поддерживаются.

Применяется к