KeyedHashAlgorithm.Create Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Vytvoří instanci implementace klíče hash algoritmu.
Přetížení
| Name | Description |
|---|---|
| Create() |
Zastaralé.
Zastaralé.
Vytvoří instanci výchozí implementace klíče hash algoritmu. |
| Create(String) |
Zastaralé.
Vytvoří instanci zadané implementace klíče hash algoritmu. |
Create()
- Zdroj:
- KeyedHashAlgorithm.cs
- Zdroj:
- KeyedHashAlgorithm.cs
- Zdroj:
- KeyedHashAlgorithm.cs
- Zdroj:
- KeyedHashAlgorithm.cs
- Zdroj:
- KeyedHashAlgorithm.cs
Upozornění
The default implementation of this cryptography algorithm is not supported.
Upozornění
The default implementation of this cryptography algorithm is not supported
Vytvoří instanci výchozí implementace klíče hash algoritmu.
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
Návraty
Nová HMACSHA1 instance, pokud nebyla změněna výchozí nastavení.
- Atributy
Poznámky
Ve výchozím nastavení toto přetížení používá HMACSHA1 implementaci klíčového hash algoritmu. Pokud chcete zadat jinou implementaci, použijte Create(String) přetížení, které vám umožní místo toho zadat název algoritmu. Konfigurační systém kryptografie definuje výchozí implementaci KeyedHashAlgorithm třídy.
Vzhledem k problémům s kolizemi u SHA-1 Microsoft doporučuje model zabezpečení založený na algoritmu SHA-256 nebo lepším.
Viz také
Platí pro
Create(String)
- Zdroj:
- KeyedHashAlgorithm.cs
- Zdroj:
- KeyedHashAlgorithm.cs
- Zdroj:
- KeyedHashAlgorithm.cs
- Zdroj:
- KeyedHashAlgorithm.cs
- Zdroj:
- KeyedHashAlgorithm.cs
Upozornění
Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.
Vytvoří instanci zadané implementace klíče hash algoritmu.
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
Parametry
- algName
- String
Implementace algoritmu hash s klíči, který se má použít. Následující tabulka ukazuje platné hodnoty pro algName parametr a algoritmy, na které se mapují.
| Hodnota parametru | Implementuje |
|---|---|
| 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 |
Návraty
Nová instance zadaného algoritmu hash s klíči.
- Atributy
Výjimky
.NET Core 2.0 – 3.1 a .NET 5 a novější: Ve všech případech.
Poznámky
Tato metoda je zastaralá v .NET 5 a novějších verzích.
Tato metoda podporuje řadu algoritmů, včetně MD5, SHA-1, SHA-256 a RIPEMD160. Úplný seznam najdete v podporovaných hodnotách parametru algName .