HashAlgorithm.Create Méthode

Définition

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

Surcharges

Nom Description
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
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

Une nouvelle SHA1CryptoServiceProvider instance, sauf si les paramètres par défaut ont été modifiés à l’aide du fichier .

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 autre implémentation, utilisez la surcharge, qui vous permet de spécifier un nom d’algorithme, à la Create(String) place. Le système de configuration de chiffrement définit l’implémentation par défaut de HashAlgorithm.

En raison de problèmes de collision avec SHA-1, Microsoft recommande un modèle de sécurité basé sur SHA-256 ou mieux.

S’applique à

Create(String)

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

Paramètres

hashName
String

Implémentation de l’algorithme de hachage à utiliser. Le tableau suivant présente les valeurs valides pour le hashName paramètre et les algorithmes auxquels ils sont mappés.

Valeur du paramètre Implémente
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

Retours

Nouvelle instance de l’algorithme de hachage spécifié ou null s’il hashName n’est pas un algorithme de hachage valide.

Attributs

S’applique à