Skip to content

Commit cf29d18

Browse files
committed
feat(#2): implemented sign, verify, exportKey and importKey. other changes.
1 parent 67a1a66 commit cf29d18

File tree

5 files changed

+493
-59
lines changed

5 files changed

+493
-59
lines changed

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22

33
An implementation of the W3C Web Cryptography API specification (https://www.w3.org/TR/WebCryptoAPI/) for Go using Go's standard `crypto` library.
44

5+
> [!IMPORTANT]
6+
> Whilst we try to ensure that we don't commit breaking changes until we release our first stable version, there
7+
> may be times where decisions made during early development no longer make sense and therefore require
8+
> breaking changes. Please be mindful of this when updating your version of this library until we hit v1.0.0.
9+
510
## Contents
611

712
- [Background](#background)
813
- [Implementation status](#implementation-status)
914
- [Getting started](#getting-started)
1015
- [Algorithms](#algorithms)
16+
- [ECDSA](#ecdsa)
1117
- [HMAC](#hmac)
1218
- [RSA-OAEP](#rsa-oaep)
1319
- [SHA](#sha)
@@ -39,6 +45,30 @@ This library is still in active development and all algorithms are not yet suppo
3945

4046
## Algorithms
4147

48+
### ECDSA
49+
50+
The **ECDSA** algorithm is the implementation of operations described in [§23](https://www.w3.org/TR/WebCryptoAPI/#ecdsa) of the W3C specification.
51+
52+
```go
53+
package main
54+
55+
import (
56+
"github.com/armortal/webcrypto-go"
57+
"github.com/armortal/webcrypto-go/algorithms/ecdsa"
58+
)
59+
60+
func main() {
61+
// generate a new ECDSA key
62+
key, err := webcrypto.Subtle().GenerateKey(
63+
&ecdsa.Algorithm{
64+
NamedCurve: "P-256"
65+
}, true, webcrypto.Sign, webcrypto.Verify)
66+
if err != nil {
67+
panic(err)
68+
}
69+
}
70+
```
71+
4272
### HMAC
4373

4474
The **HMAC** algorithm is the implementation of operations described in [§29](https://www.w3.org/TR/WebCryptoAPI/#hmac) of the W3C specification.

0 commit comments

Comments
 (0)