Skip to content

generateKeyPair return object with empty field #167

Answered by panva
giovanni9793 asked this question in Q&A
Discussion options

You must be logged in to vote

That's expected.

> JSON.stringify(crypto.generateKeyPairSync('ed25519'))
'{"publicKey":{},"privateKey":{}}'
> console.log(crypto.generateKeyPairSync('ed25519').privateKey)
PrivateKeyObject { [Symbol(kKeyType)]: 'private' }

See KeyObject docs.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@giovanni9793
Comment options

@panva
Comment options

@giovanni9793
Comment options

Answer selected by giovanni9793
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants