HMAC.Create Methode

Definitie

Hiermee maakt u een exemplaar van een implementatie van een op hash gebaseerde berichtverificatiecode (HMAC).

Overloads

Name Description
Create()
Verouderd.
Verouderd.

Hiermee maakt u een exemplaar van de standaard implementatie van een HMAC (Hash-based Message Authentication Code).

Create(String)
Verouderd.

Hiermee maakt u een exemplaar van de opgegeven implementatie van een HMAC (Hash-based Message Authentication Code).

Create()

Bron:
HMAC.cs
Bron:
HMAC.cs
Bron:
HMAC.cs
Bron:
HMAC.cs
Bron:
HMAC.cs

Let op

The default implementation of this cryptography algorithm is not supported.

Let op

The default implementation of this cryptography algorithm is not supported

Hiermee maakt u een exemplaar van de standaard implementatie van een HMAC (Hash-based Message Authentication Code).

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

Retouren

Een nieuw SHA-1-exemplaar, tenzij de standaardinstellingen zijn gewijzigd met behulp van het <cryptoClass-element>.

Kenmerken

Uitzonderingen

.NET Core 2.0 - 3.1 en .NET 5 en hoger: In alle gevallen.

Opmerkingen

Deze methode is verouderd in .NET 5 en latere versies.

Deze overbelasting maakt standaard gebruik van de SHA-1-implementatie van HMAC. Als u een andere implementatie wilt opgeven, gebruikt u de Create(String) overbelasting, waarmee u in plaats daarvan een algoritmenaam kunt opgeven.

Vanwege conflictproblemen met SHA-1 raadt Microsoft een beveiligingsmodel aan op basis van SHA-256 of beter.

Van toepassing op

Create(String)

Bron:
HMAC.cs
Bron:
HMAC.cs
Bron:
HMAC.cs
Bron:
HMAC.cs
Bron:
HMAC.cs

Let op

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

Hiermee maakt u een exemplaar van de opgegeven implementatie van een HMAC (Hash-based Message Authentication Code).

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

Parameters

algorithmName
String

De HMAC-implementatie die moet worden gebruikt. In de volgende tabel ziet u de geldige waarden voor de algorithmName parameter en de algoritmen waaraan ze zijn toegewezen.

Parameterwaarde Implementeert
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

Retouren

Een nieuw exemplaar van de opgegeven HMAC-implementatie.

Kenmerken

Opmerkingen

HMAC ondersteunt een aantal hash-algoritmen, waaronder MD5, SHA-1, SHA-256 en RIPEMD160. Zie de ondersteunde waarden voor de parameter voor de algorithmName volledige lijst.

Vanwege conflicten met MD5 en SHA-1 raadt Microsoft een beveiligingsmodel aan op basis van SHA-256 of beter.

Van toepassing op