HashAlgorithm.Create Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Crea un'istanza di un'implementazione di un algoritmo hash.
Overload
| Nome | Descrizione |
|---|---|
| Create() |
Obsoleti.
Obsoleti.
Crea un'istanza dell'implementazione predefinita di un algoritmo hash. |
| Create(String) |
Obsoleti.
Crea un'istanza dell'implementazione specificata di un algoritmo hash. |
Create()
- Origine:
- HashAlgorithm.cs
- Origine:
- HashAlgorithm.cs
- Origine:
- HashAlgorithm.cs
- Origine:
- HashAlgorithm.cs
- Origine:
- HashAlgorithm.cs
Attenzione
The default implementation of this cryptography algorithm is not supported.
Attenzione
The default implementation of this cryptography algorithm is not supported
Crea un'istanza dell'implementazione predefinita di un algoritmo 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
Valori restituiti
SHA1CryptoServiceProvider Nuova istanza, a meno che le impostazioni predefinite non siano state modificate usando .
- Attributi
Eccezioni
.NET Core 2.0 - 3.1 e .NET 5 e versioni successive: in tutti i casi.
Commenti
Questo metodo è obsoleto in .NET 5 e versioni successive.
Per impostazione predefinita, questo overload usa l'implementazione SHA1CryptoServiceProvider di un algoritmo hash. Se si vuole specificare un'implementazione diversa, usare l'overload Create(String) , che consente di specificare invece un nome di algoritmo. Il sistema di configurazione della crittografia definisce l'implementazione predefinita di HashAlgorithm.
A causa di problemi di collisione con SHA-1, Microsoft consiglia un modello di sicurezza basato su SHA-256 o superiore.
Si applica a
Create(String)
- Origine:
- HashAlgorithm.cs
- Origine:
- HashAlgorithm.cs
- Origine:
- HashAlgorithm.cs
- Origine:
- HashAlgorithm.cs
- Origine:
- HashAlgorithm.cs
Attenzione
Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.
Crea un'istanza dell'implementazione specificata di un algoritmo 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
Parametri
- hashName
- String
Implementazione dell'algoritmo hash da usare. La tabella seguente mostra i valori validi per il hashName parametro e gli algoritmi a cui eseguono il mapping.
| Valore del parametro | Implementa |
|---|---|
| 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 |
Valori restituiti
Nuova istanza dell'algoritmo hash specificato o null se hashName non è un algoritmo hash valido.
- Attributi