Search code examples
amazon-simpledbkrlhmac

Computing an HMAC-SHA signature


I'm writing a module for Amazon's SimpleDB. They require REST requests to be signed using HMAC-SHA algorithm. (Details here.)

I'm told that there is a function to computer this signature, but I can't find it in the documentation. What is the function called, and what do its arguments look like?


Solution

  • EDITED: The following should work:

    pre {
      message = "Four score and seven years ago";
      key = "Abe Lincoln";
      signature = math:hmac_sha256_base64(message, key);
    }
    notify("Signature is", signature);
    

    The function is math:hmac_sha256_base64(<datastring>,<keystring>)