HashAlgorithm.Create Méthode

Définition

Crée une instance d'une implémentation d'un algorithme de hachage.

Surcharges

Create()
Obsolète.
Obsolète.

Crée une instance de l'implémentation par défaut d'un algorithme de hachage.

Create(String)
Obsolète.

Crée une instance de l'implémentation spécifiée d'un algorithme de hachage.

Create()

Source:
HashAlgorithm.cs
Source:
HashAlgorithm.cs
Source:
HashAlgorithm.cs

Attention

The default implementation of this cryptography algorithm is not supported

Attention

The default implementation of this cryptography algorithm is not supported.

Crée une instance de l'implémentation par défaut d'un algorithme de hachage.

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

Retours

Nouvelle instance de SHA1CryptoServiceProvider, à moins que les paramètres par défaut n’aient été modifiés à l’aide de l’élément .

Attributs

Exceptions

.NET Core 2.0 - 3.1 et .NET 5 et versions ultérieures : dans tous les cas.

Remarques

Cette méthode est obsolète dans .NET 5 et versions ultérieures.

Par défaut, cette surcharge utilise l’implémentation SHA1CryptoServiceProvider d’un algorithme de hachage. Si vous souhaitez spécifier une implémentation différente, utilisez plutôt la Create(String) surcharge, qui vous permet de spécifier un nom d’algorithme. Le système de configuration du chiffrement définit l’implémentation par défaut de HashAlgorithm.

En raison de problèmes de collision avec SHA1, Microsoft recommande un modèle de sécurité basé sur SHA256 ou supérieur.

S’applique à

Create(String)

Source:
HashAlgorithm.cs
Source:
HashAlgorithm.cs
Source:
HashAlgorithm.cs

Attention

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

Crée une instance de l'implémentation spécifiée d'un algorithme de hachage.

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

Paramètres

hashName
String

Implémentation de l'algorithme de hachage à utiliser. Le tableau suivant indique les valeurs valides du paramètre hashName et les algorithmes auxquels elles sont mappées.

Valeur de paramètre Implémentations
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

Retours

Nouvelle instance de l'algorithme de hachage spécifié ou null si hashName n'est pas un algorithme de hachage valide.

Attributs

S’applique à