Signature Calculation

Javascript:

var timestamp = ''+(new Date()).getTime();
var secret = 'secret';
var encrypted = CryptoJS.HmacSHA1(timestamp, secret); 
encrypted = CryptoJS.enc.Base64.stringify(encrypted);

Java:

String timestamp = ""+System.currentTimeMillis(); 
String secret = "secret"
SecretKeySpec secretKeySpec = new SecretKeySpec(secret.getBytes(), "HmacSHA1"); 
Mac mac = Mac.getInstance("HmacSHA1");
mac.init(secretKeySpec);
String encrypted = Base64.getEncoder().encodeToString(mac.doFinal(timestamp.getBytes("UTF-8")));