Creating HMAC Hash

Engaged ,
Jul 07, 2015 Jul 07, 2015

Copy link to clipboard


After a couple fruitless hours of trying I need some help...  I'm trying to sign a URL for a REST API and, for the life of me, can't get CF to output the expected result.  The API is Aspose and the the instructions are here:

According to their example I need to hash this URL:

Using this Key: 23e9d89a967a5f18142221fa8f7cbcd0

And the result should be:Z98TBrlwdtx3pTa6fWVD/Q0c2dE=

According to the C# example they give the algorithm should be: HMACSHA1 and the encoding: UTF8

I cannot get CF to produce this result.

I've tried using the CF function hmac().

#toBase64(hmac(url,key,"HMACSHA1","UTF8"))# gives me: MjYwMkQxN0EyM0IyMzkxNjNDMDU4QTQyMjc3RDgyNkMyNzM0NTA3OA==

I've also tried suggestions and variations found here:

and Ban Nadel's Crypto.cfc.

What am I missing here?







Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation