We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From #18455 (comment)
Version: Deno 2
Running this code:
import { generateKeyPairSync } from "node:crypto"; const passphrase = "mypassphrase"; const cipher = "aes-256-cbc"; const modulusLength = 4096; const key = generateKeyPairSync("rsa", { modulusLength, publicKeyEncoding: { type: "spki", format: "pem", }, privateKeyEncoding: { type: "pkcs8", format: "pem", cipher, passphrase, }, }); console.log(key);
Fails on Deno but Node with the following error:
error: Uncaught (in promise) Error: PEM error: PEM Base64 error: invalid Base64 length const key = generateKeyPairSync("rsa", { ^ at PrivateKeyObject.export (ext:deno_node/internal/crypto/keys.ts:454:14) at generateKeyPairSync (ext:deno_node/internal/crypto/keygen.ts:74:37)
Thanks 🙏🏼
The text was updated successfully, but these errors were encountered:
fix(ext/node): compute pem length (upper bound) for key exports
d13b135
Fixes denoland#26188
bbad7c5
littledivy
Successfully merging a pull request may close this issue.
From #18455 (comment)
Version: Deno 2
Running this code:
Fails on Deno but Node with the following error:
error: Uncaught (in promise) Error: PEM error: PEM Base64 error: invalid Base64 length const key = generateKeyPairSync("rsa", { ^ at PrivateKeyObject.export (ext:deno_node/internal/crypto/keys.ts:454:14) at generateKeyPairSync (ext:deno_node/internal/crypto/keygen.ts:74:37)
Thanks 🙏🏼
The text was updated successfully, but these errors were encountered: