Class AuthUtils


  • public abstract class AuthUtils
    extends Object
    • Method Detail

      • generateHex

        protected static String generateHex​(String data)
        Generate Hex code of String.
        Parameters:
        data -
        Returns:
      • bytesToHex

        protected static String bytesToHex​(byte[] bytes)
        Convert byte array to Hex. This method is kept here to facilitate the unit test
        Parameters:
        bytes -
        Returns:
      • HmacSHA256

        protected static byte[] HmacSHA256​(byte[] key,
                                           String data)
                                    throws Exception
        Apply HmacSHA256 on data using given key.
        Parameters:
        data -
        key -
        Returns:
        Throws:
        Exception
      • getSignatureKey

        protected static byte[] getSignatureKey​(String key,
                                                String date,
                                                String regionName,
                                                String serviceName)
                                         throws Exception
        Generate AWS signature key.
        Parameters:
        key -
        date -
        regionName -
        serviceName -
        Returns:
        Throws:
        Exception
      • getTimestamp

        protected static String getTimestamp​(Date date)
        Get timestamp. yyyyMMdd'T'HHmmss'Z'
        Returns: