Skip to content

Commit

Permalink
Add PQC key generation
Browse files Browse the repository at this point in the history
  • Loading branch information
twiss authored and larabr committed Jun 28, 2024
1 parent 7d95f7c commit 39f8d01
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/key/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ export function sanitizeKeyOptions(options, subkeyDefaults = {}) {
}

switch (options.type) {
case 'pqc':
if (options.sign) {
throw new Error('Post-quantum signing algorithms are not yet supported.');
} else {
options.algorithm = enums.publicKey.pqc_mlkem_x25519;
}
break;
case 'ecc': // NB: this case also handles legacy eddsa and x25519 keys, based on `options.curve`
try {
options.curve = enums.write(enums.curve, options.curve);
Expand Down

0 comments on commit 39f8d01

Please sign in to comment.