title: The request signature we calculated does not match the signature you provided. Check your key and signing method from salesforce to amazon s3
body: <p>I am creating signature for getting file from amazon S3 from salesforce. I am getting below error </p>
  
  <blockquote>
    <p>The request signature we calculated does not match the signature you
    provided. Check your key and signing method. I am using below code</p>
  </blockquote>
  
  <pre><code>Blob signatureBlob = Crypto.generateMac('hmacSHA1', Blob.valueOf('MY Secrate Code') ,Blob.valueOf(('GET\n\n\n'+Datetime.now().addminutes(2).getTime()/1000+'\n/bucketname/sfaccounts/BillPayment.pdf')));
  String signatureString = EncodingUtil.Base64Encode(signatureBlob);
  signatureString  = EncodingUtil.urlEncode(signatureString , 'UTF-8');
  PageReference pg = new PageReference('https://bucketname.s3.amazonaws.com/sfaccounts/BillPayment.pdf?AWSAccessKeyId=accessID&amp;Expires='+Datetime.now().addminutes(2).getTime()/1000+'&amp;Signature=' + signatureString);
  return pg;
  </code></pre>
  
  <p>can anyone help me?</p>