我正在尝试使用REST API [1]在Amazon s3中使用删除存储桶复制操作。为此,我实现了AWS签名计算类[2]和一种调用deleteBucketReplication rest API [3]的方法。但是我收到403“ SignatureDoesNotMatch”错误。请在此处找到发送到支持的请求[4]。
有人可以帮助我克服这个问题吗?
[1] https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketDELETEreplication.html
[2] https://github.com/Biruntha/AWS_S3_Example/blob/master/src/main/java/AWSSignatureV4Generator.java [3] https://github.com/Biruntha/AWS_S3_Example/blob/master/src/main/java/AWSV4AuthTest.java#L13
[4]
规范请求:删除
/?复制
host:testbuckkkbiru.s3.amazonaws.com
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:星期二,2018年10月9日格林尼治标准时间
host; x-amz-content-sha256; x-amz-date e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
要签名的字符串:AWS4-HMAC-SHA256 2018年10月9日(星期二)格林尼治标准时间 20181009 / us-east-2 / s3 / aws4_request d9c53b745da19f10565cf77b6b11fde944354448322b85d99b7f502a363fb57e
e29af9cf031ac2c94a109f20fa9f8ad5b88b89686f86e32015c8b535b84fcc46
x-amz-date =周二,2018年10月9日格林尼治标准时间
授权= AWS4-HMAC-SHA256 凭证= xxxxxxxxxxxxxx / 20181009 / us-east-2 / s3 / aws4_request,SignedHeaders = host; x-amz-content-sha256; x-amz-date,Signature = e29af9cf031ac2c94a109f20fa9f8ad5b88b89686f86e32015c8b535b84fcc46
===============================