Class AbstractAwsSigner
java.lang.Object
software.amazon.awssdk.auth.signer.internal.AbstractAwsSigner
- All Implemented Interfaces:
Signer
- Direct Known Subclasses:
AbstractAws4Signer
Abstract base class for AWS signing protocol implementations. Provides
utilities commonly needed by signing protocols such as computing
canonicalized host names, query string parameters, etc.
Not intended to be sub-classed by developers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddSessionCredentials(SdkHttpFullRequest.Builder mutableRequest, AwsSessionCredentials credentials) Adds session credentials to the request given.protected InputStreamgetBinaryRequestPayloadStream(ContentStreamProvider streamProvider) protected AwsCredentialssanitizeCredentials(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 StringsignAndBase64Encode(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) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.awssdk.core.signer.Signer
credentialType, sign
-
Constructor Details
-
AbstractAwsSigner
public AbstractAwsSigner()
-
-
Method Details
-
signAndBase64Encode
protected String signAndBase64Encode(String data, String key, SigningAlgorithm algorithm) throws SdkClientException Computes an RFC 2104-compliant HMAC signature and returns the result as a Base64 encoded string.- Throws:
SdkClientException
-
signWithMac
-
sign
protected byte[] sign(String stringData, byte[] key, SigningAlgorithm algorithm) throws SdkClientException - Throws:
SdkClientException
-
sign
protected byte[] sign(byte[] data, byte[] key, SigningAlgorithm algorithm) throws SdkClientException - Throws:
SdkClientException
-
getBinaryRequestPayloadStream
-
sanitizeCredentials
Loads the individual access key ID and secret key from the specified credentials, trimming any extra whitespace from the credentials.Returns either a
AwsSessionCredentialsor aAwsBasicCredentialsobject, depending on the input type.- Returns:
- A new credentials object with the sanitized credentials.
-
addSessionCredentials
protected abstract void addSessionCredentials(SdkHttpFullRequest.Builder mutableRequest, AwsSessionCredentials credentials) Adds session credentials to the request given.- Parameters:
mutableRequest- The request to add session credentials information tocredentials- The session credentials to add to the request
-