HashAlgorithm.Create Methode

Definitie

Hiermee maakt u een exemplaar van een implementatie van een hash-algoritme.

Overloads

Name Description
Create()
Verouderd.
Verouderd.

Hiermee maakt u een exemplaar van de standaard implementatie van een hash-algoritme.

Create(String)
Verouderd.

Hiermee maakt u een exemplaar van de opgegeven implementatie van een hash-algoritme.

Create()

Bron:
HashAlgorithm.cs
Bron:
HashAlgorithm.cs
Bron:
HashAlgorithm.cs
Bron:
HashAlgorithm.cs
Bron:
HashAlgorithm.cs

Let op

The default implementation of this cryptography algorithm is not supported.

Let op

The default implementation of this cryptography algorithm is not supported

Hiermee maakt u een exemplaar van de standaard implementatie van een hash-algoritme.

public:
 static System::Security::Cryptography::HashAlgorithm ^ 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.HashAlgorithm 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.HashAlgorithm Create();
public static System.Security.Cryptography.HashAlgorithm 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.HashAlgorithm
[<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.HashAlgorithm
static member Create : unit -> System.Security.Cryptography.HashAlgorithm
Public Shared Function Create () As HashAlgorithm

Retouren

Een nieuw SHA1CryptoServiceProvider exemplaar, tenzij de standaardinstellingen zijn gewijzigd met behulp van de .

Kenmerken

Uitzonderingen

.NET Core 2.0 - 3.1 en .NET 5 en hoger: In alle gevallen.

Opmerkingen

Deze methode is verouderd in .NET 5 en latere versies.

Deze overbelasting maakt standaard gebruik van de SHA1CryptoServiceProvider implementatie van een hash-algoritme. Als u een andere implementatie wilt opgeven, gebruikt u de Create(String) overbelasting, waarmee u in plaats daarvan een algoritmenaam kunt opgeven. Het cryptografieconfiguratiesysteem definieert de standaard implementatie van HashAlgorithm.

Vanwege conflictproblemen met SHA-1 raadt Microsoft een beveiligingsmodel aan op basis van SHA-256 of beter.

Van toepassing op

Create(String)

Bron:
HashAlgorithm.cs
Bron:
HashAlgorithm.cs
Bron:
HashAlgorithm.cs
Bron:
HashAlgorithm.cs
Bron:
HashAlgorithm.cs

Let op

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

Hiermee maakt u een exemplaar van de opgegeven implementatie van een hash-algoritme.

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

Parameters

hashName
String

De implementatie van het hash-algoritme dat moet worden gebruikt. In de volgende tabel ziet u de geldige waarden voor de hashName parameter en de algoritmen waaraan ze zijn toegewezen.

Parameterwaarde Implementeert
SHA SHA1CryptoServiceProvider
SHA1 SHA1CryptoServiceProvider
System.Security.Cryptography.SHA1 SHA1CryptoServiceProvider
System.Security.Cryptography.HashAlgorithm SHA1CryptoServiceProvider
MD5 MD5CryptoServiceProvider
System.Security.Cryptography.MD5 MD5CryptoServiceProvider
SHA256 SHA256Managed
SHA-256 SHA256Managed
System.Security.Cryptography.SHA256 SHA256Managed
SHA384 SHA384Managed
SHA-384 SHA384Managed
System.Security.Cryptography.SHA384 SHA384Managed
SHA512 SHA512Managed
SHA-512 SHA512Managed
System.Security.Cryptography.SHA512 SHA512Managed

Retouren

Een nieuw exemplaar van het opgegeven hash-algoritme of null als hashName dit geen geldig hash-algoritme is.

Kenmerken

Van toepassing op