SHA256.Create Metod

Definition

Tillåter att specifika implementeringar av den här abstrakta klassen instansieras.

Överlagringar

Name Description
Create()

Skapar en instans av standardimplementeringen av SHA256.

Create(String)
Föråldrad.

Skapar en instans av en angiven implementering av SHA256.

Create()

Källa:
SHA256.cs
Källa:
SHA256.cs
Källa:
SHA256.cs
Källa:
SHA256.cs
Källa:
SHA256.cs

Skapar en instans av standardimplementeringen av SHA256.

public:
 static System::Security::Cryptography::SHA256 ^ Create();
public static System.Security.Cryptography.SHA256 Create();
static member Create : unit -> System.Security.Cryptography.SHA256
Public Shared Function Create () As SHA256

Returer

En ny instans av SHA256. I .NET Framework skapar den här metoden en instans av klassen SHA256Managed om FIPS-läget inte är aktivt. Om FIPS-läget är aktivt skapas en instans av klassen SHA256Cng. På .NET Core returneras en instans av en privat klass som härletts från SHA256.

Undantag

Endast i .NET Framework 4.6.1 och tidigare versioner: Algoritmen användes med FIPS-läge (Federal Information Processing Standards) aktiverat, men är inte FIPS-kompatibelt.

Se även

Gäller för

Create(String)

Källa:
SHA256.cs
Källa:
SHA256.cs
Källa:
SHA256.cs
Källa:
SHA256.cs
Källa:
SHA256.cs

Varning

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

Skapar en instans av en angiven implementering av SHA256.

public:
 static System::Security::Cryptography::SHA256 ^ 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.SHA256? Create(string hashName);
public static System.Security.Cryptography.SHA256? 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.SHA256? Create(string hashName);
public static System.Security.Cryptography.SHA256 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.SHA256
static member Create : string -> System.Security.Cryptography.SHA256
[<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.SHA256
Public Shared Function Create (hashName As String) As SHA256

Parametrar

hashName
String

Namnet på den specifika implementeringen av SHA256 som ska användas.

Returer

En ny instans av SHA256 att använda den angivna implementeringen.

Attribut

Undantag

Endast i .NET Framework: FIPS-läget är aktiverat, men hashName begäranden SHA256Managed, vilket inte är FIPS-kompatibelt.

Kommentarer

.NET Framework innehåller implementeringarna och deras associerade hashName-värden:

Implementation hashName
SHA256Managed SHA256
SHA-256
System.Security.Cryptography.SHA256
SHA256Cng System.Security.Cryptography.SHA256Cng
SHA256CryptoServiceProvider System.Security.Cryptography.SHA256CryptoServiceProvider

Se även

Gäller för