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
- Исходный код:
- Cng.NotSupported.cs
- Исходный код:
- Cng.NotSupported.cs
CngKey Создает объект, который можно использовать с указанным алгоритмом.
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);
public static System.Security.Cryptography.CngKey Create(System.Security.Cryptography.CngAlgorithm algorithm);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Create : System.Security.Cryptography.CngAlgorithm -> System.Security.Cryptography.CngKey
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) не поддерживается в этой системе.
Все остальные ошибки.
Комментарии
Эта перегрузка создает ключ без имени, что означает, что ключ является временным (т. е. он не будет сохранен). Он также создает объект по умолчанию, указывающий значение по умолчанию CngKeyCreationParametersCngProvider и другие дополнительные параметры для ключа.
Применяется к
Create(CngAlgorithm, String)
- Исходный код:
- Cng.NotSupported.cs
- Исходный код:
- Cng.NotSupported.cs
- Исходный код:
- 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.Runtime.Versioning.SupportedOSPlatform("windows")]
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);
public static System.Security.Cryptography.CngKey Create(System.Security.Cryptography.CngAlgorithm algorithm, string keyName);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Create : System.Security.Cryptography.CngAlgorithm * string -> System.Security.Cryptography.CngKey
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 этот ключ не указан, ключ будет эфемерным. Эта перегрузка также создает объект по умолчанию, указывающий значение по умолчанию CngKeyCreationParametersCngProvider и другие дополнительные параметры для ключа.
Применяется к
Create(CngAlgorithm, String, CngKeyCreationParameters)
- Исходный код:
- Cng.NotSupported.cs
- Исходный код:
- Cng.NotSupported.cs
- Исходный код:
- 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);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
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);
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);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Create : System.Security.Cryptography.CngAlgorithm * string * System.Security.Cryptography.CngKeyCreationParameters -> System.Security.Cryptography.CngKey
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 этот ключ не указан, ключ будет эфемерным.