-
Notifications
You must be signed in to change notification settings - Fork 15
Add private/public key sign/verify method #6
Comments
Looks like this isn't possible because you have no support for https://github.com/brianloveswords/node-jwa/blob/master/index.js#L151 seems to be what I'm looking to accomplish. |
Thanks @brandonros I'm sorry I have not added support for anything beyond AEADs, HMACs and hashes. Does Node support RSA signing? Is it a matter of performance? There is an issue with Node I opened to improve the performance of Node's sync crypto. If it's sheer low latency you need (not necessarily throughput or hundreds of thousands of signing requests), then faster sync methods (with less C++ roundtrips like how we do it) might help you. |
It does. The signing I am doing is very easy. It is about ~680 bytes. Locally on my MacBook Pro, I get It's just that, with the way the node.js internal crypto library is set up, this blocks the event loop. I get 10x performance if I move the |
Yes, it's critical not to block the event loop, since it's the control plane of everything else.
Without the overhead of IPC and cluster, i.e. running the crypto operations directly in the threadpool from the same process, you should be able to increase that performance substantially. I'm sorry we don't have support for signing. I hope your use-case is one more reason for Node core to get async one-shot signing methods soon. |
Would you be open to consider supporting RSA signing? You already have the sha256 digest component from what I can tell. It looks something like this: |
Nice repo! I'm hoping it'll solve my JWT/JWS signing performance woes in my package.
Would you happen to have an example on how to sign a JWT with RS256?
I have this from the popular
jws
package. Not sure how to recreate that using your crypto instead of node's crypto.The text was updated successfully, but these errors were encountered: