Open brandonros opened 8 years ago
Trying to implement Wal-Mart's key signature code.
I have this:
walmart.generate_signature = function (consumer_id, private_key, method, path) { private_key = '-----BEGIN PRIVATE KEY-----\n' + private_key + '\n-----END PRIVATE KEY-----'; var key = ursa.createPrivateKey(new Buffer(private_key)); var signer = ursa.createSigner('SHA256'); var timestamp = (new Date()).getTime(); var str = consumer_id + '\n' + path + '\n' + method + '\n' + timestamp + '\n'; signer.update(str, 'utf8'); return { timestamp: timestamp, hash: signer.sign(key, 'hex') }; };
As you can guess, it isn't right. Any insight?
I'm looking for a new maintainer: https://github.com/quartzjer/ursa#maintainer-needed
Trying to implement Wal-Mart's key signature code.
I have this:
As you can guess, it isn't right. Any insight?