AWS S3 Rest API签名

时间:2018-11-27 09:29:55

标签: amazon-web-services amazon-s3

有人可以帮我计算bash中的AWS_SIGNATURE

这是我要尝试的GET:

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"

1 个答案:

答案 0 :(得分:0)

您需要安装openssl和base64编码器才能创建签名。

假设您为每个$ variables提供值

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