summaryrefslogtreecommitdiff
path: root/ext/crypto/00_crypto.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/crypto/00_crypto.js')
-rw-r--r--ext/crypto/00_crypto.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/crypto/00_crypto.js b/ext/crypto/00_crypto.js
index a95c0be1b..0e5a511e5 100644
--- a/ext/crypto/00_crypto.js
+++ b/ext/crypto/00_crypto.js
@@ -92,6 +92,7 @@
"verify": {
"RSASSA-PKCS1-v1_5": null,
"RSA-PSS": "RsaPssParams",
+ "ECDSA": "EcdsaParams",
"HMAC": null,
},
"importKey": {
@@ -1185,6 +1186,25 @@
signature,
}, data);
}
+ case "ECDSA": {
+ // 1.
+ if (key[_type] !== "public") {
+ throw new DOMException(
+ "Key type not supported",
+ "InvalidAccessError",
+ );
+ }
+ // 2.
+ const hash = normalizedAlgorithm.hash.name;
+ // 3-8.
+ return await core.opAsync("op_crypto_verify_key", {
+ key: keyData,
+ algorithm: "ECDSA",
+ hash,
+ signature,
+ namedCurve: key[_algorithm].namedCurve,
+ }, data);
+ }
}
throw new TypeError("unreachable");