title: SignatureDoesNotMatch error while connecting to Amazon S3 through JAVA
body: <p>I am getting the error as "SignatureDoesnotMatch" since last 4 hours.Please check and let me know what is missing in my code:</p>
  
  <pre><code>AmazonS3 s3Client = new AmazonS3Client(new ProfileCredentialsProvider());
  s3Client.setEndpoint("***my-service-end-point");
  s3Client.setRegion("my-region");
  java.util.Date expiration = new java.util.Date();
  long milliSeconds = expiration.getTime();
  milliSeconds += 1000 * 60 * 60;
  expiration.setTime(milliSeconds);
  GeneratePresignedUrlRequest generatePresignedUrlRequest = 
   new GeneratePresignedUrlRequest(existingBucketName, keyName);
    generatePresignedUrlRequest.setMethod(HttpMethod.GET); 
  generatePresignedUrlRequest.setExpiration(expiration);
  
  URL url = s3Client.generatePresignedUrl(generatePresignedUrlRequest);
  System.out.println("s3Client :" + s3Client.getBucketLocation(existingBucketName))
  </code></pre>