public class AWSSignedRequestsHelper extends Object
Modifier and Type | Field and Description |
---|---|
protected Calendar |
calendar |
protected DateFormat |
dateFormat |
Constructor and Description |
---|
AWSSignedRequestsHelper(String awsSecretKey)
Constructor
|
Modifier and Type | Method and Description |
---|---|
String |
generateCanonicalQuery(Map<String,String> params,
String awsAccessKeyId) |
static Map<String,String> |
queryStringToMap(URLEncoding encoding,
String queryString)
Converts a query string to a (sorted) Map
|
void |
setDate(Date date)
Use with extreme caution, mainly for unit tests
|
String |
sign(Map<String,String> params,
String awsAccessKeyId,
String method)
Sign using the default AWS.ENDPOINT, AWS.REQUEST_URI
|
String |
sign(Map<String,String> params,
String awsAccessKeyId,
String method,
String endpoint,
String uri)
Signs a request
|
String |
timestamp() |
protected Calendar calendar
protected DateFormat dateFormat
public AWSSignedRequestsHelper(String awsSecretKey) throws GeneralSecurityException
awsSecretKey
- GeneralSecurityException
UnsupportedEncodingException
public String sign(Map<String,String> params, String awsAccessKeyId, String method, String endpoint, String uri)
params
- awsAccessKeyId
- if null, you have already added it and the timestamp manuallypublic String sign(Map<String,String> params, String awsAccessKeyId, String method)
params
- awsAccessKeyId
- method
- public String generateCanonicalQuery(Map<String,String> params, String awsAccessKeyId)
public void setDate(Date date)
date
- non-nullpublic static Map<String,String> queryStringToMap(URLEncoding encoding, String queryString)
encoding
- queryString
- public String timestamp()