Class AbstractAwsS3V4Signer
- java.lang.Object
-
- software.amazon.awssdk.auth.signer.internal.AbstractAwsSigner
-
- software.amazon.awssdk.auth.signer.internal.AbstractAws4Signer<AwsS3V4SignerParams,Aws4PresignerParams>
-
- software.amazon.awssdk.auth.signer.internal.AbstractAwsS3V4Signer
-
- Direct Known Subclasses:
AwsS3V4Signer
public abstract class AbstractAwsS3V4Signer extends AbstractAws4Signer<AwsS3V4SignerParams,Aws4PresignerParams>
AWS4 signer implementation for AWS S3
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONTENT_SHA_256_WITH_CHECKSUM
static String
STREAMING_UNSIGNED_PAYLOAD_TRAILER
-
Fields inherited from class software.amazon.awssdk.auth.signer.internal.AbstractAws4Signer
EMPTY_STRING_SHA256_HEX
-
-
Constructor Summary
Constructors Constructor Description AbstractAwsS3V4Signer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
calculateContentHash(SdkHttpFullRequest.Builder mutableRequest, AwsS3V4SignerParams signerParams)
Returns the pre-defined header value and set other necessary headers if the request needs to be chunk-encoded.protected String
calculateContentHash(SdkHttpFullRequest.Builder mutableRequest, AwsS3V4SignerParams signerParams, SdkChecksum contentFlexibleChecksum)
This method overloads calculateContentHash with contentFlexibleChecksum.protected String
calculateContentHashPresign(SdkHttpFullRequest.Builder mutableRequest, Aws4PresignerParams signerParams)
static long
getChecksumTrailerLength(AwsS3V4SignerParams signerParams)
SdkHttpFullRequest
presign(SdkHttpFullRequest request, Aws4PresignerParams signingParams)
A method to pre sign the given #request.SdkHttpFullRequest
presign(SdkHttpFullRequest request, ExecutionAttributes executionAttributes)
protected void
processRequestPayload(SdkHttpFullRequest.Builder mutableRequest, byte[] signature, byte[] signingKey, Aws4SignerRequestParams signerRequestParams, AwsS3V4SignerParams signerParams)
If necessary, creates a chunk-encoding wrapper on the request payload.protected void
processRequestPayload(SdkHttpFullRequest.Builder mutableRequest, byte[] signature, byte[] signingKey, Aws4SignerRequestParams signerRequestParams, AwsS3V4SignerParams signerParams, SdkChecksum sdkChecksum)
Overloads processRequestPayload with sdkChecksum.SdkHttpFullRequest
sign(SdkHttpFullRequest request, AwsS3V4SignerParams signingParams)
A method to sign the given #request.SdkHttpFullRequest
sign(SdkHttpFullRequest request, ExecutionAttributes executionAttributes)
-
Methods inherited from class software.amazon.awssdk.auth.signer.internal.AbstractAws4Signer
addSessionCredentials, deriveSigningKey, deriveSigningKey, doPresign, doSign, doSign, extractPresignerParams, extractSignerParams
-
Methods inherited from class software.amazon.awssdk.auth.signer.internal.AbstractAwsSigner
getBinaryRequestPayloadStream, sanitizeCredentials, sign, sign, signAndBase64Encode, signWithMac
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.core.signer.Signer
credentialType
-
-
-
-
Field Detail
-
CONTENT_SHA_256_WITH_CHECKSUM
public static final String CONTENT_SHA_256_WITH_CHECKSUM
- See Also:
- Constant Field Values
-
STREAMING_UNSIGNED_PAYLOAD_TRAILER
public static final String STREAMING_UNSIGNED_PAYLOAD_TRAILER
- See Also:
- Constant Field Values
-
-
Method Detail
-
sign
public SdkHttpFullRequest sign(SdkHttpFullRequest request, ExecutionAttributes executionAttributes)
-
sign
public SdkHttpFullRequest sign(SdkHttpFullRequest request, AwsS3V4SignerParams signingParams)
A method to sign the given #request. The parameters required for signing are provided through the modeledAbstractAwsS3V4Signer
class.- Parameters:
request
- The request to signsigningParams
- Class with the parameters used for signing the request- Returns:
- A signed version of the input request
-
presign
public SdkHttpFullRequest presign(SdkHttpFullRequest request, ExecutionAttributes executionAttributes)
-
presign
public SdkHttpFullRequest presign(SdkHttpFullRequest request, Aws4PresignerParams signingParams)
A method to pre sign the given #request. The parameters required for pre signing are provided through the modeledAws4PresignerParams
class.- Parameters:
request
- The request to pre-signsigningParams
- Class with the parameters used for pre signing the request- Returns:
- A pre signed version of the input request
-
processRequestPayload
protected void processRequestPayload(SdkHttpFullRequest.Builder mutableRequest, byte[] signature, byte[] signingKey, Aws4SignerRequestParams signerRequestParams, AwsS3V4SignerParams signerParams)
If necessary, creates a chunk-encoding wrapper on the request payload.- Specified by:
processRequestPayload
in classAbstractAws4Signer<AwsS3V4SignerParams,Aws4PresignerParams>
-
processRequestPayload
protected void processRequestPayload(SdkHttpFullRequest.Builder mutableRequest, byte[] signature, byte[] signingKey, Aws4SignerRequestParams signerRequestParams, AwsS3V4SignerParams signerParams, SdkChecksum sdkChecksum)
Overloads processRequestPayload with sdkChecksum. Flexible Checksum for Payload is calculated if sdkChecksum is passed.- Specified by:
processRequestPayload
in classAbstractAws4Signer<AwsS3V4SignerParams,Aws4PresignerParams>
-
calculateContentHashPresign
protected String calculateContentHashPresign(SdkHttpFullRequest.Builder mutableRequest, Aws4PresignerParams signerParams)
- Specified by:
calculateContentHashPresign
in classAbstractAws4Signer<AwsS3V4SignerParams,Aws4PresignerParams>
-
calculateContentHash
protected String calculateContentHash(SdkHttpFullRequest.Builder mutableRequest, AwsS3V4SignerParams signerParams)
Returns the pre-defined header value and set other necessary headers if the request needs to be chunk-encoded. Otherwise calls the superclass method which calculates the hash of the whole content for signing.- Overrides:
calculateContentHash
in classAbstractAws4Signer<AwsS3V4SignerParams,Aws4PresignerParams>
-
calculateContentHash
protected String calculateContentHash(SdkHttpFullRequest.Builder mutableRequest, AwsS3V4SignerParams signerParams, SdkChecksum contentFlexibleChecksum)
This method overloads calculateContentHash with contentFlexibleChecksum. The contentFlexibleChecksum is computed at the same time while hash is calculated for Content.- Overrides:
calculateContentHash
in classAbstractAws4Signer<AwsS3V4SignerParams,Aws4PresignerParams>
-
getChecksumTrailerLength
public static long getChecksumTrailerLength(AwsS3V4SignerParams signerParams)
-
-