KeyedHashAlgorithm.Create Metodo

Definizione

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

Overload

Nome Descrizione
Create()
Obsoleti.
Obsoleti.

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

Create(String)
Obsoleti.

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

Create()

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

Valori restituiti

HMACSHA1 Nuova istanza, 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 SHA-1, Microsoft consiglia un modello di sicurezza basato su SHA-256 o superiore.

Vedi anche

Si applica a

Create(String)

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

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

public:
 static System::Security::Cryptography::KeyedHashAlgorithm ^ Create(System::String ^ algName);
[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.KeyedHashAlgorithm? Create(string algName);
public static System.Security.Cryptography.KeyedHashAlgorithm? Create(string algName);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]
public static System.Security.Cryptography.KeyedHashAlgorithm? Create(string algName);
public static System.Security.Cryptography.KeyedHashAlgorithm Create(string algName);
[<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.KeyedHashAlgorithm
static member Create : string -> System.Security.Cryptography.KeyedHashAlgorithm
[<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.KeyedHashAlgorithm
Public Shared Function Create (algName As String) As KeyedHashAlgorithm

Parametri

algName
String

Implementazione dell'algoritmo hash con chiave da usare. La tabella seguente mostra i valori validi per il algName parametro e gli algoritmi a cui eseguono il mapping.

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

Valori restituiti

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