public class AWS4Signer extends AbstractAWSSigner implements ServiceAwareSigner, RegionAwareSigner, Presigner, EndpointPrefixAwareSigner, RegionFromEndpointResolverAwareSigner
EMPTY_STRING_SHA256_HEX| Constructor and Description |
|---|
AWS4Signer()
Construct a new AWS4 signer instance.
|
AWS4Signer(boolean doubleUrlEncoding)
Construct a new AWS4 signer instance.
|
AWS4Signer(SdkClock clock) |
| Modifier and Type | Method and Description |
|---|---|
Date |
getOverriddenDate()
Returns a copy of date that overrides the signing date in the request.
|
String |
getRegionName()
Returns the region name that is used when calculating the signature.
|
String |
getServiceName()
Returns the service name that is used when calculating the signature.
|
void |
presignRequest(SignableRequest<?> request,
AWSCredentials credentials,
Date userSpecifiedExpirationDate)
Signs the request by adding the signature to the URL rather than as a
header.
|
void |
setEndpointPrefix(String endpointPrefix)
Sets the endpoint prefix which is used to compute the region that is
used for signing the request.
|
void |
setOverrideDate(Date overriddenDate)
Sets the date that overrides the signing date in the request.
|
void |
setRegionFromEndpointResolver(RegionFromEndpointResolver resolver)
Set the
RegionFromEndpointResolver to use when converting an endpoint into a region. |
void |
setRegionName(String regionName)
Sets the region name that this signer should use when calculating request
signatures.
|
void |
setServiceName(String serviceName)
Sets the service name that this signer should use when calculating
request signatures.
|
void |
sign(SignableRequest<?> request,
AWSCredentials credentials)
Sign the given request with the given set of credentials.
|
hash, hash, sign, signWithMacpublic AWS4Signer()
public AWS4Signer(boolean doubleUrlEncoding)
doubleUrlEncoding - Whether double url-encode the resource path when constructing
the canonical request.public AWS4Signer(SdkClock clock)
public void setServiceName(String serviceName)
setServiceName in interface ServiceAwareSignerserviceName - The service name to use when calculating signatures in this
signer.public void setRegionName(String regionName)
setRegionName in interface RegionAwareSignerregionName - The region name to use when calculating signatures in this
signer.public void setEndpointPrefix(String endpointPrefix)
AWS4SignerRequestParams class which
has the logic to compute region.setEndpointPrefix in interface EndpointPrefixAwareSignerendpointPrefix - The endpoint prefix of the servicepublic void setOverrideDate(Date overriddenDate)
public void setRegionFromEndpointResolver(RegionFromEndpointResolver resolver)
RegionFromEndpointResolverAwareSignerRegionFromEndpointResolver to use when converting an endpoint into a region.setRegionFromEndpointResolver in interface RegionFromEndpointResolverAwareSignerpublic String getRegionName()
public String getServiceName()
public Date getOverriddenDate()
public void sign(SignableRequest<?> request, AWSCredentials credentials)
Signerpublic void presignRequest(SignableRequest<?> request, AWSCredentials credentials, Date userSpecifiedExpirationDate)
PresignerpresignRequest in interface Presignerrequest - The request to sign.credentials - The credentials to sign it with.userSpecifiedExpirationDate - The time when this presigned URL will expire.