]> git.kaiwu.me - njs.git/commitdiff
Types: added TS definitions for WebCrypto ECDH.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 17 Jun 2025 01:16:46 +0000 (18:16 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 17 Jun 2025 05:11:38 +0000 (22:11 -0700)
ts/njs_webcrypto.d.ts

index 058359cbe4271420f2db85d2f8bbfd3a0ccb699d..4e6f2057798028a1b0840ae4c8917eecbc7d6908 100644 (file)
@@ -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";