'react native - AWS Signature V4 - how to hexencode to get the signature

After hours trying to get a GET request running with several packages trying to create the right signature I started putting together my own code for the same.

Especially to see the Canonical Request and the StringToSign that was important, both look now exactly the same compared to what aws throws me as error in addition to

The request signature we calculated does not match the signature you provided.

I think currently I am struggling with the last step:

signature = HexEncode(HMAC(derived signing key, string to sign))

This is what aws gives as pseudocode to create the final signature.

I managed to create sha256 and hmacsha256 but I am really struggling what the hex here would translate into in javascript respectively react native. Can somebody help me with that? This is basically the last step I think I have to take.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source