Presigner
, RegionAwareSigner
, ServiceAwareSigner
, Signer
AwsS3V4Signer
public class Aws4Signer extends AbstractAwsSigner implements ServiceAwareSigner, RegionAwareSigner, Presigner
EMPTY_STRING_SHA256_HEX
Constructor | Description |
---|---|
Aws4Signer() |
Construct a new AWS4 signer instance.
|
Aws4Signer(boolean doubleUrlEncoding) |
Construct a new AWS4 signer instance.
|
Aws4Signer(SdkClock clock) |
Modifier and Type | Method | Description |
---|---|---|
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.
|
SdkHttpFullRequest |
presignRequest(SdkHttpFullRequest request,
AwsCredentials credentials,
Date userSpecifiedExpirationDate) |
Signs the request by adding the signature to the URL rather than as a
header.
|
void |
setOverrideDate(Date overriddenDate) |
Sets the date that overrides the signing date in the request.
|
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.
|
SdkHttpFullRequest |
sign(SdkHttpFullRequest request,
AwsCredentials credentials) |
Sign the given request with the given set of credentials.
|
hash, hash, sign, signWithMac
public Aws4Signer()
public Aws4Signer(boolean doubleUrlEncoding)
doubleUrlEncoding
- Whether double url-encode the resource path when constructing
the canonical request.public Aws4Signer(SdkClock clock)
public void setOverrideDate(Date overriddenDate)
public String getRegionName()
public void setRegionName(String regionName)
setRegionName
in interface RegionAwareSigner
regionName
- The region name to use when calculating signatures in this
signer.public String getServiceName()
public void setServiceName(String serviceName)
setServiceName
in interface ServiceAwareSigner
serviceName
- The service name to use when calculating signatures in this
signer.public SdkHttpFullRequest sign(SdkHttpFullRequest request, AwsCredentials credentials)
Signer
public SdkHttpFullRequest presignRequest(SdkHttpFullRequest request, AwsCredentials credentials, Date userSpecifiedExpirationDate)
Presigner
presignRequest
in interface Presigner
request
- The request to sign.credentials
- The credentials to sign it with.userSpecifiedExpirationDate
- The time when this presigned URL will expire.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.