From: Dmitry Volyntsev Date: Tue, 17 Jun 2025 01:16:46 +0000 (-0700) Subject: Types: added TS definitions for WebCrypto ECDH. X-Git-Tag: 0.9.1~18 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=c5b1d59fe0a18a77b6a4a3fd9f93ad2b4d497225;p=njs.git Types: added TS definitions for WebCrypto ECDH. --- 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";