---
schema_version: "1"
id: ddc240895b1abf69c0cb6d4a2963d27985d1bc1c05327a6628a8961044a160fd
title: HMACWith
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.3/dw-crypto-functions-hmacwith.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.3/dw-crypto-functions-hmacwith
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 3a42a2ca166516ded5458f2e0cda27f11a30ded8ae858fceaedfa7dcc41c5fdc
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
# HMACWith

## [](#hmacwith1)HMACWith(Binary, Binary, String): String

入力コンテンツの HMAC ハッシュを計算し (秘密暗号化キーを使用)、その結果を小文字の 16 進文字列に変換します。

`HMACBinary`​ も参照してください。

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name (名前)</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>secret</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>Binary</code>​ を暗号化するときに使用される秘密暗号化キー (​<code>content</code>​)。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>content</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">入力コンテンツ。​<code>Binary</code>​ 値。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>algorithm</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">(​<em>DataWeave 2.2.0 で導入されました。Mule 4.2 以降でサポートされます。</em>​)ハッシュアルゴリズム。デフォルトでは、​<code>HmacSHA1</code>​ が使用されます。他の有効な値は、​<code>HmacSHA256</code>​ と ​<code>HmacSHA512</code>​ です。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、HMAC と秘密値を使用して入力コンテンツを暗号化します。アルゴリズムには ​`HmacSHA256`​ を使用します。

#### [](#取得元)取得元

```DataWeave
%dw 2.0
import dw::Crypto
output application/json
---
{ "HMACWith" : Crypto::HMACWith("secret_key" as Binary, "Some value to hash" as Binary, "HmacSHA256") }
```

#### [](#出力)出力

```JSON
{ "HMACWith": "b51b4fe8c4e37304605753272b5b4321f9644a9b09cb1179d7016c25041d1747" }
```