Package com.emc.object.s3
Class S3SignerV4
- java.lang.Object
-
- com.emc.object.s3.S3Signer
-
- com.emc.object.s3.S3SignerV4
-
public class S3SignerV4 extends S3Signer
-
-
Constructor Summary
Constructors Constructor Description S3SignerV4(S3Config s3Config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addHeadersForV4(java.net.URI uri, java.lang.String date, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> headers)
java.net.URL
generatePresignedUrl(PresignedUrlRequest request)
Generate presigned URL and then return the URLprotected java.util.SortedMap<java.lang.String,java.lang.String>
getCanonicalizedHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> headers, java.util.Map<java.lang.String,java.lang.String> parameters)
protected java.lang.String
getCanonicalRequest(java.lang.String method, java.net.URI uri, java.util.Map<java.lang.String,java.lang.String> parameters, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> headers, java.lang.Boolean isForPresignedUrl)
protected java.lang.String
getDate(java.util.Map<java.lang.String,java.lang.String> parameters, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> headers)
Get the date as Stringprotected java.lang.String
getScope(java.lang.String shortDate, java.lang.String service)
protected java.lang.String
getServiceType()
protected java.lang.String
getShortDate(java.lang.String date)
protected java.lang.String
getSignature(java.lang.String stringToSign, byte[] signingKey)
Get the signature as String, singingKey is only needed for v4 signerprotected byte[]
getSigningKey(java.lang.String date, java.lang.String service)
protected java.lang.String
getStringToSign(java.lang.String method, java.lang.String resource, java.util.Map<java.lang.String,java.lang.String> parameters, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> headers, java.lang.String date, java.lang.String service, java.lang.String canonicalRequest)
void
sign(com.sun.jersey.api.client.ClientRequest request, java.lang.String resource, java.util.Map<java.lang.String,java.lang.String> parameters, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> headers)
Sign the request-
Methods inherited from class com.emc.object.s3.S3Signer
hash256, hexEncode, hmac, trimAndJoin
-
-
-
-
Constructor Detail
-
S3SignerV4
public S3SignerV4(S3Config s3Config)
-
-
Method Detail
-
sign
public void sign(com.sun.jersey.api.client.ClientRequest request, java.lang.String resource, java.util.Map<java.lang.String,java.lang.String> parameters, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> headers)
Description copied from class:S3Signer
Sign the request
-
addHeadersForV4
protected void addHeadersForV4(java.net.URI uri, java.lang.String date, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> headers)
-
getCanonicalRequest
protected java.lang.String getCanonicalRequest(java.lang.String method, java.net.URI uri, java.util.Map<java.lang.String,java.lang.String> parameters, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> headers, java.lang.Boolean isForPresignedUrl)
-
getCanonicalizedHeaders
protected java.util.SortedMap<java.lang.String,java.lang.String> getCanonicalizedHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> headers, java.util.Map<java.lang.String,java.lang.String> parameters)
- Specified by:
getCanonicalizedHeaders
in classS3Signer
-
getStringToSign
protected java.lang.String getStringToSign(java.lang.String method, java.lang.String resource, java.util.Map<java.lang.String,java.lang.String> parameters, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> headers, java.lang.String date, java.lang.String service, java.lang.String canonicalRequest)
-
getSigningKey
protected byte[] getSigningKey(java.lang.String date, java.lang.String service)
-
getDate
protected java.lang.String getDate(java.util.Map<java.lang.String,java.lang.String> parameters, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> headers)
Description copied from class:S3Signer
Get the date as String
-
getShortDate
protected java.lang.String getShortDate(java.lang.String date)
-
getScope
protected java.lang.String getScope(java.lang.String shortDate, java.lang.String service)
-
getSignature
protected java.lang.String getSignature(java.lang.String stringToSign, byte[] signingKey)
Description copied from class:S3Signer
Get the signature as String, singingKey is only needed for v4 signer- Specified by:
getSignature
in classS3Signer
-
getServiceType
protected java.lang.String getServiceType()
-
generatePresignedUrl
public java.net.URL generatePresignedUrl(PresignedUrlRequest request)
Description copied from class:S3Signer
Generate presigned URL and then return the URL- Specified by:
generatePresignedUrl
in classS3Signer
-
-