CngKey.Create Метод

Определение

Создает объект CngKey, представляющий новый ключ.

Перегрузки

Create(CngAlgorithm)

Создает объект CngKey, который может использоваться в заданном алгоритме.

Create(CngAlgorithm, String)

Создает именованный объект CngKey, обеспечивающий работу заданного алгоритма.

Create(CngAlgorithm, String, CngKeyCreationParameters)

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

Create(CngAlgorithm)

Исходный код:
Cng.NotSupported.cs
Исходный код:
Cng.NotSupported.cs
Исходный код:
Cng.NotSupported.cs

Создает объект CngKey, который может использоваться в заданном алгоритме.

public:
 static System::Security::Cryptography::CngKey ^ Create(System::Security::Cryptography::CngAlgorithm ^ algorithm);
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm);
static member Create : System.Security.Cryptography.CngAlgorithm -> System.Security.Cryptography.CngKey
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Create : System.Security.Cryptography.CngAlgorithm -> System.Security.Cryptography.CngKey
Public Shared Function Create (algorithm As CngAlgorithm) As CngKey

Параметры

algorithm
CngAlgorithm

Алгоритм, в котором будет использоваться ключ.

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

Эфемерный ключ.

Атрибуты

Исключения

algorithm имеет значение null.

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

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

Комментарии

Эта перегрузка создает ключ без имени, что означает, что ключ является эфемерным (то есть он не будет сохранен). Он также создает объект по умолчанию CngKeyCreationParameters , указывающий значение по умолчанию CngProvider и другие дополнительные параметры для ключа.

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

Create(CngAlgorithm, String)

Исходный код:
Cng.NotSupported.cs
Исходный код:
Cng.NotSupported.cs
Исходный код:
Cng.NotSupported.cs

Создает именованный объект CngKey, обеспечивающий работу заданного алгоритма.

public:
 static System::Security::Cryptography::CngKey ^ Create(System::Security::Cryptography::CngAlgorithm ^ algorithm, System::String ^ keyName);
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string keyName);
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string? keyName);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string? keyName);
static member Create : System.Security.Cryptography.CngAlgorithm * string -> System.Security.Cryptography.CngKey
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Create : System.Security.Cryptography.CngAlgorithm * string -> System.Security.Cryptography.CngKey
Public Shared Function Create (algorithm As CngAlgorithm, keyName As String) As CngKey

Параметры

algorithm
CngAlgorithm

Алгоритм, в котором будет использоваться ключ.

keyName
String

Имя ключа. Если имя не задано, ключ не будет сохранен.

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

Постоянный или эфемерный ключ, обеспечивающий работу заданного алгоритма.

Атрибуты

Исключения

algorithm имеет значение null.

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

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

Комментарии

Если keyName параметр указан, эта перегрузка создает сохраненный ключ. Если keyName параметр не указан, ключ будет эфемерным. Эта перегрузка также создает объект по умолчанию CngKeyCreationParameters , указывающий значение по умолчанию CngProvider и другие дополнительные параметры для ключа.

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

Create(CngAlgorithm, String, CngKeyCreationParameters)

Исходный код:
Cng.NotSupported.cs
Исходный код:
Cng.NotSupported.cs
Исходный код:
Cng.NotSupported.cs

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

public:
 static System::Security::Cryptography::CngKey ^ Create(System::Security::Cryptography::CngAlgorithm ^ algorithm, System::String ^ keyName, System::Security::Cryptography::CngKeyCreationParameters ^ creationParameters);
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string keyName, System.Security.Cryptography.CngKeyCreationParameters creationParameters);
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string? keyName, System.Security.Cryptography.CngKeyCreationParameters? creationParameters);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string? keyName, System.Security.Cryptography.CngKeyCreationParameters? creationParameters);
[System.Security.SecurityCritical]
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string keyName, System.Security.Cryptography.CngKeyCreationParameters creationParameters);
static member Create : System.Security.Cryptography.CngAlgorithm * string * System.Security.Cryptography.CngKeyCreationParameters -> System.Security.Cryptography.CngKey
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Create : System.Security.Cryptography.CngAlgorithm * string * System.Security.Cryptography.CngKeyCreationParameters -> System.Security.Cryptography.CngKey
[<System.Security.SecurityCritical>]
static member Create : System.Security.Cryptography.CngAlgorithm * string * System.Security.Cryptography.CngKeyCreationParameters -> System.Security.Cryptography.CngKey
Public Shared Function Create (algorithm As CngAlgorithm, keyName As String, creationParameters As CngKeyCreationParameters) As CngKey

Параметры

algorithm
CngAlgorithm

Алгоритм, в котором будет использоваться ключ.

keyName
String

Имя ключа. Если имя не задано, ключ не будет сохранен.

creationParameters
CngKeyCreationParameters

Объект, задающий дополнительные параметры для данного метода, включая CngProvider.

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

Постоянный или эфемерный ключ, обеспечивающий работу заданного алгоритма.

Атрибуты

Исключения

algorithm имеет значение null.

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

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

Комментарии

Если keyName параметр указан, эта перегрузка создает сохраненный ключ. Если keyName параметр не указан, ключ будет эфемерным.

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