Closed PhillippOhlandt closed 6 years ago
Seems like this package doesn't handle the export of public keys from a private key. The verify function needs a public key.
Solution:
var NodeRSA = require('node-rsa');
function publicJwk(){
var key = new NodeRSA(pem.toString());
return key.exportKey('pkcs1-public-pem');
}
Hey,
I try to use https://github.com/brianloveswords/node-jws/ to generate and verify a JWT using a PEM certificate.
Here is my code:
When I test it in the console, the signing works, but the verification throws an error:
Here is my certificate:
Anything I do wrong?