generateKeyPair return object with empty field #167
Answered
by
panva
giovanni9793
asked this question in
Q&A
-
I don't know if I'm doing something wrong, but the function generateKeyPair does not work for me, but it seems a problem with crypto because also the following code return the same object: import generateKeyPair from 'crypto'
import { promisify } from 'util'
const keys = promisify(generateKeyPair.generateKeyPair)
console.log(
JSON.stringify(
await keys('rsa', {
modulusLength: 2048,
publicExponent: 0x10001,
}),
),
) output: {"publicKey":{},"privateKey":{}} The code was runned on a docker machine with node 14. |
Beta Was this translation helpful? Give feedback.
Answered by
panva
Mar 10, 2021
Replies: 1 comment 3 replies
-
That's expected.
See KeyObject docs. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
giovanni9793
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's expected.
See KeyObject docs.