HashAlgorithm.Create Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Cria uma instância de uma implementação de um algoritmo de hash.
Sobrecargas
| Name | Description |
|---|---|
| Create() |
Obsoleto.
Obsoleto.
Cria uma instância da implementação padrão de um algoritmo de hash. |
| Create(String) |
Obsoleto.
Cria uma instância da implementação especificada de um algoritmo de hash. |
Create()
- Origem:
- HashAlgorithm.cs
- Origem:
- HashAlgorithm.cs
- Origem:
- HashAlgorithm.cs
- Origem:
- HashAlgorithm.cs
- Origem:
- HashAlgorithm.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.
public:
static System::Security::Cryptography::HashAlgorithm ^ 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.HashAlgorithm 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.HashAlgorithm Create();
public static System.Security.Cryptography.HashAlgorithm 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.HashAlgorithm
[<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.HashAlgorithm
static member Create : unit -> System.Security.Cryptography.HashAlgorithm
Public Shared Function Create () As HashAlgorithm
Devoluções
Uma nova SHA1CryptoServiceProvider instância, a menos que as definições padrão tenham sido alteradas usando o .
- 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.
Por defeito, esta sobrecarga utiliza a SHA1CryptoServiceProvider implementação de um algoritmo de hash. 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 de HashAlgorithm.
Devido a problemas de colisão com o SHA-1, a Microsoft recomenda um modelo de segurança baseado no SHA-256 ou superior.
Aplica-se a
Create(String)
- Origem:
- HashAlgorithm.cs
- Origem:
- HashAlgorithm.cs
- Origem:
- HashAlgorithm.cs
- Origem:
- HashAlgorithm.cs
- Origem:
- HashAlgorithm.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.
public:
static System::Security::Cryptography::HashAlgorithm ^ Create(System::String ^ hashName);
[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.HashAlgorithm? Create(string hashName);
public static System.Security.Cryptography.HashAlgorithm? Create(string hashName);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]
public static System.Security.Cryptography.HashAlgorithm? Create(string hashName);
public static System.Security.Cryptography.HashAlgorithm Create(string hashName);
[<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.HashAlgorithm
static member Create : string -> System.Security.Cryptography.HashAlgorithm
[<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.HashAlgorithm
Public Shared Function Create (hashName As String) As HashAlgorithm
Parâmetros
- hashName
- String
A implementação do algoritmo de hash a utilizar. A tabela seguinte mostra os valores válidos do hashName parâmetro e dos algoritmos a que correspondem.
| Valor do parâmetro | Implementos |
|---|---|
| SHA | SHA1CryptoServiceProvider |
| SHA1 | SHA1CryptoServiceProvider |
| System.Security.Cryptography.SHA1 | SHA1CryptoServiceProvider |
| System.Security.Cryptography.HashAlgorithm | SHA1CryptoServiceProvider |
| MD5 | MD5CryptoServiceProvider |
| System.Security.Cryptography.MD5 | MD5CryptoServiceProvider |
| SHA256 | SHA256Managed |
| SHA-256 | SHA256Managed |
| System.Security.Cryptography.SHA256 | SHA256Managed |
| SHA384 | SHA384Managed |
| SHA-384 | SHA384Managed |
| System.Security.Cryptography.SHA384 | SHA384Managed |
| SHA512 | SHA512Managed |
| SHA-512 | SHA512Managed |
| System.Security.Cryptography.SHA512 | SHA512Managed |
Devoluções
Uma nova instância do algoritmo de hash especificado, ou null se hashName não for um algoritmo de hash válido.
- Atributos