private static String formatAuthorizationHeader( S3Config bucketConfig, String canonicalizedHeaderNames, String scope, byte[] signature) { StringBuilder s = new StringBuilder(); s.append(SCHEME).append("-").append(ALGORITHM).append(" "); //$NON-NLS-1$ //$NON-NLS-2$ s.append("Credential=").append(bucketConfig.getAccessKey()).append("/") //$NON-NLS-1$//$NON-NLS-2$ .append(scope).append(","); //$NON-NLS-1$ s.append("SignedHeaders=").append(canonicalizedHeaderNames).append(","); //$NON-NLS-1$ //$NON-NLS-2$ s.append("Signature=").append(toHex(signature)); //$NON-NLS-1$ return s.toString(); }
private static String stringToSign(String scheme, String algorithm, String dateTime, String scope, String canonicalRequest) { return String.format("%s-%s\n%s\n%s\n%s", //$NON-NLS-1$ scheme, algorithm, dateTime, scope, toHex(hash(canonicalRequest))); }
private static String stringToSign(String scheme, String algorithm, String dateTime, String scope, String canonicalRequest) { return String.format("%s-%s\n%s\n%s\n%s", //$NON-NLS-1$ scheme, algorithm, dateTime, scope, toHex(hash(canonicalRequest))); }
private static String formatAuthorizationHeader( S3Config bucketConfig, String canonicalizedHeaderNames, String scope, byte[] signature) { StringBuilder s = new StringBuilder(); s.append(SCHEME).append("-").append(ALGORITHM).append(" "); //$NON-NLS-1$ //$NON-NLS-2$ s.append("Credential=").append(bucketConfig.getAccessKey()).append("/") //$NON-NLS-1$//$NON-NLS-2$ .append(scope).append(","); //$NON-NLS-1$ s.append("SignedHeaders=").append(canonicalizedHeaderNames).append(","); //$NON-NLS-1$ //$NON-NLS-2$ s.append("Signature=").append(toHex(signature)); //$NON-NLS-1$ return s.toString(); }
byte[] signature = createSignature(bucketConfig, dateTimeStampISO8601, dateStamp, scope, canonicalRequest); queryParameters.put(X_AMZ_SIGNATURE, toHex(signature));
byte[] signature = createSignature(bucketConfig, dateTimeStampISO8601, dateStamp, scope, canonicalRequest); queryParameters.put(X_AMZ_SIGNATURE, toHex(signature));