From dc034a4ac9fb91ebf37445cf4b5a05719abc76c1 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Fri, 13 Mar 2026 22:22:20 +0100 Subject: [PATCH] crypto: reject ML-KEM/ML-DSA PKCS#8 import without seed in SubtleCrypto Reject importing ML-KEM and ML-DSA PKCS#8 private keys that do not include a seed, throwing NotSupportedError. Also add tests for importing PKCS#8 keys with a mismatched expanded key. Refs: https://redirect.github.com/WICG/webcrypto-modern-algos/pull/34 PR-URL: https://github.com/nodejs/node/pull/62218 Reviewed-By: Yagiz Nizipli Reviewed-By: Mattias Buelens --- doc/api/webcrypto.md | 4 ++ lib/internal/crypto/ml_dsa.js | 13 ++++ lib/internal/crypto/ml_kem.js | 13 ++++ .../test-webcrypto-export-import-ml-dsa.js | 67 ++++++++++--------- .../test-webcrypto-export-import-ml-kem.js | 67 ++++++++++--------- 5 files changed, 104 insertions(+), 60 deletions(-) diff --git a/doc/api/webcrypto.md b/doc/api/webcrypto.md index 71ab62ff8aa..6666428994b 100644 --- a/doc/api/webcrypto.md +++ b/doc/api/webcrypto.md @@ -1259,6 +1259,10 @@ The {CryptoKey} (secret key) generating algorithms supported include: