|
DescriptionCreates Hash-based Message
Authentication Code for the given string based on the algorithm
and encoding. Hash-based Message Authentication Code (HMAC) is used
to verify the data integrity and authenticity of a message transmitted.
It involves a cryptographic hash function in combination with a
secret key. The cryptographic hash function can be Message Digest
5 (MD5), Secure Hash Algorithm (SHA), and so on.
Returnsa Boolean value. true if successful.
CategoryDisplay and formatting functions
SyntaxHMac(message, key [,algorithm] [,encoding])
HistoryColdFusion 10: Added this function.
Parameters
Parameter
|
Required\Optional
|
Description
|
message
|
Required
|
The message to transmit. The message can
be a String or a byte array.
|
key
|
Required
|
The secret key to create HMAC. The key can
be a String or a byte array.
|
algorithm
|
Optional
|
Algorithm used.
|
encoding
|
Optional
|
Encoding to be used.
|
UsageUse this function to create Hash-based
Message Authentication Code for the given string based on the algorithm
and encoding.
Example<h2>HMAC Test</h2>
<cfset x=hmac("Hi There","key1","HMACRIPEMD160")>
<cfoutput>#x#</cfoutput>
|
|
|