public class RequestSignerImpl extends Object implements RequestSigner
Implementation of the RequestSigner interface
This contains the main code that is used for signing a request
Class is immutable. @Immutable
Modifier and Type | Class and Description |
---|---|
static class |
RequestSignerImpl.SigningConfiguration
Basic configuration of what headers to sign.
|
Constructor and Description |
---|
RequestSignerImpl(KeySupplier<RSAPrivateKey> keySupplier,
RequestSignerImpl.SigningConfiguration signingConfiguration,
Supplier<String> keyIdSupplier)
Construct the RequestSigner with the specified KeySupplier.
|
RequestSignerImpl(KeySupplier<RSAPrivateKey> keySupplier,
SigningStrategy signingStrategy,
Supplier<String> keyIdSupplier)
Construct the RequestSigner with the specified KeySupplier.
|
Modifier and Type | Method and Description |
---|---|
static Map<String,String> |
signRequest(Algorithm algorithm,
URI uri,
String httpMethod,
Map<String,List<String>> headers,
Object body,
String versionName,
String keyId,
KeySupplier<RSAPrivateKey> keySupplier,
RequestSignerImpl.SigningConfiguration signingConfiguration) |
Map<String,String> |
signRequest(URI uri,
String httpMethod,
Map<String,List<String>> headers,
Object body)
Sign a request.
|
public RequestSignerImpl(@Nonnull KeySupplier<RSAPrivateKey> keySupplier, @Nonnull SigningStrategy signingStrategy, @Nonnull Supplier<String> keyIdSupplier)
Construct the RequestSigner with the specified KeySupplier. This will be used to get keys for doing the signing.
keySupplier
- A key supplier that will be used for signing the requestsigningStrategy
- The signing strategy to determine what headers to usekeyIdSupplier
- A keyId supplier that will be used for signing the requestpublic RequestSignerImpl(@Nonnull KeySupplier<RSAPrivateKey> keySupplier, @Nonnull RequestSignerImpl.SigningConfiguration signingConfiguration, @Nonnull Supplier<String> keyIdSupplier)
Construct the RequestSigner with the specified KeySupplier. This will be used to get keys for doing the signing.
keySupplier
- A key supplier that will be used for signing the requestsigningConfiguration
- The signing configuration to determine what headers to usekeyIdSupplier
- A keyId supplier that will be used for signing the requestpublic Map<String,String> signRequest(@Nonnull URI uri, @Nonnull String httpMethod, @Nonnull Map<String,List<String>> headers, @Nullable Object body)
RequestSigner
Sign a request.
signRequest
in interface RequestSigner
uri
- the request urihttpMethod
- the request methodheaders
- the request headersbody
- the request body (if this is a PUT or POST method)Authorization
header, and any headers
that were signed when generating the signature. You MUST include the exact values of the
returned headers when making requests.Copyright © 2016–2024. All rights reserved.