HMAC.Create メソッド

定義

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

オーバーロード

Create()
古い.
古い.

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

Create(String)
古い.

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

Create()

ソース:
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

注意事項

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

パラメーター

algorithmName
String

使用する HMAC 実装。 algorithmName パラメーターの有効値、およびそれらの割り当て先のアルゴリズムを次の表に示します。

パラメーター値
System.Security.Cryptography.HMACHMACSHA1
System.Security.Cryptography.KeyedHashAlgorithmHMACSHA1
HMACMD5HMACMD5
System.Security.Cryptography.HMACMD5HMACMD5
HMACRIPEMD160HMACRIPEMD160
System.Security.Cryptography.HMACRIPEMD160HMACRIPEMD160
HMACSHA1HMACSHA1
System.Security.Cryptography.HMACSHA1HMACSHA1
HMACSHA256HMACSHA256
System.Security.Cryptography.HMACSHA256HMACSHA256
HMACSHA384HMACSHA384
System.Security.Cryptography.HMACSHA384HMACSHA384
HMACSHA512HMACSHA512
System.Security.Cryptography.HMACSHA512HMACSHA512
MACTripleDESMACTripleDES
System.Security.Cryptography.MACTripleDESMACTripleDES

戻り値

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

属性

注釈

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

MD5 と SHA-1 の競合の問題により、Microsoftは SHA-256 以上に基づくセキュリティ モデルを推奨しています。

適用対象