twilio/twilio-java — pull request #93 by chrismerris (2013-07-18 22:50:50+00:00)
Title: Allow library users to retrieve the hashed "X-Twilio-Signature" from TwilioUtils Library

I added a method "getValidationSignature" to the TwilioUtils class and re-routed the validateRequest to use it (i.e. moved the old logic into the new method). I also moved all exception handling into the new method, which will return null in these cases (and validateRequest will return false if getValidationSignature returns null).

This new method could be renamed to something else depending on your preference. The purpose is to return the hashed signature string.

We needed to know this string at my company in order to create a mock request for integration testing, and we resorted to cutting and pasting the logic from validateRequest for the time being.

It would be better housed in a method for our usage, especially if the hashing algorithm changes in the future.

Thanks and keep up the great work!