public final class AwsRequestSignerV4 extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
calculateBodyHash(byte[] data)
Calculates the hex-encoded SHA-256 hash of the provided byte array.
|
static String |
getCanonicalizedQueryString(Map<String,String> queryParameters)
Constructs the canonicalized query string for a request.
|
static byte[] |
hash(byte[] data)
Hashes the provided byte array using the SHA-256 algorithm.
|
static void |
sign(HttpURLConnection httpURLConnection,
Map<String,String> queryParameters,
long contentLength,
String bodyHash,
String serviceName,
String regionName,
String awsAccessKey,
char[] awsSecretKey)
Sign the provided request with an AWS4 signature as the 'Authorization'
header.
|
public static void sign(HttpURLConnection httpURLConnection, Map<String,String> queryParameters, long contentLength, String bodyHash, String serviceName, String regionName, String awsAccessKey, char[] awsSecretKey)
httpURLConnection - The request to sign.queryParameters - The query parameters being sent in the request.contentLength - The content length of the data being sent in the requestbodyHash - Hex-encoded SHA-256 hash of the data being sent in the requestserviceName - The signing name of the AWS service (e.g. "s3").regionName - The name of the AWS region that will handle the request (e.g.
"us-east-1").awsAccessKey - The user's AWS Access Key.awsSecretKey - The user's AWS Secret Key.public static String calculateBodyHash(byte[] data)
data - Byte array to hashpublic static String getCanonicalizedQueryString(Map<String,String> queryParameters)
queryParameters - The query parameters in the request.public static byte[] hash(byte[] data)
data - The byte array to hash.Copyright © 2023 Eclipse JGit Project. All rights reserved.