Unable to reproduce AWS signature from example using HMAC SHA256

后端 未结 2 474
既然无缘
既然无缘 2021-01-24 22:45

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

2条回答
  •  后悔当初
    2021-01-24 23:02

    It's possible that your "strange sequence of characters" is in fact the correct output.

    OpenSSL::HMAC.digest spits out a value represented in binary, and you are comparing that to a value represented in hex

    Check to see what happens when you print out the signature after converting it to hex representation like so:

    signature.each_byte.map { |b| "%02x" % b }.join
    

提交回复
热议问题