I'm desperatly trying to handle EdDSA / ed25519 private key in any library.
Most of them accept only PKCS8 format, while sshpk handle only PKCS1
Even node crypto can't import it :
const crypto = require('crypto')
const sshpk = require('sshpk')
const privkey = sshpk.generatePrivateKey('ed25519')
privkey.toBuffer('pkcs8')
// Error: Ed25519 private keys in pkcs8 format are not supported
const privkeyObj = crypto.createPrivateKey({
key: privkey.toBuffer('pem'),
format: 'pem',
})
// Error: error:0909006C:PEM routines:get_name:no start line
const privkeyObj = crypto.createPrivateKey({
key: privkey.toBuffer('pkcs1'),
format: 'der',
type: 'pkcs1'
})
// Error: error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag
Tried on node v12, v16, v17.
Thanks for help
I'm desperatly trying to handle EdDSA / ed25519 private key in any library.
Most of them accept only PKCS8 format, while sshpk handle only PKCS1
Even node crypto can't import it :
Tried on node v12, v16, v17.
Thanks for help