CryptographicOperations.TryHmacData メソッド

定義

データの HMAC の計算を試みます。

public:
 static bool TryHmacData(System::Security::Cryptography::HashAlgorithmName hashAlgorithm, ReadOnlySpan<System::Byte> key, ReadOnlySpan<System::Byte> source, Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public static bool TryHmacData (System.Security.Cryptography.HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten);
static member TryHmacData : System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * int -> bool
Public Shared Function TryHmacData (hashAlgorithm As HashAlgorithmName, key As ReadOnlySpan(Of Byte), source As ReadOnlySpan(Of Byte), destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean

パラメーター

hashAlgorithm
HashAlgorithmName

HMAC の計算に使用されるアルゴリズム。

key
ReadOnlySpan<Byte>

秘密鍵。 キーには任意の長さを指定できます。

source
ReadOnlySpan<Byte>

HMAC を計算するデータ。

destination
Span<Byte>

HMAC 値を受け取るバッファー。

bytesWritten
Int32

このメソッドが返されるときに、destinationに書き込まれたバイトの合計数。

戻り値

false destination が小さすぎて計算された HMAC を保持できない場合は true。それ以外の場合は true

例外

hashAlgorithm に空の Name があります。

hashAlgorithm には、nullされている Name があります。

hashAlgorithm は、現在のプラットフォームでサポートされていないハッシュ アルゴリズムを指定します。

hashAlgorithm は、不明なハッシュ アルゴリズムを指定します。

適用対象