kypeli/kQOAuth — pull request #10 by nickygerritsen (2014-01-22 13:43:47+00:00)
Title: Add support for RSA-SHA1 signatures

Although the library did suggest (in the code) supporting RSA-SHA1 signatures, it did not.
Because I needed it, I have added code to do so.

What I have done:
* Added `signatureMethod` to the OAuthManager, so we can send it with opaque requests
* Added some code to the OAuthRequest class to call the RSA generate function
* Added `requestSignatureMethodForManager()` to the OuathRequest, so it can be used by the manager
* Updated the .pro to link against the ssl and crypto libraries (note I tested it on Mac OS X. It can be the case library paths are not correct on Linux or Windows. Could anyone check?)
* Added a RSA-SHA1 generate function to `KQOAuthUtils`. Note that my knowledge of OpenSSL is not that advanced, so I was unable to directly read in a DER format.

To use it, add:
```C++
oauthRequest->setSignatureMethod(KQOAuthRequest::RSA_SHA1);
```
To all requests. The consumer secret key should be the contents of your RSA private file, as generated by openssl.
I used a define for this:

```C++
#define SECRET_KEY "-----BEGIN RSA PRIVATE KEY-----\n" \
"MIIC…….ekH\n" \
"eAo….MoG\n" \
"….." \
"0Gx….aPaJA==\n" \
"-----END RSA PRIVATE KEY-----\n"
```

I hope this will help other people too!