Bagikan melalui


KeyedHashAlgorithm.Create Metode

Definisi

Membuat instans implementasi algoritma hash yang dikunci.

Overload

Create()
Kedaluwarsa.
Kedaluwarsa.

Membuat instans implementasi default algoritma hash yang dikunci.

Create(String)
Kedaluwarsa.

Membuat instans implementasi algoritma hash yang ditentukan.

Create()

Sumber:
KeyedHashAlgorithm.cs
Sumber:
KeyedHashAlgorithm.cs
Sumber:
KeyedHashAlgorithm.cs

Perhatian

The default implementation of this cryptography algorithm is not supported

Perhatian

The default implementation of this cryptography algorithm is not supported.

Membuat instans implementasi default algoritma hash yang dikunci.

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

Mengembalikan

Instans baru HMACSHA1 , kecuali pengaturan default telah diubah.

Atribut

Keterangan

Secara default, kelebihan beban ini menggunakan HMACSHA1 implementasi algoritma hash bertanda kunci. Jika Anda ingin menentukan implementasi yang berbeda, gunakan Create(String) kelebihan beban, yang memungkinkan Anda menentukan nama algoritma sebagai gantinya. Sistem konfigurasi kriptografi mendefinisikan implementasi KeyedHashAlgorithm default kelas.

Karena masalah tabrakan dengan SHA1, Microsoft merekomendasikan model keamanan berdasarkan SHA256 atau lebih baik.

Lihat juga

Berlaku untuk

Create(String)

Sumber:
KeyedHashAlgorithm.cs
Sumber:
KeyedHashAlgorithm.cs
Sumber:
KeyedHashAlgorithm.cs

Perhatian

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

Membuat instans implementasi algoritma hash yang ditentukan.

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

Parameter

algName
String

Implementasi algoritma hash yang dikunci untuk digunakan. Tabel berikut ini memperlihatkan nilai yang valid untuk algName parameter dan algoritma yang dipetakan.

Nilai parameter Penerapan
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

Mengembalikan

Instans baru dari algoritma hash kunci yang ditentukan.

Atribut

Pengecualian

.NET Core 2.0 - 3.1 dan .NET 5 dan yang lebih baru: Dalam semua kasus.

Keterangan

Metode ini usang dalam .NET 5 dan versi yang lebih baru.

Metode ini mendukung sejumlah algoritma, termasuk MD5, SHA-1, SHA-256, dan RIPEMD160. Untuk daftar lengkapnya, lihat nilai yang didukung untuk algName parameter .

Lihat juga

Berlaku untuk