Skip to content

Commit 052456e

Browse files
committed
fix: tls ECDSA
1 parent b87dbe7 commit 052456e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@reclaimprotocol/tls",
3-
"version": "0.1.0",
4-
"description": "WebCrypto Based Cross Platform TLS",
3+
"version": "0.1.1",
4+
"description": "TLS 1.2/1.3 for any JavaScript Environment",
55
"type": "module",
66
"exports": {
77
".": {

src/utils/x509.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ function getSigAlgorithm(
8686
throw new Error(`Unsupported hash algorithm: ${hash.name}`)
8787
}
8888

89+
case 'ECDSA':
90+
switch (hash.name) {
91+
case 'SHA-256':
92+
return 'ECDSA-SECP256R1-SHA256'
93+
case 'SHA-384':
94+
return 'ECDSA-SECP384R1-SHA384'
95+
default:
96+
throw new Error(`Unsupported hash algorithm: ${hash.name}`)
97+
}
98+
8999
default:
90100
throw new Error(`Unsupported signature algorithm: ${name}`)
91101
}

0 commit comments

Comments
 (0)