KeyedHashAlgorithm.Create Método

Definición

Crea una instancia de una implementación de un algoritmo hash con clave.

Sobrecargas

Create()
Obsoleto.
Obsoleto.

Crea una instancia de la implementación predeterminada de un algoritmo hash en clave.

Create(String)

Crea una instancia de la implementación especificada de un algoritmo hash en clave.

Create()

Precaución

The default implementation of this cryptography algorithm is not supported

Precaución

The default implementation of this cryptography algorithm is not supported.

Crea una instancia de la implementación predeterminada de un algoritmo hash en clave.

public:
 static System::Security::Cryptography::KeyedHashAlgorithm ^ Create();
[System.Obsolete("The default implementation of this cryptography algorithm is not supported", DiagnosticId="SYSLIB0007", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Security.Cryptography.KeyedHashAlgorithm Create ();
[System.Obsolete("The default implementation of this cryptography algorithm is not supported.", DiagnosticId="SYSLIB0007", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Security.Cryptography.KeyedHashAlgorithm Create ();
public static System.Security.Cryptography.KeyedHashAlgorithm Create ();
[<System.Obsolete("The default implementation of this cryptography algorithm is not supported", DiagnosticId="SYSLIB0007", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member Create : unit -> System.Security.Cryptography.KeyedHashAlgorithm
[<System.Obsolete("The default implementation of this cryptography algorithm is not supported.", DiagnosticId="SYSLIB0007", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member Create : unit -> System.Security.Cryptography.KeyedHashAlgorithm
static member Create : unit -> System.Security.Cryptography.KeyedHashAlgorithm
Public Shared Function Create () As KeyedHashAlgorithm

Devoluciones

KeyedHashAlgorithm

Una nueva instancia de HMACSHA1, a menos que se haya cambiado la configuración predeterminada.

Atributos

Comentarios

De forma predeterminada, esta sobrecarga usa la HMACSHA1 implementación de un algoritmo hash con clave. Si desea especificar una implementación diferente, use la Create(String) sobrecarga , que le permite especificar un nombre de algoritmo, en su lugar. El sistema de configuración de criptografía define la implementación predeterminada de la KeyedHashAlgorithm clase .

Debido a problemas de colisión con SHA1, Microsoft recomienda un modelo de seguridad basado en SHA256 o mejor.

Consulte también

Se aplica a

Create(String)

Crea una instancia de la implementación especificada de un algoritmo hash en clave.

public:
 static System::Security::Cryptography::KeyedHashAlgorithm ^ Create(System::String ^ algName);
public static System.Security.Cryptography.KeyedHashAlgorithm? Create (string algName);
public static System.Security.Cryptography.KeyedHashAlgorithm Create (string algName);
static member Create : string -> System.Security.Cryptography.KeyedHashAlgorithm
Public Shared Function Create (algName As String) As KeyedHashAlgorithm

Parámetros

algName
String

Nombre de la implementación del algoritmo hash con clave que se va a utilizar. En la tabla siguiente se muestran los valores válidos para el parámetro algName y los algoritmos a los que se asignan.

Valor de parámetro Implementaciones
System.Security.Cryptography.HMAC HMACSHA1
System.Security.Cryptography.KeyedHashAlgorithm HMACSHA1
HMACMD5 HMACMD5
System.Security.Cryptography.HMACMD5 HMACMD5
HMACRIPEMD160 HMACRIPEMD160
System.Security.Cryptography.HMACRIPEMD160 HMACRIPEMD160
HMACSHA1 HMACSHA1
System.Security.Cryptography.HMACSHA1 HMACSHA1
HMACSHA256 HMACSHA256
System.Security.Cryptography.HMACSHA256 HMACSHA256
HMACSHA384 HMACSHA384
System.Security.Cryptography.HMACSHA384 HMACSHA384
HMACSHA512 HMACSHA512
System.Security.Cryptography.HMACSHA512 HMACSHA512
MACTripleDES MACTripleDES
System.Security.Cryptography.MACTripleDES MACTripleDES

Devoluciones

KeyedHashAlgorithm

Nueva instancia del algoritmo hash con clave especificado.

Excepciones

.NET Core 2.0 - 3.1 y .NET 5 y versiones posteriores: en todos los casos.

Comentarios

Este método está obsoleto en .NET 5 y versiones posteriores.

Este método admite varios algoritmos, incluidos MD5, SHA-1, SHA-256 y RIPEMD160. Para obtener una lista completa, consulte los valores admitidos para el algName parámetro .

Consulte también

Se aplica a