I am trying to implement an authentication for an API with private & public key.
What I want to do is provide a private key, hash some data with it and send the hash in a header, then rehash the same data again on the server for comparison.
What I'm having trouble with it is, what kind of data should I hash, the request URI, the content type and maybe the content itself, but what when the request is GET and there is no content.
Will hashing any data with the private key will be secure enough, or do I need to do something special?
openssl_sign(), for example.