AWS Signature v4 in Bash

Posted by & filed under Programming.

The last step in signing the API request to AWS is calculating the signature using the secret key. Here is a subroutine to calculate it in a bash script. Make sure openssl is at least 1.0.0 function sign {   kSecret=$(printf “AWS4$1” | xxd -p -c 256)   kDate=$(printf “$2” | openssl dgst -binary -sha256 -mac HMAC… Read more »