CngKey.Create Método

Definição

Cria um objeto CngKey que representa uma nova chave.

Sobrecargas

Create(CngAlgorithm)

Cria um objeto CngKey que pode ser usado com o algoritmo especificado.

Create(CngAlgorithm, String)

Cria um objeto CngKey nomeado que fornece o algoritmo especificado.

Create(CngAlgorithm, String, CngKeyCreationParameters)

Cria um objeto CngKey nomeado que fornece o algoritmo especificado, usando os parâmetros de criação de chave fornecidos.

Create(CngAlgorithm)

Cria um objeto CngKey que pode ser usado com o algoritmo especificado.

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

Parâmetros

algorithm
CngAlgorithm

O algoritmo com o qual a chave será usada.

Retornos

CngKey

Uma chave efêmera.

Atributos

Exceções

algorithm é null.

A CNG (Cryptography Next Generation) não é compatível com este sistema.

Todos os outros erros.

Comentários

Essa sobrecarga cria uma chave sem um nome, o que significa que a chave é efêmera (ou seja, ela não será persistente). Ele também cria um objeto padrão CngKeyCreationParameters que especifica um padrão CngProvider e outros parâmetros avançados para a chave.

Aplica-se a

Create(CngAlgorithm, String)

Cria um objeto CngKey nomeado que fornece o algoritmo especificado.

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

Parâmetros

algorithm
CngAlgorithm

O algoritmo com o qual a chave será usada.

keyName
String

O nome da chave. Se um nome não for fornecido, a chave não será persistente.

Retornos

CngKey

Uma chave efêmera ou persistente que fornece o algoritmo especificado.

Atributos

Exceções

algorithm é null.

A CNG (Cryptography Next Generation) não é compatível com este sistema.

Todos os outros erros.

Comentários

Se keyName for fornecida, essa sobrecarga criará uma chave persistente. Se keyName não for fornecido, a chave será efêmera. Essa sobrecarga também cria um objeto padrão CngKeyCreationParameters que especifica um padrão CngProvider e outros parâmetros avançados para a chave.

Aplica-se a

Create(CngAlgorithm, String, CngKeyCreationParameters)

Cria um objeto CngKey nomeado que fornece o algoritmo especificado, usando os parâmetros de criação de chave fornecidos.

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

Parâmetros

algorithm
CngAlgorithm

O algoritmo com o qual a chave será usada.

keyName
String

O nome da chave. Se um nome não for fornecido, a chave não será persistente.

creationParameters
CngKeyCreationParameters

Um objeto que especifica os parâmetros avançados para o método, incluindo o CngProvider.

Retornos

CngKey

Uma chave efêmera ou persistente que fornece o algoritmo especificado.

Atributos

Exceções

algorithm é null.

A CNG (Cryptography Next Generation) não é compatível com este sistema.

Todos os outros erros.

Comentários

Se keyName for fornecida, essa sobrecarga criará uma chave persistente. Se keyName não for fornecido, a chave será efêmera.

Aplica-se a