IncrementalHash.CreateHMAC メソッド

定義

オーバーロード

CreateHMAC(HashAlgorithmName, Byte[])

指定したハッシュ アルゴリズムとキーを使用してハッシュ ベース メッセージ認証コード (HMAC) アルゴリズムの IncrementalHash を作成します。

CreateHMAC(HashAlgorithmName, ReadOnlySpan<Byte>)

hashAlgorithm によって指定されているハッシュ アルゴリズムと、key によって指定されているキーを利用して、ハッシュ ベースのメッセージ認証コード (HMAC) アルゴリズムに対する IncrementalHash を作成します。

CreateHMAC(HashAlgorithmName, Byte[])

指定したハッシュ アルゴリズムとキーを使用してハッシュ ベース メッセージ認証コード (HMAC) アルゴリズムの IncrementalHash を作成します。

public:
 static System::Security::Cryptography::IncrementalHash ^ CreateHMAC(System::Security::Cryptography::HashAlgorithmName hashAlgorithm, cli::array <System::Byte> ^ key);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.Security.Cryptography.IncrementalHash CreateHMAC (System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] key);
public static System.Security.Cryptography.IncrementalHash CreateHMAC (System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] key);
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member CreateHMAC : System.Security.Cryptography.HashAlgorithmName * byte[] -> System.Security.Cryptography.IncrementalHash
static member CreateHMAC : System.Security.Cryptography.HashAlgorithmName * byte[] -> System.Security.Cryptography.IncrementalHash
Public Shared Function CreateHMAC (hashAlgorithm As HashAlgorithmName, key As Byte()) As IncrementalHash

パラメーター

hashAlgorithm
HashAlgorithmName

HMAC 内で実行するハッシュ アルゴリズムの名前。

key
Byte[]

HMAC の秘密鍵。 キーの長さは任意で指定できますが、指定したハッシュ アルゴリズムの出力サイズよりも長いキーは、サイズのキーが正しくなるようにハッシュされます。 そのため、推奨される秘密鍵のサイズは、指定したハッシュ アルゴリズムの出力サイズです。

戻り値

IncrementalHash

IncrementalHash クラスのインスタンスは、指定したハッシュ アルゴリズムをすぐに計算できます。

属性

例外

keynullです。

hashAlgorithm.Name は、null または空の文字列です。

hashAlgorithm は既知のハッシュ アルゴリズムではありません。

適用対象

CreateHMAC(HashAlgorithmName, ReadOnlySpan<Byte>)

hashAlgorithm によって指定されているハッシュ アルゴリズムと、key によって指定されているキーを利用して、ハッシュ ベースのメッセージ認証コード (HMAC) アルゴリズムに対する IncrementalHash を作成します。

public:
 static System::Security::Cryptography::IncrementalHash ^ CreateHMAC(System::Security::Cryptography::HashAlgorithmName hashAlgorithm, ReadOnlySpan<System::Byte> key);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.Security.Cryptography.IncrementalHash CreateHMAC (System.Security.Cryptography.HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> key);
public static System.Security.Cryptography.IncrementalHash CreateHMAC (System.Security.Cryptography.HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> key);
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member CreateHMAC : System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<byte> -> System.Security.Cryptography.IncrementalHash
static member CreateHMAC : System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<byte> -> System.Security.Cryptography.IncrementalHash
Public Shared Function CreateHMAC (hashAlgorithm As HashAlgorithmName, key As ReadOnlySpan(Of Byte)) As IncrementalHash

パラメーター

hashAlgorithm
HashAlgorithmName

HMAC 内で実行するハッシュ アルゴリズムの名前。

key
ReadOnlySpan<Byte>

HMAC の秘密鍵。 キーは任意の長さにすることができますが、hashAlgorithm によって指定されたハッシュ アルゴリズムの出力サイズより長いキーは、正しいサイズのキーになるように (hashAlgorithm によって指定されているアルゴリズムを使用して) ハッシュされます。 そのため、推奨される秘密鍵のサイズは、hashAlgorithm によって指定されているハッシュの出力サイズです。

戻り値

IncrementalHash

hashAlgorithm で指定したハッシュ アルゴリズムを計算するハッシュ インスタンス。

属性

例外

hashAlgorithm.Namenull か、または空の文字列です。

hashAlgorithm は既知のハッシュ アルゴリズムではありません。

適用対象