Your Rating: Results: PatheticBadOKGoodOutstanding! 17 rates

Description

Creates 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.

Returns

An encoded string

Category

Display and formatting functions

History

ColdFusion 10: Added this function.

Syntax

HMac(message, key [,algorithm] [,encoding])

See also

SessionInvalidate, SessionRotate

History

ColdFusion 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.

Usage

Use this function to create Hash-based Message Authentication Code for the given string based on the algorithm and encoding.

Example

Labels
  • None
  1. Sep 09, 2014

    This documentation is lacking.  First off, why are links to SessionInvalidate() and SessionRotate() instead of Hash()?

     

    Second where are references to valid encodings and algorithms?  The example says nothing to people who are unfamiliar with hmac in the first place.

     

    If this is all the documentation you give us for reference, then at least make it usable.


Searching ColdFusion, English documentation