I cannot use ursa anymore at node v10. So I'm trying to move to native crypto.
But the problem is, native crypto seems not support create public key from components.
So, why don't you support create public key from components method?
constursa=require('ursa');// modulus should be a base64/base64Url stringconstmodulus=newBuffer(modulusStr,'base64');// exponent should be base64/base64urlconstexponent=newBuffer('AQAB','base64');constpubKey=ursa.createPublicKeyFromComponents(modulus,exponent);console.info(pubKey.toPublicPem('utf8'));// ------BEGIN PUBLIC KEY------// ...constnodeRSA=require('node-rsa');constkey=newnodeRSA();constmodulus=newBuffer(modulusStr,'base64');constexponent=newBuffer('AQAB','base64');constpubKey=key.importKey({n: modulus,e: exponent},'components-public');console.info(pubKey.exportKey('pkcs8-public-pem'));// ------BEGIN PUBLIC KEY------// ...
I cannot use
ursaanymore at node v10. So I'm trying to move to native crypto.But the problem is, native crypto seems not support create public key from components.
So, why don't you support create public key from components method?