HashAlgorithm.Create メソッド

定義

ハッシュ アルゴリズムの実装のインスタンスを作成します。

オーバーロード

名前 説明
Create()
古い.
古い.

ハッシュ アルゴリズムの既定の実装のインスタンスを作成します。

Create(String)
古い.

ハッシュ アルゴリズムの指定した実装のインスタンスを作成します。

Create()

ソース:
HashAlgorithm.cs
ソース:
HashAlgorithm.cs
ソース:
HashAlgorithm.cs
ソース:
HashAlgorithm.cs
ソース:
HashAlgorithm.cs

注意事項

The default implementation of this cryptography algorithm is not supported.

注意事項

The default implementation of this cryptography algorithm is not supported

ハッシュ アルゴリズムの既定の実装のインスタンスを作成します。

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

返品

を使用して既定の設定が変更されていない限り、新しい SHA1CryptoServiceProvider インスタンス。

属性

例外

.NET Core 2.0 - 3.1 および .NET 5 以降: すべての場合。

注釈

このメソッドは、.NET 5 以降のバージョンでは使用されていません。

既定では、このオーバーロードはハッシュ アルゴリズムの SHA1CryptoServiceProvider 実装を使用します。 別の実装を指定する場合は、 Create(String) オーバーロードを使用します。これにより、代わりにアルゴリズム名を指定できます。 暗号化構成システムは、 HashAlgorithmの既定の実装を定義します。

SHA-1 の競合の問題により、Microsoft では SHA-256 以上に基づくセキュリティ モデルをお勧めします。

適用対象

Create(String)

ソース:
HashAlgorithm.cs
ソース:
HashAlgorithm.cs
ソース:
HashAlgorithm.cs
ソース:
HashAlgorithm.cs
ソース:
HashAlgorithm.cs

注意事項

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

ハッシュ アルゴリズムの指定した実装のインスタンスを作成します。

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

パラメーター

hashName
String

使用するハッシュ アルゴリズムの実装。 次の表に、 hashName パラメーターの有効な値と、それらがマップされるアルゴリズムを示します。

パラメーター値 用具
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

返品

指定したハッシュ アルゴリズムの新しいインスタンス。nullが有効なハッシュ アルゴリズムでない場合はhashName

属性

適用対象