KeyedHashAlgorithm.Create Método

Definição

Cria uma instância de uma implementação de um algoritmo de hash com chave.

Sobrecargas

Name Description
Create()
Obsoleto.
Obsoleto.

Cria uma instância da implementação padrão de um algoritmo de hash com chave.

Create(String)
Obsoleto.

Cria uma instância da implementação especificada de um algoritmo de hash com chave.

Create()

Origem:
KeyedHashAlgorithm.cs
Origem:
KeyedHashAlgorithm.cs
Origem:
KeyedHashAlgorithm.cs
Origem:
KeyedHashAlgorithm.cs
Origem:
KeyedHashAlgorithm.cs

Atenção

The default implementation of this cryptography algorithm is not supported.

Atenção

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

Devoluções

Uma nova HMACSHA1 instância, a menos que as definições padrão tenham sido alteradas.

Atributos

Observações

Por defeito, esta sobrecarga utiliza a HMACSHA1 implementação de um algoritmo de hash com chave. Se quiseres especificar uma implementação diferente, usa a Create(String) sobrecarga, que te permite especificar um nome de algoritmo, em vez disso. O sistema de configuração de criptografia define a implementação padrão da KeyedHashAlgorithm classe.

Devido a problemas de colisão com o SHA-1, a Microsoft recomenda um modelo de segurança baseado no SHA-256 ou superior.

Ver também

Aplica-se a

Create(String)

Origem:
KeyedHashAlgorithm.cs
Origem:
KeyedHashAlgorithm.cs
Origem:
KeyedHashAlgorithm.cs
Origem:
KeyedHashAlgorithm.cs
Origem:
KeyedHashAlgorithm.cs

Atenção

Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.

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);
[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.KeyedHashAlgorithm? Create(string algName);
public static System.Security.Cryptography.KeyedHashAlgorithm? Create(string algName);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]
public static System.Security.Cryptography.KeyedHashAlgorithm? Create(string algName);
public static System.Security.Cryptography.KeyedHashAlgorithm Create(string algName);
[<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.KeyedHashAlgorithm
static member Create : string -> System.Security.Cryptography.KeyedHashAlgorithm
[<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.KeyedHashAlgorithm
Public Shared Function Create (algName As String) As KeyedHashAlgorithm

Parâmetros

algName
String

A implementação do algoritmo de hash com chave a utilizar. A tabela seguinte mostra os valores válidos do algName parâmetro e dos algoritmos a que correspondem.

Valor do parâmetro Implementos
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

Devoluções

Uma nova instância do algoritmo de hash com chave especificado.

Atributos

Exceções

.NET Core 2.0 - 3.1 e .NET 5 e posteriores: Em todos os casos.

Observações

Este método está obsoleto no .NET 5 e versões posteriores.

Este método suporta vários algoritmos, incluindo MD5, SHA-1, SHA-256 e RIPEMD160. Para uma lista completa, consulte os valores suportados para o algName parâmetro.

Ver também

Aplica-se a