Class SignerUtils
java.lang.Object
software.amazon.awssdk.http.auth.aws.internal.signer.util.SignerUtils
Utility methods to be used by various AWS Signer implementations. This class is protected and subject to change.
- 
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddDateHeader(SdkHttpRequest.Builder requestBuilder, String dateTime) Add a date header using a datetime stringstatic voidaddHostHeader(SdkHttpRequest.Builder requestBuilder) Add the host header based on parameters of a requeststatic byte[]computeSignature(String stringToSign, byte[] signingKey) Compute the signature of a string using a signing key.static byte[]deriveSigningKey(AwsCredentialsIdentity credentials, CredentialScope credentialScope) Get the signing key based on the given credentials and a credential-scopestatic StringformatDate(Instant instant) Returns a string representation of the given datetime in yyyyMMdd format.static StringformatDateTime(Instant instant) Returns a string representation of the given datetime in yyyyMMdd'T'HHmmss'Z' format.static InputStreamgetBinaryRequestPayloadStream(ContentStreamProvider streamProvider) static StringgetContentHash(SdkHttpRequest.Builder requestBuilder) static byte[]hash(byte[] data) static byte[]hash(InputStream input) static byte[]static byte[]hash(ByteBuffer input) static StringhashCanonicalRequest(String canonicalRequestString) Create a hash of the canonical request stringstatic longmoveContentLength(SdkHttpRequest.Builder request, ContentStreamProvider contentStreamProvider) Move `Content-Length` to `x-amz-decoded-content-length` if not already present.static byte[]sign(byte[] data, byte[] key, SigningAlgorithm algorithm) Sign given data using a key and a specific algorithmstatic byte[]Sign given data using a key. 
- 
Method Details
- 
formatDate
 - 
formatDateTime
 - 
hashCanonicalRequest
 - 
deriveSigningKey
public static byte[] deriveSigningKey(AwsCredentialsIdentity credentials, CredentialScope credentialScope) Get the signing key based on the given credentials and a credential-scope - 
sign
Sign given data using a key. - 
sign
Sign given data using a key and a specific algorithm - 
computeSignature
Compute the signature of a string using a signing key.Step 4 of the AWS Signature version 4 calculation. Refer to https://docs.aws.amazon.com/IAM/latest/UserGuide/create-signed-request.html#calculate-signature.
 - 
addHostHeader
Add the host header based on parameters of a request - 
addDateHeader
Add a date header using a datetime string - 
moveContentLength
public static long moveContentLength(SdkHttpRequest.Builder request, ContentStreamProvider contentStreamProvider) Move `Content-Length` to `x-amz-decoded-content-length` if not already present. If `Content-Length` is not present, then the payload is read in its entirety to calculate the length. - 
getBinaryRequestPayloadStream
 - 
hash
 - 
hash
 - 
hash
public static byte[] hash(byte[] data)  - 
hash
 - 
getContentHash
 
 -