Class AwsSigner


  • public class AwsSigner
    extends java.lang.Object
    Static class for a variety of AWS signing APIs.
    • Constructor Detail

      • AwsSigner

        public AwsSigner()
    • Method Detail

      • signRequest

        public static java.util.concurrent.CompletableFuture<HttpRequest> signRequest​(HttpRequest request,
                                                                                      AwsSigningConfig config)
        Signs an http request according to the supplied signing configuration
        Parameters:
        request - http request to sign
        config - signing configuration
        Returns:
        future which will contain the signed request
      • signChunk

        public static java.util.concurrent.CompletableFuture<byte[]> signChunk​(HttpRequestBodyStream chunkBody,
                                                                               byte[] previousSignature,
                                                                               AwsSigningConfig config)
        Signs a body chunk according to the supplied signing configuration
        Parameters:
        chunkBody - stream of bytes that make up the chunk
        previousSignature - the signature of the previous component of the request: either the request itself for the first chunk, or the previous chunk otherwise
        config - signing configuration
        Returns:
        future which will contain the signature of the chunk. The signature *MUST* be written directly into the chunk metadata.
      • sign

        public static java.util.concurrent.CompletableFuture<AwsSigningResult> sign​(HttpRequest request,
                                                                                    AwsSigningConfig config)
        Signs an http request according to the supplied signing configuration
        Parameters:
        request - http request to sign
        config - signing configuration
        Returns:
        future which will contain a signing result, which provides easier access to all signing-related result properties
      • sign

        public static java.util.concurrent.CompletableFuture<AwsSigningResult> sign​(HttpRequestBodyStream chunkBody,
                                                                                    byte[] previousSignature,
                                                                                    AwsSigningConfig config)
        Signs a body chunk according to the supplied signing configuration
        Parameters:
        chunkBody - stream of bytes that make up the chunk
        previousSignature - the signature of the previous component of the request: either the request itself for the first chunk, or the previous chunk otherwise
        config - signing configuration
        Returns:
        future which will contain a signing result, which provides easier access to all signing-related result properties
      • sign

        public static java.util.concurrent.CompletableFuture<AwsSigningResult> sign​(java.util.List<HttpHeader> headers,
                                                                                    byte[] previousSignature,
                                                                                    AwsSigningConfig config)
        Signs a body chunk according to the supplied signing configuration
        Parameters:
        headers - list of headers to be sent in the trailer.
        previousSignature - the signature of the previous component of the request: either the request itself for the first chunk, or the previous chunk otherwise
        config - signing configuration
        Returns:
        future which will contain a signing result, which provides easier access to all signing-related result properties