KeyedHashAlgorithm.Create Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Cria uma instância de uma implementação especificada de um algoritmo de hash com chave.
Sobrecargas
Create() |
Obsoleto.
Obsoleto.
Cria uma instância da implementação padrão de um algoritmo de hash com chave. |
Create(String) |
Cria uma instância da implementação especificada de um algoritmo de hash com chave. |
Create()
Cuidado
The default implementation of this cryptography algorithm is not supported
Cuidado
The default implementation of this cryptography algorithm is not supported.
Cria uma instância da implementação padrão de um algoritmo de hash com chave.
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
Retornos
Uma nova instância de HMACSHA1, a menos que as configurações padrão tenham sido alteradas.
- Atributos
Comentários
Por padrão, essa sobrecarga usa a HMACSHA1 implementação de um algoritmo de hash chaveado. Se você quiser especificar uma implementação diferente, use a Create(String) sobrecarga, que permite especificar um nome de algoritmo. O sistema de configuração de criptografia define a implementação padrão da KeyedHashAlgorithm classe.
Devido a problemas de colisão com o SHA1, a Microsoft recomenda um modelo de segurança baseado em SHA256 ou melhor.
Confira também
Aplica-se a
Create(String)
Cria uma instância da implementação especificada de um algoritmo de hash com chave.
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
A implementação do algoritmo de hash com chave a ser usada. A tabela a seguir mostra os valores válidos para o parâmetro algName
e os algoritmos para os quais são mapeados.
Valor do parâmetro | Implements |
---|---|
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 |
Retornos
Uma nova instância do algoritmo de hash com chave especificado.
Exceções
.NET Core 2.0 – 3.1 e .NET 5 e posterior: em todos os casos.
Comentários
Esse método é obsoleto no .NET 5 e em versões posteriores.
Esse método dá suporte a vários algoritmos, incluindo MD5, SHA-1, SHA-256 e RIPEMD160. Para obter uma lista completa, consulte os valores com suporte para o algName
parâmetro.