HMAC.Create Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Crea una instancia de una implementación de un código de autenticación de mensajes basado en hash (HMAC).
Sobrecargas
| Nombre | Description |
|---|---|
| Create() |
Obsoletos.
Obsoletos.
Crea una instancia de la implementación predeterminada de un código de autenticación de mensajes basado en hash (HMAC). |
| Create(String) |
Obsoletos.
Crea una instancia de la implementación especificada de un código de autenticación de mensajes basado en hash (HMAC). |
Create()
- Source:
- HMAC.cs
- Source:
- HMAC.cs
- Source:
- HMAC.cs
- Source:
- HMAC.cs
- Source:
- HMAC.cs
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 código de autenticación de mensajes basado en hash (HMAC).
public:
static System::Security::Cryptography::HMAC ^ 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.HMAC 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.HMAC Create();
public static System.Security.Cryptography.HMAC 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.HMAC
[<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.HMAC
static member Create : unit -> System.Security.Cryptography.HMAC
Public Shared Function Create () As HMAC
Devoluciones
Nueva instancia de SHA-1, a menos que se haya cambiado la configuración predeterminada mediante el <elemento cryptoClass>.
- Atributos
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.
De forma predeterminada, esta sobrecarga usa la implementación SHA-1 de HMAC. Si desea especificar una implementación diferente, use la Create(String) sobrecarga , que le permite especificar un nombre de algoritmo, en su lugar.
Debido a problemas de colisión con SHA-1, Microsoft recomienda un modelo de seguridad basado en SHA-256 o superior.
Se aplica a
Create(String)
- Source:
- HMAC.cs
- Source:
- HMAC.cs
- Source:
- HMAC.cs
- Source:
- HMAC.cs
- Source:
- HMAC.cs
Precaución
Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.
Crea una instancia de la implementación especificada de un código de autenticación de mensajes basado en hash (HMAC).
public:
static System::Security::Cryptography::HMAC ^ Create(System::String ^ algorithmName);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]
[System.Obsolete("Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.", DiagnosticId="SYSLIB0045", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Security.Cryptography.HMAC? Create(string algorithmName);
public static System.Security.Cryptography.HMAC? Create(string algorithmName);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]
public static System.Security.Cryptography.HMAC? Create(string algorithmName);
public static System.Security.Cryptography.HMAC Create(string algorithmName);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")>]
[<System.Obsolete("Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.", DiagnosticId="SYSLIB0045", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member Create : string -> System.Security.Cryptography.HMAC
static member Create : string -> System.Security.Cryptography.HMAC
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")>]
static member Create : string -> System.Security.Cryptography.HMAC
Public Shared Function Create (algorithmName As String) As HMAC
Parámetros
- algorithmName
- String
Implementación de HMAC que se va a usar. En la tabla siguiente se muestran los valores válidos para el algorithmName parámetro y los algoritmos a los que se asignan.
| Valor del 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
Nueva instancia de la implementación de HMAC especificada.
- Atributos
Comentarios
HMAC admite varios algoritmos hash, incluidos MD5, SHA-1, SHA-256 y RIPEMD160. Para obtener la lista completa, consulte los valores admitidos para el algorithmName parámetro .
Debido a problemas de colisión con MD5 y SHA-1, Microsoft recomienda un modelo de seguridad basado en SHA-256 o superior.