I have this jwk key that I wanto convert into pem:
const jwkey = {
kty: 'RSA',
kid: 'eecb0ced-4d49-4100-9547-841e4100b756',
n: '...very long string',
e: 'AQAB',
alg: 'RS256',
use: 'sig',
};
I have tried the libraries like jose, node-rsa and jwk-To-Pem but somehow all of them are failing and throws error here and there while configuring.
I literally have no idea how to configure it.
below is the example of node-rsa conversion:
const key = new NodeRSA();
key.importKey(
{
n: Buffer.from(jwkey.n, 'base64'),
e: Buffer.from(jwkey.e, 'base64'),
},
'components'
);
const pem = key.exportKey('pkcs1-private-pem');