@Immutable public final class V4CanonicalRequest extends Object
https://docs.aws.amazon.com/IAM/latest/UserGuide/create-signed-request.html#create-canonical-request
| Modifier and Type | Class and Description |
|---|---|
static class |
V4CanonicalRequest.Options
A class for representing options used when creating a
V4CanonicalRequest |
| Constructor and Description |
|---|
V4CanonicalRequest(SdkHttpRequest request,
String contentHash,
V4CanonicalRequest.Options options)
Create a canonical request.
|
| Modifier and Type | Method and Description |
|---|---|
static List<Pair<String,List<String>>> |
getCanonicalHeaders(Map<String,List<String>> headers)
Get the list of headers that are to be signed.
|
static List<Pair<String,List<String>>> |
getCanonicalHeaders(SdkHttpRequest request)
Get the list of headers that are to be signed.
|
static String |
getCanonicalHeadersString(List<Pair<String,List<String>>> canonicalHeaders)
Get the string representing the headers that will be signed and their values.
|
String |
getCanonicalRequestString()
Get the canonical request string.
|
String |
getSignedHeadersString()
Get the string representing which headers are part of the signing process.
|
static String |
getSignedHeadersString(List<Pair<String,List<String>>> canonicalHeaders)
Get the string representing which headers are part of the signing process.
|
public V4CanonicalRequest(SdkHttpRequest request, String contentHash, V4CanonicalRequest.Options options)
Each parameter of a canonical request is set upon creation of this object.
To get such a parameter (i.e. the canonical request string), simply call the getter for that parameter (i.e. getCanonicalRequestString())
public String getSignedHeadersString()
public String getCanonicalRequestString()
public static List<Pair<String,List<String>>> getCanonicalHeaders(SdkHttpRequest request)
If calling from a site with the request object handy, this method should be used instead of passing the headers themselves, as doing so creates a redundant copy.
public static List<Pair<String,List<String>>> getCanonicalHeaders(Map<String,List<String>> headers)
public static String getCanonicalHeadersString(List<Pair<String,List<String>>> canonicalHeaders)
The output string will have header names as lower-case, sorted in alphabetical order, and followed by a colon.
Values are trimmed of any leading/trailing spaces, sequential spaces are converted to single space, and multiple values are comma separated.
Each header-value pair is separated by a newline.
Copyright © 2023. All rights reserved.