Share via


KeyedHashAlgorithm.Create Metodo

Definizione

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

Overload

Create()
Obsoleti.
Obsoleti.

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

Create(String)
Obsoleti.

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

Create()

Origine:
KeyedHashAlgorithm.cs
Origine:
KeyedHashAlgorithm.cs
Origine:
KeyedHashAlgorithm.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 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

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, che consente di specificare invece un nome dell'algoritmo Create(String) . 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)

Origine:
KeyedHashAlgorithm.cs
Origine:
KeyedHashAlgorithm.cs
Origine:
KeyedHashAlgorithm.cs

Attenzione

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

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);
[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

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

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.

Questo metodo supporta numerosi 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