The secret cryptographic key (a binary value) used when encrypting the content
.
HMACBinary
HMACBinary(secret: Binary, content: Binary, algorithm: String = "HmacSHA1"): Binary
Computes an HMAC hash (with a secret cryptographic key) on input content.
See also, HMACWith
.
Parameters
Name | Description |
---|---|
|
|
|
The binary input value. |
|
The hashing algorithm. |
Example
This example uses HMAC with a secret value to encrypt the input content.
Source
%dw 2.0
import dw::Crypto
output application/json
---
{
"HMACBinary" : Crypto::HMACBinary("confidential" as Binary, "xxxxx" as Binary, "HmacSHA512")
}
DataWeave
Output
{
"HMACBinary": "\ufffd\ufffd\ufffd\ufffd^h\ufffd!3\u0005\ufffd֎\u00017\ufffd\ufffd\ufffd`\ufffd8?\ufffdjn7\ufffdbs;\t\ufffdƅ\ufffd\ufffd\ufffdx&g\ufffd~\ufffd\ufffd%\ufffd7>1\ufffdK\u000e@\ufffdC\u0011\ufffdT\ufffd}W"
}
JSON