-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.cryptoIssues and PRs related to the crypto subsystem.Issues and PRs related to the crypto subsystem.
Description
- Version: v11.6.0
- Platform: macOS Mojave (10.14.2) Darwin C02TT3JQHTD6 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64 x86_64
From crypto.generateKeyPair documentation
If a
publicKeyEncodingorprivateKeyEncodingwas specified, this function behaves as ifkeyObject.export()had been called on its result. Otherwise, the respective part of the key is returned as aKeyObject.
This documentation part is missing from crypto.generateKeyPairSync but you can still omit the encoding objects, then a simple empty object {} is returned instead of an expected KeyObject.
/cc @tniessen
Examples:
const { generateKeyPairSync } = require('crypto')
console.log('generateKeyPairSync result', generateKeyPairSync('rsa', { modulusLength: 2048 }))
// => generateKeyPairSync result { publicKey: {}, privateKey: {} }Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.cryptoIssues and PRs related to the crypto subsystem.Issues and PRs related to the crypto subsystem.