CngKey.Create Método

Definición

Crea un objeto CngKey que representa una nueva clave.

Sobrecargas

Create(CngAlgorithm)

Crea un objeto CngKey que se puede utilizar con el algoritmo especificado.

Create(CngAlgorithm, String)

Crea un objeto CngKey con nombre que proporciona el algoritmo especificado.

Create(CngAlgorithm, String, CngKeyCreationParameters)

Crea un objeto CngKey con nombre que proporciona el algoritmo especificado, utilizando los parámetros de creación de claves proporcionados.

Create(CngAlgorithm)

Crea un objeto CngKey que se puede utilizar con el 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

Algoritmo con el que se utilizará la clave.

Devoluciones

CngKey

Clave efímera.

Atributos

Excepciones

algorithm es null.

Este sistema no es compatible con Cryptography Next Generation (CNG).

Todos los demás errores.

Comentarios

Esta sobrecarga crea una clave sin un nombre, lo que significa que la clave es efímera (es decir, no se conservará). También crea un objeto predeterminado CngKeyCreationParameters que especifica un valor predeterminado CngProvider y otros parámetros avanzados para la clave.

Se aplica a

Create(CngAlgorithm, String)

Crea un objeto CngKey con nombre que proporciona el 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

Algoritmo con el que se utilizará la clave.

keyName
String

El nombre de clave. Si no se proporciona un nombre, no se conservará la clave.

Devoluciones

CngKey

Clave conservada o efímera que proporciona el algoritmo especificado.

Atributos

Excepciones

algorithm es null.

Este sistema no es compatible con Cryptography Next Generation (CNG).

Todos los demás errores.

Comentarios

Si keyName se proporciona, esta sobrecarga crea una clave persistente. Si keyName no se proporciona, la clave será efímera. Esta sobrecarga también crea un objeto predeterminado CngKeyCreationParameters que especifica un valor predeterminado CngProvider y otros parámetros avanzados para la clave.

Se aplica a

Create(CngAlgorithm, String, CngKeyCreationParameters)

Crea un objeto CngKey con nombre que proporciona el algoritmo especificado, utilizando los parámetros de creación de claves proporcionados.

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

Algoritmo con el que se utilizará la clave.

keyName
String

El nombre de clave. Si no se proporciona un nombre, no se conservará la clave.

creationParameters
CngKeyCreationParameters

Objeto que especifica los parámetros avanzados para el método, incluido CngProvider.

Devoluciones

CngKey

Clave conservada o efímera que proporciona el algoritmo especificado.

Atributos

Excepciones

algorithm es null.

Este sistema no es compatible con Cryptography Next Generation (CNG).

Todos los demás errores.

Comentarios

Si keyName se proporciona, esta sobrecarga crea una clave persistente. Si keyName no se proporciona, la clave será efímera.

Se aplica a