I’m following this example to test signing my URLs in Java:
I’m using the URL, appSID, and key specified in the example and running the same function:
String url = “**http://api.saaspose.com/storage/folder/test_folder?appSID=c821f123-1a8b-4b97-925a-9d69a6b2fcd8**”;
String key = “**23e9d89a967a5f18142221fa8f7cbcd0**”;
byte[] keyBytes = key.getBytes();
SecretKeySpec signingKey = new SecretKeySpec(keyBytes, "HmacSHA1");
Mac mac = Mac.getInstance("HmacSHA1");
mac.init(signingKey);
byte[] hexBytes = new Hex().encode(rawHmac);
String result = new String(hexBytes, "UTF-8");
At this point, the example says the result should be Z98TBrlwdtx3pTa6fWVD/Q0c2dE= but I am getting 67df1306b97076dc77a536ba7d6543fd0d1cd9d1
Obviously I need this to be correct before I can start using Saaspose. What is wrong?