From 4fa8869f2487749a9f190cb3047f4f3e6d571f27 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 7 Aug 2024 08:43:58 +0200 Subject: feat(ext/node): rewrite crypto keys (#24463) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This completely rewrites how we handle key material in ext/node. Changes in this PR: - **Signing** - RSA - RSA-PSS 🆕 - DSA 🆕 - EC - ED25519 🆕 - **Verifying** - RSA - RSA-PSS 🆕 - DSA 🆕 - EC 🆕 - ED25519 🆕 - **Private key import** - Passphrase encrypted private keys 🆕 - RSA - PEM - DER (PKCS#1) 🆕 - DER (PKCS#8) 🆕 - RSA-PSS - PEM - DER (PKCS#1) 🆕 - DER (PKCS#8) 🆕 - DSA 🆕 - EC - PEM - DER (SEC1) 🆕 - DER (PKCS#8) 🆕 - X25519 🆕 - ED25519 🆕 - DH - **Public key import** - RSA - PEM - DER (PKCS#1) 🆕 - DER (PKCS#8) 🆕 - RSA-PSS 🆕 - DSA 🆕 - EC 🆕 - X25519 🆕 - ED25519 🆕 - DH 🆕 - **Private key export** - RSA 🆕 - DSA 🆕 - EC 🆕 - X25519 🆕 - ED25519 🆕 - DH 🆕 - **Public key export** - RSA - DSA 🆕 - EC 🆕 - X25519 🆕 - ED25519 🆕 - DH 🆕 - **Key pair generation** - Overhauled, but supported APIs unchanged This PR adds a lot of new individual functionality. But most importantly because of the new key material representation, it is now trivial to add new algorithms (as shown by this PR). Now, when adding a new algorithm, it is also widely supported - for example previously we supported ED25519 key pair generation, but we could not import, export, sign or verify with ED25519. We can now do all of those things. --- tools/core_import_map.json | 2 ++ tools/ops.d.ts | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 tools/ops.d.ts (limited to 'tools') diff --git a/tools/core_import_map.json b/tools/core_import_map.json index bdf9e066b..d31821fb7 100644 --- a/tools/core_import_map.json +++ b/tools/core_import_map.json @@ -1,5 +1,7 @@ { "imports": { + "ext:core/mod.js": "../../deno_core/core/core.d.ts", + "ext:core/ops": "./ops.d.ts", "ext:deno_broadcast_channel/01_broadcast_channel.js": "../ext/broadcast_channel/01_broadcast_channel.js", "ext:deno_cache/01_cache.js": "../ext/cache/01_cache.js", "ext:deno_canvas/01_image.js": "../ext/canvas/01_image.js", diff --git a/tools/ops.d.ts b/tools/ops.d.ts new file mode 100644 index 000000000..8acb1e588 --- /dev/null +++ b/tools/ops.d.ts @@ -0,0 +1,4 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +// This file is intentionally empty - that puts this file into script mode, +// which then allows all symbols to be imported from the file. -- cgit v1.2.3