HashAlgorithm.Create Metodo

Definizione

Crea un'istanza dell'implementazione di un algoritmo hash.

Overload

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()

Source:
HashAlgorithm.cs
Source:
HashAlgorithm.cs
Source:
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

Restituisce

Nuova istanza di SHA1CryptoServiceProvider, a meno che le impostazioni predefinite non siano state modificate.

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, che consente di specificare invece un nome dell'algoritmo Create(String) . Il sistema di configurazione della crittografia definisce l'implementazione predefinita di HashAlgorithm.

A causa di problemi di collisione con SHA1, Microsoft consiglia un modello di sicurezza basato su SHA256 o superiore.

Si applica a

Create(String)

Source:
HashAlgorithm.cs
Source:
HashAlgorithm.cs
Source:
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);
public static System.Security.Cryptography.HashAlgorithm? Create (string hashName);
[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);
static member Create : string -> System.Security.Cryptography.HashAlgorithm
[<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
Public Shared Function Create (hashName As String) As HashAlgorithm

Parametri

hashName
String

Implementazione dell'algoritmo hash da usare. La tabella seguente illustra i valori validi per il parametro hashName e gli algoritmi a cui sono mappati.

Valore del parametro implementa
SHASHA1CryptoServiceProvider
SHA1SHA1CryptoServiceProvider
System.Security.Cryptography.SHA1SHA1CryptoServiceProvider
System.Security.Cryptography.HashAlgorithmSHA1CryptoServiceProvider
MD5MD5CryptoServiceProvider
System.Security.Cryptography.MD5MD5CryptoServiceProvider
SHA256SHA256Managed
SHA-256SHA256Managed
System.Security.Cryptography.SHA256SHA256Managed
SHA384SHA384Managed
SHA-384SHA384Managed
System.Security.Cryptography.SHA384SHA384Managed
SHA512SHA512Managed
SHA-512SHA512Managed
System.Security.Cryptography.SHA512SHA512Managed

Restituisce

Una nuova istanza dell'algoritmo hash specificato o null se hashName non è un algoritmo hash valido.

Attributi

Si applica a