Rails 3 - Respuestas de señales con HMAC-SHA256

I am using OpenSSL HMAC SHA256 method to sign all my requests to the server generating a HASH using a private key. My requests look like:
www.myserver.com/url/to/resource?par1=val1&par2=val2&par3=val3&hash=GENERATEDHASH

So my server calculates a hash using the parameters and the same key, if the hashes match he considers that the request is OK.

I want to sign the responses (using a HTTP header maybe) too. My idea is to calculate the hash using the content of the response and add that hash to the header, so my other side can validate that response before processing it.

¿Alguna idea sobre cómo hacer eso?

preguntado el 01 de febrero de 12 a las 14:02

I'm looking to calculate an RFC 2104-compliant HMAC with the SHA256 hash algorithm using a string and a secret key. -

1 Respuestas

You might want to emulate Amazon's way of doing it? http://docs.aws.amazon.com/AWSECommerceService/latest/DG/rest-signature.html

Respondido 14 Feb 13, 23:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.