Class S3Signer

  • Direct Known Subclasses:
    S3SignerV2, S3SignerV4

    public abstract class S3Signer
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.slf4j.Logger log  
      protected S3Config s3Config  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.net.URL generatePresignedUrl​(PresignedUrlRequest request)
      Generate presigned URL and then return the URL
      protected abstract 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 abstract 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 String
      protected abstract java.lang.String getSignature​(java.lang.String stringToSign, byte[] signingKey)
      Get the signature as String, singingKey is only needed for v4 signer
      protected static byte[] hash256​(java.lang.String stringToHash)  
      protected static java.lang.String hexEncode​(byte[] arg)  
      protected byte[] hmac​(java.lang.String algorithm, byte[] secretKey, java.lang.String message)  
      abstract 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
      protected java.lang.String trimAndJoin​(java.util.List<java.lang.Object> values, java.lang.String delimiter)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • log

        protected static final org.slf4j.Logger log
    • Method Detail

      • sign

        public abstract 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
      • getSignature

        protected abstract java.lang.String getSignature​(java.lang.String stringToSign,
                                                         byte[] signingKey)
        Get the signature as String, singingKey is only needed for v4 signer
      • getDate

        protected abstract 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 String
      • generatePresignedUrl

        public abstract java.net.URL generatePresignedUrl​(PresignedUrlRequest request)
        Generate presigned URL and then return the URL
      • getCanonicalizedHeaders

        protected abstract 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)
      • hmac

        protected byte[] hmac​(java.lang.String algorithm,
                              byte[] secretKey,
                              java.lang.String message)
      • hash256

        protected static byte[] hash256​(java.lang.String stringToHash)
      • hexEncode

        protected static java.lang.String hexEncode​(byte[] arg)
      • trimAndJoin

        protected java.lang.String trimAndJoin​(java.util.List<java.lang.Object> values,
                                               java.lang.String delimiter)