HMAC.Create Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Crée une instance d’une implémentation d’un code d’authentification de message basé sur le hachage (HMAC) .
Surcharges
| Nom | Description |
|---|---|
| Create() |
Obsolète.
Obsolète.
Crée une instance de l’implémentation par défaut d’un code d’authentification de message basé sur un hachage (HMAC). |
| Create(String) |
Obsolète.
Crée une instance de l’implémentation spécifiée d’un code d’authentification de message basé sur un hachage (HMAC). |
Create()
- Source:
- HMAC.cs
- Source:
- HMAC.cs
- Source:
- HMAC.cs
- Source:
- HMAC.cs
- Source:
- HMAC.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 code d’authentification de message basé sur un hachage (HMAC).
public:
static System::Security::Cryptography::HMAC ^ 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.HMAC 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.HMAC Create();
public static System.Security.Cryptography.HMAC 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.HMAC
[<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.HMAC
static member Create : unit -> System.Security.Cryptography.HMAC
Public Shared Function Create () As HMAC
Retours
Nouvelle instance SHA-1, sauf si les paramètres par défaut ont été modifiés à l’aide de l’élément< cryptoClass>.
- 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 SHA-1 de HMAC. 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.
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:
- HMAC.cs
- Source:
- HMAC.cs
- Source:
- HMAC.cs
- Source:
- HMAC.cs
- Source:
- HMAC.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 code d’authentification de message basé sur un hachage (HMAC).
public:
static System::Security::Cryptography::HMAC ^ Create(System::String ^ algorithmName);
[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.HMAC? Create(string algorithmName);
public static System.Security.Cryptography.HMAC? Create(string algorithmName);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]
public static System.Security.Cryptography.HMAC? Create(string algorithmName);
public static System.Security.Cryptography.HMAC Create(string algorithmName);
[<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.HMAC
static member Create : string -> System.Security.Cryptography.HMAC
[<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.HMAC
Public Shared Function Create (algorithmName As String) As HMAC
Paramètres
- algorithmName
- String
Implémentation HMAC à utiliser. Le tableau suivant présente les valeurs valides pour le algorithmName paramètre et les algorithmes auxquels ils sont mappés.
| Valeur du paramètre | Implémente |
|---|---|
| System.Security.Cryptography.HMAC | HMACSHA1 |
| System.Security.Cryptography.KeyedHashAlgorithm | HMACSHA1 |
| HMACMD5 | HMACMD5 |
| System.Security.Cryptography.HMACMD5 | HMACMD5 |
| HMACRIPEMD160 | HMACRIPEMD160 |
| System.Security.Cryptography.HMACRIPEMD160 | HMACRIPEMD160 |
| HMACSHA1 | HMACSHA1 |
| System.Security.Cryptography.HMACSHA1 | HMACSHA1 |
| HMACSHA256 | HMACSHA256 |
| System.Security.Cryptography.HMACSHA256 | HMACSHA256 |
| HMACSHA384 | HMACSHA384 |
| System.Security.Cryptography.HMACSHA384 | HMACSHA384 |
| HMACSHA512 | HMACSHA512 |
| System.Security.Cryptography.HMACSHA512 | HMACSHA512 |
| MACTripleDES | MACTripleDES |
| System.Security.Cryptography.MACTripleDES | MACTripleDES |
Retours
Nouvelle instance de l’implémentation HMAC spécifiée.
- Attributs
Remarques
HMAC prend en charge un certain nombre d’algorithmes de hachage, notamment MD5, SHA-1, SHA-256 et RIPEMD160. Pour obtenir la liste complète, consultez les valeurs prises en charge pour le algorithmName paramètre.
En raison de problèmes de collision avec MD5 et SHA-1, Microsoft recommande un modèle de sécurité basé sur SHA-256 ou mieux.