I think you have multiple problems. First of all, you're prepending your key string with "AWS" instead of "AWS4". Second, if I search for
969fbb94feb542b71ede6f87fe4d5fa29c789342b0f407474670f0c2489e0a0d I find
this example from AWS that shows that result from a different key and date string.
This online calculator verifies the result for these values:
secret key = AWS4wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY
string = 20120215
Note that the key is different from yours by one character.
BRS code:
keystr = "AWS4wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY"
dateStamp = "20120215"
sha256 = CreateObject("roHMAC")
bakey = CreateObject("roByteArray")
bamsg = CreateObject("roByteArray")
bakey.FromAsciiString(keystr)
bamsg.FromAsciiString(dateStamp)
if sha256.Setup("sha256",bakey) = 0 then
hash = sha256.Process(bamsg).ToHexString()
print "Hash: ";hash
else
print "Failure"
end if
Results in:
Hash: 969FBB94FEB542B71EDE6F87FE4D5FA29C789342B0F407474670F0C2489E0A0D
Do you have a link to the example you're using? It appears to be wrong.
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.