javapenguin
javapenguin

Reputation: 1036

AWS S3 rest api signature

Can someone please help me with calculating the AWS_SIGNATURE in bash

Here is the GET I am trying to do:

curl -k \
-X GET \
-H "Host: ${AWS_BUCKET_NAME}.s3.eu-west-1.amazonaws.com" \
-H "Date: Tue, 27 Nov 2018 11:20:00 +0200" \
-H "Authorization: AWS ${AWS_ACCESS_KEY_ID}:${AWS_SIGNATURE}" \
"https://s3.eu-west-1.amazonaws.com/${AWS_BUCKET_NAME}/?list-type=2"

Upvotes: 0

Views: 170

Answers (1)

mootmoot
mootmoot

Reputation: 13166

You need to install openssl and base64 encoder to create the signature.

Assume you supply value for each $variable

Signature=`echo -n $StringToSign | openssl sha1 -hmac $YourSecretAccessKeyID | base64`

Upvotes: 1

Related Questions