You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
createPublicKey Fails with PEM Certificate in Deno but Works in Node.js #25681
When attempting to use createPublicKey from the node:crypto module to parse a PEM certificate in Deno, an error is thrown: TypeError: unsupported PEM label: CERTIFICATE. This issue does not occur in Node.js, where the same code executes without error, correctly creating a PublicKeyObject.
Steps to Reproduce
Create a JavaScript file (e.g., main.mjs) with the following content:
Activity
kt3k commentedon Sep 19, 2024
https://nodejs.org/api/crypto.html#cryptocreatepublickeykey
It looks like
createPublicKeyextracts public key from X509 cert and we don't handle that case.ref: https://github.com/nodejs/node/blob/6031a4bc7cab01623d93e75d17c5b796b5bb831e/src/crypto/crypto_keys.cc#L130
It looks discussed around here: nodejs/node#24234 (comment)
fix(ext/node): support x509 certificates in `createPublicKey`
fix(ext/node): support x509 certificates in `createPublicKey` (denola…