Interface Checksummer
- All Known Implementing Classes:
- FlexibleChecksummer,- PrecomputedSha256Checksummer
An interface for defining how a checksum is formed from a payload synchronously and asynchronously.
 
The implementation may choose to also manipulate the request with the checksum, such as adding it as a header. Note: Currently, checksummers set the X_AMZ_CONTENT_SHA256 header for all requests. It is not strictly required to add the headers to all AWS requests - it's required for S3 and a couple of other select use cases. The pre-SRA implementation has a stricter set of rules for when to add the header. Being more restrictive with adding the header would require restructuring the signer / checksummer design.
- 
Method SummaryModifier and TypeMethodDescriptionCompletableFuture<org.reactivestreams.Publisher<ByteBuffer>> checksum(org.reactivestreams.Publisher<ByteBuffer> payload, SdkHttpRequest.Builder request) Given a payload, asynchronously calculate a checksum and promise to add it to the request.voidchecksum(ContentStreamProvider payload, SdkHttpRequest.Builder request) Given a payload, calculate a checksum and add it to the request.static Checksummercreate()Get a default implementation of a checksummer, which calculates the SHA-256 checksum and places it in the x-amz-content-sha256 header.static ChecksummerforFlexibleChecksum(String precomputedSha256, ChecksumAlgorithm checksumAlgorithm, PayloadChecksumStore cache) Get a flexible checksummer that performs two checksums: the given checksum-algorithm and a precomputed checksum from the given checksum string.static ChecksummerforFlexibleChecksum(ChecksumAlgorithm checksumAlgorithm, PayloadChecksumStore cache) Get a flexible checksummer that performs two checksums: the given checksum-algorithm and the SHA-256 checksum.static ChecksummerforNoOp()static ChecksummerforPrecomputed256Checksum(String precomputedSha256) Get a precomputed checksummer which places the precomputed checksum to the x-amz-content-sha256 header.
- 
Method Details- 
createGet a default implementation of a checksummer, which calculates the SHA-256 checksum and places it in the x-amz-content-sha256 header.
- 
forFlexibleChecksumstatic Checksummer forFlexibleChecksum(ChecksumAlgorithm checksumAlgorithm, PayloadChecksumStore cache) Get a flexible checksummer that performs two checksums: the given checksum-algorithm and the SHA-256 checksum. It places the SHA-256 checksum in x-amz-content-sha256 header, and the given checksum-algorithm in the x-amz-checksum-[name] header.
- 
forPrecomputed256ChecksumGet a precomputed checksummer which places the precomputed checksum to the x-amz-content-sha256 header.
- 
forFlexibleChecksumstatic Checksummer forFlexibleChecksum(String precomputedSha256, ChecksumAlgorithm checksumAlgorithm, PayloadChecksumStore cache) Get a flexible checksummer that performs two checksums: the given checksum-algorithm and a precomputed checksum from the given checksum string. It places the precomputed checksum in x-amz-content-sha256 header, and the given checksum-algorithm in the x-amz-checksum-[name] header.
- 
forNoOp
- 
checksumGiven a payload, calculate a checksum and add it to the request.
- 
checksumCompletableFuture<org.reactivestreams.Publisher<ByteBuffer>> checksum(org.reactivestreams.Publisher<ByteBuffer> payload, SdkHttpRequest.Builder request) Given a payload, asynchronously calculate a checksum and promise to add it to the request.
 
-