private static String b64SignHmacSha1 ( final String aAwsSecretKey , final String aCanonicalString ) throws NoSuchAlgorithmException , InvalidKeyException { final SecretKeySpec signingKey = new SecretKeySpec ( aAwsSecretKey . getBytes ( ) , HASH_CODE ) ; final Mac mac = Mac . getInstance ( HASH_CODE ) ; mac . init ( signingKey ) ; return new String ( Base64 . getEncoder ( ) . encode ( mac . doFinal ( aCanonicalString . getBytes ( ) ) ) ) ; }
Returns a Base64 HmacSha1 signature .