Skip to content

Commit

Permalink
chore: refactor keys generator command
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Nov 8, 2024
1 parent 922402b commit 865c649
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/commands/generate/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export default class extends Command {
"default": "P-256",
"schema": { "enum": [ "P-256" ] },
},
"prime-length": {
"description": `Prime length in bits (dh).`,
"default": 2048,
"schema": { "type": "integer", "minimum": 2048 },
},
"copy": {
"description": `copy PEM to the clipboard`,
"default": false,
Expand All @@ -38,6 +43,7 @@ export default class extends Command {
const keyPair = crypto.generateKeyPairSync( process.cli.options.type, {
"modulusLength": process.cli.options.size,
"namedCurve": process.cli.options[ "ec-name" ],
"primeLength": process.cli.options[ "prime-length" ],
} );

const privateKey = keyPair.privateKey.export( {
Expand Down

0 comments on commit 865c649

Please sign in to comment.