# @didtools/key-webcrypto

> This is a DID Provider which implements [EIP2844](https://eips.ethereum.org/EIPS/eip-2844) for `did:key:` using webcrypto with non-extractable keys. Currently P-256 is supported.

Latest version **0.2.0** (published 2024-01-04) · (Apache-2.0 OR MIT) license · 0 weekly downloads

## Install

```sh
npm install @didtools/key-webcrypto
pnpm add @didtools/key-webcrypto
yarn add @didtools/key-webcrypto
bun add @didtools/key-webcrypto
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2024-01-04 |
| First published | 2023-06-20 |
| Weekly downloads | 0 |
| License | (Apache-2.0 OR MIT) |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.14 |
| Dependencies | 4 |
| Unpacked size | 9.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 102 |
| Author | Joel Thorstensson |
| Maintainers | dbcfd, cb3box, ukstv, jpham2023, oed, paul_lecam |
| Keywords | DID, identity, did-provider, self-sovereign |

## Links

- npm: https://www.npmjs.com/package/@didtools/key-webcrypto
- Repository: https://github.com/ceramicnetwork/js-did
- Homepage: https://github.com/ceramicnetwork/js-did#readme
- Issues: https://github.com/ceramicnetwork/js-did/issues
- npm.io page: https://npm.io/package/@didtools/key-webcrypto

## Dependencies (4)

- [varint](https://npm.io/package/varint.md) ^6.0.0
- [rpc-utils](https://npm.io/package/rpc-utils.md) ^0.6.2
- [uint8arrays](https://npm.io/package/uint8arrays.md) ^5.0.1
- [fast-json-stable-stringify](https://npm.io/package/fast-json-stable-stringify.md) ^2.1.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2024-01-04
- 0.1.2 — 2023-12-06
- 0.1.1 — 2023-06-20

## README

# Webcrypto Key Did Provider
This is a DID Provider which implements [EIP2844](https://eips.ethereum.org/EIPS/eip-2844) for `did:key:` using webcrypto with non-extractable keys. Currently P-256 is supported.


## Installation

```
npm install --save @didtools/key-webcrypto
```

## Usage

```js
import { WebcryptoProvider } from '@didtools/key-webcrypto'
import KeyResolver from 'key-did-resolver'
import { DID } from 'dids'

const keyPair = generateP256KeyPair()
const provider = new WebcryptoProvider(keypair)
const did = new DID({ provider, resolver: KeyResolver.getResolver() })
await did.authenticate()

// log the DID
console.log(did.id)

// create JWS
const { jws, linkedBlock } = await did.createDagJWS({ hello: 'world' })

// verify JWS
await did.verifyJWS(jws)
```

## License

Apache-2.0 OR MIT

---
_Source: https://npm.io/package/@didtools/key-webcrypto · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
