public class SignOptions extends Object
There are 3 options available:
| Option | Description |
|---|---|
| headersToSign | The set of headers to be signed. If this option is not set or set to null, only the following headers are signed
|
| timestamp | The time when the signature was created. If this option is not set or set to null, the signer will use the time when the sign method is invoked. |
| expirationInSeconds | The time until the signature will expire, which starts from the timestamp. By default, it is set to 1800 (half an hour). The expiration MUST NOT be less than 300 (5 minutes), or greater than 129600 (1.5 days). |
| Modifier and Type | Field and Description |
|---|---|
static SignOptions |
DEFAULT
The default sign options, which is {headersToSign:null, timestamp:null, expirationInSeconds:1800}.
|
static int |
DEFAULT_EXPIRATION_IN_SECONDS |
static int |
DEFAULT_MAX_EXPIRATION_IN_SECONDS |
static int |
DEFAULT_MIN_EXPIRATION_IN_SECONDS |
| Constructor and Description |
|---|
SignOptions() |
| Modifier and Type | Method and Description |
|---|---|
int |
getExpirationInSeconds()
Returns the time until the signature will expire.
|
Set<String> |
getHeadersToSign()
Returns the set of headers to be signed.
|
Date |
getTimestamp()
Returns the time when the signature was created.
|
void |
setExpirationInSeconds(int expirationInSeconds)
Sets the time until the signature will expire.
|
void |
setHeadersToSign(Set<String> headersToSign)
Sets the set of headers to be signed.
|
void |
setTimestamp(Date timestamp)
Sets the time when the signature was created.
|
String |
toString() |
public static final SignOptions DEFAULT
public static final int DEFAULT_EXPIRATION_IN_SECONDS
public static final int DEFAULT_MIN_EXPIRATION_IN_SECONDS
public static final int DEFAULT_MAX_EXPIRATION_IN_SECONDS
public Set<String> getHeadersToSign()
public void setHeadersToSign(Set<String> headersToSign)
headersToSign - the set of headers to be signed.public Date getTimestamp()
public void setTimestamp(Date timestamp)
timestamp - the time when the signature was created.public int getExpirationInSeconds()
public void setExpirationInSeconds(int expirationInSeconds)
expirationInSeconds - The time until the signature will expire.IllegalArgumentException - The expirationInSeconds expected in range [300, 129600].Copyright © 2015. All rights reserved.