Skip to content

Feature request: Support create public key from components method? #24471

Description

@belldoor

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------// ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    cryptoIssues and PRs related to the crypto subsystem.feature requestIssues that request new features to be added to Node.js.stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions