Permalink
Browse files

authentication signature fixed

  • Loading branch information...
stephan
stephan committed Oct 16, 2010
1 parent 1655523 commit 0eaaa8f5f1b9e5183acc1923a6c85fff8792e55a
Showing with 3 additions and 3 deletions.
  1. +3 −3 Pusher.java
View
@@ -66,7 +66,7 @@ private static String byteArrayToString(byte[] data){
}
return hash;
}
-
+
/**
* Returns a md5 representation of the given string
* @param data
@@ -97,7 +97,7 @@ private static String hmacsha256Representation(String data) {
// Create the HMAC/SHA256 key from application secret
final SecretKeySpec signingKey = new SecretKeySpec( pusherApplicationSecret.getBytes(), "HmacSHA256");
- // Create the message authentication code (MAC)
+ // Create the message authentication code (MAC)
final Mac mac = Mac.getInstance("HmacSHA256");
mac.init(signingKey);
@@ -106,7 +106,7 @@ private static String hmacsha256Representation(String data) {
digest = mac.doFinal(data.getBytes());
//Convert to string
BigInteger bigInteger = new BigInteger(1,digest);
- return String.format("%0" + (digest.length << 1) + "x", bigInteger);
+ return String.format("%0" + (digest.length << 1) + "x", bigInteger);
} catch (NoSuchAlgorithmException nsae) {
//We should never come here, because GAE has HMac SHA256
throw new RuntimeException("No HMac SHA256 algorithm");

0 comments on commit 0eaaa8f

Please sign in to comment.