Retrieve 32 byte public key from curve25519 key #1686
-
I am having trouble with openpgp's key generation. What am I doing wrong? How can I retrieve my public key of length 32? const openpgpKey = await openpgp.generateKey({
type: 'ecc', // Type of the key, defaults to ECC
curve: 'curve25519', // ECC curve name, defaults to curve25519
userIDs: [{ name: 'Jon Smith', email: 'jon@example.com' }], // you can pass multiple user IDss
format: 'binary' // output key format, defaults to 'armored' (other options: 'binary' or 'object')
});
const openpgpPublicKey = (await openpgp.readKey({ binaryKey: openpgpKey.publicKey })).keyPacket
.publicParams.Q;
// Prints: Uint8Array(33)
console.log(openpgpPublicKey);
// Prints: Uint8Array(404)
console.log(openpgpKey.publicKey); Or in a more general sense, I am wondering about this for both private AND public keys, as I would expect both to have length 32 (as stated here: openssl/openssl#6357 (comment)) So how can I use openpgpjs to retrieve private and public keys of the expected size? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think I found my answer: #1245 |
Beta Was this translation helpful? Give feedback.
I think I found my answer: #1245