thephpleague / oauth1-client

OAuth 1 Client
MIT License
968 stars 73 forks source link

RSA-SHA1 signatures #79

Closed jaredk2g closed 7 years ago

jaredk2g commented 7 years ago

This PR adds support for RSA-SHA1 signatures. I needed this while building the Xero extension and thought it would be a nice addition to the core client library.

It can be used by providing RsaClientCredentials and RsaSha1Signature objects to the server constructor, or by passing in rsa_public_key and rsa_private_key configuration options like this:

$server = new Server([
    'identifier' => 'app_key',
    'secret' => 'secret',
    'callback_uri' => 'https://example.com/callback',
    'rsa_public_key' => __DIR__.'/test_rsa_publickey.pem',
    'rsa_private_key' => __DIR__.'/test_rsa_privatekey.pem',
]);

What are everyone's thoughts on this?

bencorlett commented 7 years ago

This is awesome! Thank you very much!