HMAC.Create Metodo

Definizione

Crea un'istanza di un'implementazione di un codice HMAC HMAC.

Overload

Create()
Obsoleti.
Obsoleti.

Crea un'istanza dell'implementazione predefinita di un codice HMAC.

Create(String)
Obsoleti.

Crea un'istanza dell'implementazione specificata di un codice HMAC (Hash-based Message Authentication Code).

Create()

Source:
HMAC.cs
Source:
HMAC.cs
Source:
HMAC.cs

Attenzione

The default implementation of this cryptography algorithm is not supported

Attenzione

The default implementation of this cryptography algorithm is not supported.

Crea un'istanza dell'implementazione predefinita di un codice 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

Restituisce

Una nuova istanza di SHA-1, a meno che le impostazioni predefinite non siano state modificate usando l'elemento <cryptoClass>.

Attributi

Eccezioni

.NET Core 2.0 - 3.1 e .NET 5 e versioni successive: in tutti i casi.

Commenti

Questo metodo è obsoleto in .NET 5 e versioni successive.

Per impostazione predefinita, questo overload usa l'implementazione SHA-1 di HMAC. Se si vuole specificare un'implementazione diversa, usare l'overload, che consente di specificare invece un nome dell'algoritmo Create(String) .

A causa di problemi di collisione con SHA-1, Microsoft consiglia un modello di sicurezza basato su SHA-256 o superiore.

Si applica a

Create(String)

Source:
HMAC.cs
Source:
HMAC.cs
Source:
HMAC.cs

Attenzione

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

Crea un'istanza dell'implementazione specificata di un codice HMAC (Hash-based Message Authentication Code).

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

Parametri

algorithmName
String

Implementazione HMAC da usare. La tabella seguente illustra i valori validi per il parametro algorithmName e gli algoritmi a cui sono mappati.

Valore del parametro implementa
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

Restituisce

Nuova istanza dell'implementazione HMAC specificata.

Attributi

Commenti

HMAC supporta numerosi algoritmi hash, tra cui MD5, SHA-1, SHA-256 e RIPEMD160. Per l'elenco completo, vedere i valori supportati per il algorithmName parametro.

A causa di problemi di collisione con MD5 e SHA-1, Microsoft consiglia un modello di sicurezza basato su SHA-256 o meglio.

Si applica a