語言

SHA256.Create 方法

定義

允許實例化此抽象類別的特定實作。

多載

名稱 Description
Create()

建立 的 SHA256預設實作實例。

Create(String)
已淘汰.

建立指定實作 SHA256的實例。

Create()

來源:
SHA256.cs
來源:
SHA256.cs
來源:
SHA256.cs
來源:
SHA256.cs
來源:
SHA256.cs

建立 的 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

傳回

一個新的實例。SHA256 在 .NET 框架中,若 FIPS 模式未啟用,此方法會建立 SHA256Managed 類別的實例;若 FIPS 模式為有效,則建立 SHA256Cng 類別的實例。 在 .NET Core 上,它會回傳一個由 SHA256 衍生出來的私有類別實例。

例外狀況

僅在 .NET Framework 4.6.1 及更早版本中:該演算法啟用聯邦資訊處理標準(FIPS)模式,但不相容 FIPS。

另請參閱

適用於

Create(String)

來源:
SHA256.cs
來源:
SHA256.cs
來源:
SHA256.cs
來源:
SHA256.cs
來源:
SHA256.cs

警告

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

建立指定實作 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

參數

hashName
String

具體實作 SHA256 名稱。

傳回

一個使用指定實作的新實例 SHA256 。

屬性

例外狀況

僅在 .NET Framework 上:FIPS 模式已啟用,但 hashName 請求 SHA256Managed,該模式不相容於 FIPS。

備註

.NET 框架包含實作及其相關的 hashName 值:

Implementation 雜湊名稱
SHA256Managed SHA256
SHA-256
系統.安全.密碼學.SHA256
SHA256Cng 系統.安全.密碼學.SHA256Cng
SHA256CryptoServiceProvider System.Security.Cryptography.SHA256CryptoServiceProvider

另請參閱

適用於