I have implemented some PuSH subscription code and usually it works well.
But on about 1% of the pushes I get a signature mismatch, especially with
this feed, http://feeds.feedburner.com/TechCrunch (wordpress). I have had
occasional issues with the google hub also,
e.g. http://looksgoodworkswell.blogspot.com/feeds/posts/default
My code is below (java). It's a bit hard to debug, I captured the content
bytes as a hex string and ran my signature algorithm on it and it matched
what my code was doing, but was different than the value produced by the
hub. Beyond that I am not sure what to try next.
Mac mac = Mac.getInstance("HmacSHA1");
String secret = tokenize(feedUri);
mac.init(new SecretKeySpec(secret.getBytes(), "HmacSHA1"));
byte[] digest = mac.doFinal(payload);
BigInteger hash = new BigInteger(1, digest);
String calcSignature = hash.toString(16);
if ((calcSignature.length() % 2) != 0) {
calcSignature = "0" + calcSignature;
}
return calcSignature;
--
---
You received this message because you are subscribed to the Google Groups
"Pubsubhubbub" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.