HMAC.Create Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Crea un'istanza di un'implementazione di un codice di autenticazione messaggi basato su hash (HMAC).
Overload
| Nome | Descrizione |
|---|---|
| Create() |
Obsoleti.
Obsoleti.
Crea un'istanza dell'implementazione predefinita di un codice HMAC (Hash-based Message Authentication Code). |
| Create(String) |
Obsoleti.
Crea un'istanza dell'implementazione specificata di un codice HMAC (Hash-based Message Authentication Code). |
Create()
- Origine:
- HMAC.cs
- Origine:
- HMAC.cs
- Origine:
- HMAC.cs
- Origine:
- HMAC.cs
- Origine:
- 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 (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
Valori restituiti
Nuova istanza 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 Create(String) , che consente di specificare invece un nome di algoritmo.
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)
- Origine:
- HMAC.cs
- Origine:
- HMAC.cs
- Origine:
- HMAC.cs
- Origine:
- HMAC.cs
- Origine:
- 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);
[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
Parametri
- algorithmName
- String
Implementazione HMAC da usare. La tabella seguente mostra i valori validi per il algorithmName 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'implementazione HMAC specificata.
- Attributi
Commenti
HMAC supporta diversi 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 superiore.