public class Signer extends Object
Modifier and Type | Method and Description |
---|---|
static String |
credential(String accessKey,
ZonedDateTime date,
String region)
Returns credential string of given access key, date and region.
|
static String |
getChunkSignature(String chunkSha256,
ZonedDateTime date,
String region,
String secretKey,
String prevSignature)
Returns chunk signature calculated using given arguments.
|
static String |
postPresignV4(String stringToSign,
String secretKey,
ZonedDateTime date,
String region)
Returns pre-signed post policy string for given stringToSign, secret key, date and region.
|
static okhttp3.HttpUrl |
presignV4(okhttp3.Request request,
String region,
String accessKey,
String secretKey,
int expires)
Returns pre-signed HttpUrl object for given request, region, access key, secret key and expires
time.
|
static okhttp3.Request |
signV4S3(okhttp3.Request request,
String region,
String accessKey,
String secretKey,
String contentSha256)
Returns signed request of given request for S3 service.
|
static okhttp3.Request |
signV4Sts(okhttp3.Request request,
String region,
String accessKey,
String secretKey,
String contentSha256)
Returns signed request of given request for STS service.
|
static byte[] |
sumHmac(byte[] key,
byte[] data)
Returns HMacSHA256 digest of given key and data.
|
public static String getChunkSignature(String chunkSha256, ZonedDateTime date, String region, String secretKey, String prevSignature) throws NoSuchAlgorithmException, InvalidKeyException
public static okhttp3.Request signV4S3(okhttp3.Request request, String region, String accessKey, String secretKey, String contentSha256) throws NoSuchAlgorithmException, InvalidKeyException
public static okhttp3.Request signV4Sts(okhttp3.Request request, String region, String accessKey, String secretKey, String contentSha256) throws NoSuchAlgorithmException, InvalidKeyException
public static okhttp3.HttpUrl presignV4(okhttp3.Request request, String region, String accessKey, String secretKey, int expires) throws NoSuchAlgorithmException, InvalidKeyException
public static String credential(String accessKey, ZonedDateTime date, String region)
public static String postPresignV4(String stringToSign, String secretKey, ZonedDateTime date, String region) throws NoSuchAlgorithmException, InvalidKeyException
public static byte[] sumHmac(byte[] key, byte[] data) throws NoSuchAlgorithmException, InvalidKeyException