We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wondering if it's possible to use RSA-SH1 with this library. The example you've provided for request (Node.js) uses HMAC:
var oauth = OAuth({ consumer: { key: 'xvz1evFS4wEEPTGEFPHBog', secret: 'kAcSOqF21Fu85e7zjz7ZN2U4ZRhfV3WpwPAoE3Z7kBw' }, signature_method: 'HMAC-SHA1', hash_function: function(base_string, key) { return crypto.createHmac('sha1', key).update(base_string).digest('base64'); } });
To make it work with RSA, I've tried changing the OAuth.prototype.getSigningKey function to return an RSA private key, and used the following init:
OAuth.prototype.getSigningKey
var oauth = OAuth({ consumer: { key: inputData.consumerKey, secret: inputData.consumerSecret }, signature_method: 'RSA-SHA1', hash_function: function(base_string, key) { var buffer = new Buffer(base_string); var encrypted = crypto.privateEncrypt(key, buffer); return encrypted.toString("base64"); } });
But no luck so far. Just wondering if RSA is possible with this library's code - or am I barking up the wrong tree?
The text was updated successfully, but these errors were encountered:
@rupert-git seems like you doing at the right place. how about this:
const crypto = require('crypto'); const sign = crypto.createSign('RSA-SHA1'); hash_function: function(base_string, key) { sign.write(base_string); sign.end(); return sign.sign(key, 'base64'); }
Sorry, something went wrong.
Thanks @ddo, got an RSA-SH1 request working with your advice :) Much appreciated!
np
No branches or pull requests
Wondering if it's possible to use RSA-SH1 with this library. The example you've provided for request (Node.js) uses HMAC:
To make it work with RSA, I've tried changing the
OAuth.prototype.getSigningKey
function to return an RSA private key, and used the following init:But no luck so far. Just wondering if RSA is possible with this library's code - or am I barking up the wrong tree?
The text was updated successfully, but these errors were encountered: