HashAlgorithm.Create Metódus

Definíció

Létrehoz egy kivonatoló algoritmus implementációjának egy példányát.

Túlterhelések

Name Description
Create()
Elavult.
Elavult.

Létrehoz egy kivonatoló algoritmus alapértelmezett implementációjának egy példányát.

Create(String)
Elavult.

Létrehoz egy kivonatoló algoritmus megadott implementációjának egy példányát.

Create()

Forrás:
HashAlgorithm.cs
Forrás:
HashAlgorithm.cs
Forrás:
HashAlgorithm.cs
Forrás:
HashAlgorithm.cs
Forrás:
HashAlgorithm.cs

Figyelemfelhívás

The default implementation of this cryptography algorithm is not supported.

Figyelemfelhívás

The default implementation of this cryptography algorithm is not supported

Létrehoz egy kivonatoló algoritmus alapértelmezett implementációjának egy példányát.

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

Válaszok

Új SHA1CryptoServiceProvider példány, kivéve, ha az alapértelmezett beállításokat a .

Attribútumok

Kivételek

.NET Core 2.0 – 3.1 és .NET 5-ös és újabb verziók: Minden esetben.

Megjegyzések

Ez a módszer elavult .NET 5-ös és újabb verziókban.

Alapértelmezés szerint ez a SHA1CryptoServiceProvider túlterhelés egy kivonatoló algoritmus implementálását használja. Ha másik implementációt szeretne megadni, használja a Create(String) túlterhelést, amely lehetővé teszi egy algoritmus nevének megadását. A titkosítási konfigurációs rendszer határozza meg a HashAlgorithm.

Az SHA-1 ütközési problémái miatt a Microsoft az SHA-256-ra vagy annál jobbra épülő biztonsági modellt javasol.

A következőre érvényes:

Create(String)

Forrás:
HashAlgorithm.cs
Forrás:
HashAlgorithm.cs
Forrás:
HashAlgorithm.cs
Forrás:
HashAlgorithm.cs
Forrás:
HashAlgorithm.cs

Figyelemfelhívás

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

Létrehoz egy kivonatoló algoritmus megadott implementációjának egy példányát.

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

Paraméterek

hashName
String

A használni kívánt kivonatoló algoritmus implementálása. Az alábbi táblázat a paraméter érvényes értékeit hashName és az általuk leképezésre használt algoritmusokat mutatja be.

Paraméter értéke Végrehajtja
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

Válaszok

A megadott kivonatoló algoritmus új példánya, vagy null ha hashName nem érvényes kivonatoló algoritmus.

Attribútumok

A következőre érvényes: