code: public static String getVersion2SignedRequest(String              requestMethod,
                                                    String              protocol,
                                                    String              endpoint,
                                                    String              requestURI,
                                                    Map<String, String> params,
                                                    String              awsAccessKeyId,
                                                    String              awsSecretKey)
              throws SignatureException {
          if ((requestMethod == null)  ||
              (protocol == null)       ||
              (endpoint == null)       ||
              (requestURI == null)     ||
              (params == null)         ||
              (awsAccessKeyId == null) ||
              (awsSecretKey == null)) {
              throw new IllegalArgumentException("Null parameter passed in");
          }
  
          params.put("AWSAccessKeyId", awsAccessKeyId);
          params.put("SignatureMethod", HMAC_SHA256_ALGORITHM);
          params.put("SignatureVersion", "2");
          params.put("Timestamp", getTimestamp());
  
          String canonicalQS = getV2CanonicalizedQueryString(params);
          String stringToSign = requestMethod + "\n" +
                                endpoint      + "\n" +
                                requestURI    + "\n" +
                                canonicalQS;
          String signature = createSignature(stringToSign,
                                             awsSecretKey,
                                             HMAC_SHA256_ALGORITHM);
          String request = protocol + "://" + endpoint + requestURI
                               + "?" + canonicalQS
                               + "&Signature=" + signature;
  
          return request;
      }
docs: This method returns a complete signed request using HmaSHA256 algorithm
  using the "SignatureVersion 2" scheme. Currently, this method creates
  "SignatureVersion 2" based signed requests ONLY for the HTTP "GET"
  method. It's the callers the responsibility such as "Action" and such
  based on the REST API that they are trying to exercise. This method adds
  "SignatureVersion", "SignatureMethod", "AWSAccessKeyId", "Timestamp", and
  "Signature" parameters to the request.
  
  @param requestMethod     Only "GET at this point.
  @param endpoint          endpoint or the host
  @param requestURI        following the endpoint up until the query params
  @param params            Map of name-value pairs containing params such
  as "Action", etc.
  @param awsAccessKeyId    AccessKeyId of the caller to create a signature
  @param awsSecretKey      SecretKey of the caller to create the signature
  @return String   the complete URL with proper encoding and the Signature
  query param appended
  @throws java.security.SignatureException