public final class AwsSignatureVersion4 extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ALGORITHM |
static String |
EMPTY_BODY_SHA256
SHA256 hash of an empty request body
|
static String |
SCHEME |
static String |
TERMINATOR |
static String |
UNSIGNED_PAYLOAD |
Modifier and Type | Method and Description |
---|---|
static String |
computeSignatureForAuthorizationHeader(URL endpointUrl,
String httpMethod,
String serviceName,
String regionName,
Clock clock,
Map<String,String> headers,
Map<String,String> queryParameters,
String bodyHash,
String awsAccessKey,
String awsSecretKey)
Computes an AWS4 signature for a request, ready for inclusion as an
'Authorization' header.
|
static String |
computeSignatureForQueryAuth(URL endpointUrl,
String httpMethod,
String serviceName,
Optional<String> regionName,
Clock clock,
Map<String,String> headers,
Map<String,String> queryParameters,
String bodyHash,
String awsAccessKey,
String awsSecretKey,
Optional<String> sessionToken)
Computes an AWS4 authorization for a request, suitable for embedding in query
parameters.
|
public static final String EMPTY_BODY_SHA256
public static final String UNSIGNED_PAYLOAD
public static final String SCHEME
public static final String ALGORITHM
public static final String TERMINATOR
public static String computeSignatureForQueryAuth(URL endpointUrl, String httpMethod, String serviceName, Optional<String> regionName, Clock clock, Map<String,String> headers, Map<String,String> queryParameters, String bodyHash, String awsAccessKey, String awsSecretKey, Optional<String> sessionToken)
endpointUrl
- the url to which the request is being madehttpMethod
- the HTTP method (GET, POST, PUT, etc.)serviceName
- the AWS service code (e.g iam)regionName
- the AWS region nameclock
- provides a timestampheaders
- The request headers; 'Host' and 'X-Amz-Date' will be
added to this set.queryParameters
- Any query parameters that will be added to the
endpoint. The parameters should be specified in
canonical format.bodyHash
- Precomputed SHA256 hash of the request body content;
this value should also be set as the header
'X-Amz-Content-SHA256' for non-streaming uploads.awsAccessKey
- The user's AWS Access Key.awsSecretKey
- The user's AWS Secret Key.sessionToken
- public static String computeSignatureForAuthorizationHeader(URL endpointUrl, String httpMethod, String serviceName, String regionName, Clock clock, Map<String,String> headers, Map<String,String> queryParameters, String bodyHash, String awsAccessKey, String awsSecretKey)
endpointUrl
- the url to which the request is being madehttpMethod
- the HTTP method (GET, POST, PUT, etc.)serviceName
- the AWS service code (e.g iam)regionName
- the AWS region nameclock
- provides a timestampheaders
- The request headers; 'Host' and 'X-Amz-Date' will be
added to this set.queryParameters
- Any query parameters that will be added to the
endpoint. The parameters should be specified in
canonical format.bodyHash
- Precomputed SHA256 hash of the request body content;
this value should also be set as the header
'X-Amz-Content-SHA256' for non-streaming uploads.awsAccessKey
- The user's AWS Access Key.awsSecretKey
- The user's AWS Secret Key.Copyright © 2021–2024. All rights reserved.