From c5b1d59fe0a18a77b6a4a3fd9f93ad2b4d497225 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Mon, 16 Jun 2025 18:16:46 -0700 Subject: [PATCH] Types: added TS definitions for WebCrypto ECDH. --- ts/njs_webcrypto.d.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ts/njs_webcrypto.d.ts b/ts/njs_webcrypto.d.ts index 058359cb..4e6f2057 100644 --- a/ts/njs_webcrypto.d.ts +++ b/ts/njs_webcrypto.d.ts @@ -41,12 +41,12 @@ interface RsaHashedKeyGenParams { } interface EcKeyImportParams { - name: "ECDSA"; + name: "ECDSA" | "ECDH"; namedCurve: "P-256" | "P-384" | "P-521"; } interface EcKeyGenParams { - name: "ECDSA"; + name: "ECDSA" | "ECDH"; namedCurve: "P-256" | "P-384" | "P-521"; } @@ -68,7 +68,8 @@ type ImportAlgorithm = | AesImportParams | AesVariants | "PBKDF2" - | "HKDF"; + | "HKDF" + | "ECDH"; type GenerateAlgorithm = | RsaHashedKeyGenParams @@ -99,9 +100,15 @@ interface Pbkdf2Params { interations: number; } +interface EcdhParams { + name: "ECDH"; + public: CryptoKey; +} + type DeriveAlgorithm = | HkdfParams - | Pbkdf2Params; + | Pbkdf2Params + | EcdhParams; interface HmacKeyGenParams { name: "HMAC"; -- 2.47.3