public abstract class AbstractAwsSigner extends Object implements Signer
Not intended to be sub-classed by developers.
Constructor and Description |
---|
AbstractAwsSigner() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addSessionCredentials(SdkHttpFullRequest.Builder mutableRequest,
AwsSessionCredentials credentials)
Adds session credentials to the request given.
|
protected InputStream |
getBinaryRequestPayloadStream(ContentStreamProvider streamProvider) |
protected String |
getCanonicalizedEndpoint(SdkHttpFullRequest request) |
protected String |
getCanonicalizedQueryString(Map<String,List<String>> parameters)
Examines the specified query string parameters and returns a
canonicalized form.
|
protected AwsCredentials |
sanitizeCredentials(AwsCredentials credentials)
Loads the individual access key ID and secret key from the specified credentials, trimming any extra whitespace from the
credentials.
|
protected byte[] |
sign(byte[] data,
byte[] key,
SigningAlgorithm algorithm) |
protected byte[] |
sign(String stringData,
byte[] key,
SigningAlgorithm algorithm) |
protected String |
signAndBase64Encode(String data,
String key,
SigningAlgorithm algorithm)
Computes an RFC 2104-compliant HMAC signature and returns the result as a
Base64 encoded string.
|
protected byte[] |
signWithMac(String stringData,
Mac mac) |
protected String signAndBase64Encode(String data, String key, SigningAlgorithm algorithm) throws SdkClientException
SdkClientException
protected byte[] sign(String stringData, byte[] key, SigningAlgorithm algorithm) throws SdkClientException
SdkClientException
protected byte[] sign(byte[] data, byte[] key, SigningAlgorithm algorithm) throws SdkClientException
SdkClientException
protected String getCanonicalizedQueryString(Map<String,List<String>> parameters)
The canonicalized query string is formed by first sorting all the query string parameters, then URI encoding both the key and value and then joining them, in order, separating key value pairs with an '&'.
parameters
- The query string parameters to be canonicalized.protected InputStream getBinaryRequestPayloadStream(ContentStreamProvider streamProvider)
protected String getCanonicalizedEndpoint(SdkHttpFullRequest request)
protected AwsCredentials sanitizeCredentials(AwsCredentials credentials)
Returns either a AwsSessionCredentials
or a AwsBasicCredentials
object, depending on the input type.
protected abstract void addSessionCredentials(SdkHttpFullRequest.Builder mutableRequest, AwsSessionCredentials credentials)
mutableRequest
- The request to add session credentials information tocredentials
- The session credentials to add to the requestCopyright © 2019. All rights reserved.