HMAC.Create メソッド

定義

ハッシュ ベースのメッセージ認証コード (HMAC) の実装のインスタンスを作成します。

オーバーロード

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

ハッシュ ベースのメッセージ認証コード (HMAC) の既定の実装のインスタンスを作成します。

Create(String)
古い.

ハッシュ ベースのメッセージ認証コード (HMAC) の指定された実装のインスタンスを作成します。

Create()

ソース:
HMAC.cs
ソース:
HMAC.cs
ソース:
HMAC.cs
ソース:
HMAC.cs
ソース:
HMAC.cs

注意事項

The default implementation of this cryptography algorithm is not supported.

注意事項

The default implementation of this cryptography algorithm is not supported

ハッシュ ベースのメッセージ認証コード (HMAC) の既定の実装のインスタンスを作成します。

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

返品

<cryptoClass> 要素を使用して既定の設定が変更されていない限り、新しい SHA-1 インスタンス。

属性

例外

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

注釈

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

既定では、このオーバーロードでは HMAC の SHA-1 実装が使用されます。 別の実装を指定する場合は、 Create(String) オーバーロードを使用します。これにより、代わりにアルゴリズム名を指定できます。

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

適用対象

Create(String)

ソース:
HMAC.cs
ソース:
HMAC.cs
ソース:
HMAC.cs
ソース:
HMAC.cs
ソース:
HMAC.cs

注意事項

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

ハッシュ ベースのメッセージ認証コード (HMAC) の指定された実装のインスタンスを作成します。

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

パラメーター

algorithmName
String

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

パラメーター値 用具
System.Security.Cryptography.HMAC HMACSHA1
System.Security.Cryptography.KeyedHashAlgorithm HMACSHA1
Hmacmd5 HMACMD5
System.Security.Cryptography.HMACMD5 HMACMD5
HMACRIPEMD160 HMACRIPEMD160
System.Security.Cryptography.HMACRIPEMD160 HMACRIPEMD160
Hmacsha1 HMACSHA1
System.Security.Cryptography.HMACSHA1 HMACSHA1
Hmacsha256 HMACSHA256
System.Security.Cryptography.HMACSHA256 HMACSHA256
Hmacsha384 HMACSHA384
System.Security.Cryptography.HMACSHA384 HMACSHA384
Hmacsha512 HMACSHA512
System.Security.Cryptography.HMACSHA512 HMACSHA512
MACTripleDES MACTripleDES
System.Security.Cryptography.MACTripleDES MACTripleDES

返品

指定した HMAC 実装の新しいインスタンス。

属性

注釈

HMAC では、MD5、SHA-1、SHA-256、RIPEMD160など、さまざまなハッシュ アルゴリズムがサポートされています。 完全な一覧については、 algorithmName パラメーターでサポートされている値を参照してください。

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

適用対象