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?
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>)
The HMAC is a standard function that can be found in crypto libraries for most platforms. Amazon shows several examples on the documentaion page you link to.
For Java, you can find it in javax.crypto.Mac
For .Net, look in System.Security.Cryptography
For KRL, I haven't found any built-in stock solution. Since it seems possible to embed javascript, the jsSHA implemenation could be useful. There is a sha1 function in the math library, and implementing HMAC according to RFC2104 doesn't seem that difficult.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With