KeyedHashAlgorithm.Create Metodo

Definizione

Crea un'istanza dell'implementazione di un algoritmo hash con chiave.

Overload

Create()
Obsoleta.
Obsoleta.

Crea un'istanza dell'implementazione predefinita di un algoritmo hash con chiave.

Create(String)

Consente di creare un'istanza dell'implementazione specificata di un algoritmo hash con chiave.

Create()

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 algoritmo hash con chiave.

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

Restituisce

KeyedHashAlgorithm

Nuova istanza di HMACSHA1, a meno che le impostazioni predefinite non siano state modificate.

Attributi

Commenti

Per impostazione predefinita, questo overload usa l'implementazione HMACSHA1 di un algoritmo hash con chiave. Se si vuole specificare un'implementazione diversa, usare l'overload Create(String) , che consente di specificare invece un nome di algoritmo. Il sistema di configurazione della crittografia definisce l'implementazione predefinita della KeyedHashAlgorithm classe .

A causa di problemi di collisione con SHA1, Microsoft consiglia un modello di sicurezza basato su SHA256 o superiore.

Vedi anche

Si applica a

Create(String)

Consente di creare un'istanza dell'implementazione specificata di un algoritmo hash con chiave.

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

Parametri

algName
String

L'implementazione dell'algoritmo hash con chiave da utilizzare. La tabella seguente illustra i valori validi per il parametro algName e gli algoritmi a cui sono mappati.

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

Restituisce

KeyedHashAlgorithm

Nuova istanza dell'algoritmo hash con chiave specificato.

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.

Questo metodo supporta diversi algoritmi, tra cui MD5, SHA-1, SHA-256 e RIPEMD160. Per un elenco completo, vedere i valori supportati per il algName parametro .

Vedi anche

Si applica a