I am following this example
http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
and trying to reproduce the 64 character string for the
I can't tell from your post but those are quite possibly exactly the same results, formatted differently.
Your code returns the raw result of the HMAC operation - this is arbitrary binary data so it's not going to print as anything readable. Amazon expect you to provide the hex representation for each byte: your first couple of bytes are "\xae\xee" instead of "aeee"
The easiest way to do this is call hexdigest
rather than digest
. Note that you should only do this for the final HMAC (when you sign the string to sign with the signing key) not when constructing the signing key