Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

297
Views
Generating public private keys from openpgp

I have the following code and I'm trying to generate public-private key:

const openpgp = require("openpgp")
const generateKeyPair = async () => {
const { publicKeyArmored } = await openpgp.generateKey({
    userIds: [
        {
            name: 'Jon Smith', email: 'jon@example.com',
            comment: 'This key is for public sharing'
        }
    ],
    curve: 'ed25519',
    passphrase: 'super long and hard to guess secret',
});

console.log(publicKeyArmored);
}

But I'm getting this error. Any idea how to solve it:

(node:17380) UnhandledPromiseRejectionWarning: Error: Unknown option: userIds
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

publicKeyArmored is not the method of openpgp.generateKey try publicKey.

const openpgp = require("openpgp")
const generateKeyPair = async () => {
    const { publicKey } = await openpgp.generateKey({
        curve: 'ed25519',
        userIDs: [
            {
                name: 'Jon Smith', email: 'jon@example.com',
                comment: 'This key is for public sharing'
            }
        ],
        passphrase: 'super long and hard to guess secret',
    });

    console.log(publicKey);
}

generateKeyPair()

output ----> enter image description here

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!