Share via


KeyedHashAlgorithm.Create Méthode

Définition

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

Surcharges

Create()
Obsolète.
Obsolète.

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

Create(String)
Obsolète.

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

Create()

Source:
KeyedHashAlgorithm.cs
Source:
KeyedHashAlgorithm.cs
Source:
KeyedHashAlgorithm.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 à clé.

public:
 static System::Security::Cryptography::KeyedHashAlgorithm ^ 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.KeyedHashAlgorithm 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.KeyedHashAlgorithm Create ();
public static System.Security.Cryptography.KeyedHashAlgorithm 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.KeyedHashAlgorithm
[<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.KeyedHashAlgorithm
static member Create : unit -> System.Security.Cryptography.KeyedHashAlgorithm
Public Shared Function Create () As KeyedHashAlgorithm

Retours

Nouvelle instance de HMACSHA1, à moins que les paramètres par défaut aient été modifiés.

Attributs

Remarques

Par défaut, cette surcharge utilise l’implémentation HMACSHA1 d’un algorithme de hachage à clé. Si vous souhaitez spécifier une autre implémentation, utilisez plutôt la Create(String) surcharge, ce qui vous permet de spécifier un nom d’algorithme. Le système de configuration de chiffrement définit l’implémentation par défaut de la KeyedHashAlgorithm classe .

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

Voir aussi

S’applique à

Create(String)

Source:
KeyedHashAlgorithm.cs
Source:
KeyedHashAlgorithm.cs
Source:
KeyedHashAlgorithm.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 à clé.

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

Paramètres

algName
String

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

Valeur de paramètre Implémentations
System.Security.Cryptography.HMACHMACSHA1
System.Security.Cryptography.KeyedHashAlgorithmHMACSHA1
HMACMD5HMACMD5
System.Security.Cryptography.HMACMD5HMACMD5
HMACRIPEMD160HMACRIPEMD160
System.Security.Cryptography.HMACRIPEMD160HMACRIPEMD160
HMACSHA1HMACSHA1
System.Security.Cryptography.HMACSHA1HMACSHA1
HMACSHA256HMACSHA256
System.Security.Cryptography.HMACSHA256HMACSHA256
HMACSHA384HMACSHA384
System.Security.Cryptography.HMACSHA384HMACSHA384
HMACSHA512HMACSHA512
System.Security.Cryptography.HMACSHA512HMACSHA512
MACTripleDESMACTripleDES
System.Security.Cryptography.MACTripleDESMACTripleDES

Retours

Nouvelle instance de l'algorithme de hachage à clé spécifié.

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.

Cette méthode prend en charge un certain nombre d’algorithmes, notamment MD5, SHA-1, SHA-256 et RIPEMD160. Pour obtenir la liste complète, consultez les valeurs prises en charge pour le algName paramètre.

Voir aussi

S’applique à