From d71afbea4a0ed207a4c7d6959cd04cd568d9130f Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Sun, 5 Nov 2023 11:23:36 +0100 Subject: [PATCH] Add PQC key generation --- src/key/helper.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/key/helper.js b/src/key/helper.js index 704ccc1942..b8f910f0b7 100644 --- a/src/key/helper.js +++ b/src/key/helper.js @@ -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);