🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@didtools/key-webcrypto

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@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
Source
npmnpm
Version
0.2.0
Version published
Maintainers
6
Created
Source

Webcrypto Key Did Provider

This is a DID Provider which implements EIP2844 for did:key: using webcrypto with non-extractable keys. Currently P-256 is supported.

Installation

npm install --save @didtools/key-webcrypto

Usage

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

Keywords

DID

FAQs

Package last updated on 04 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts