1.0.0 • Published 1 year ago

@didtools/key-did v1.0.0

Weekly downloads
-
License
(Apache-2.0 OR MI...
Repository
github
Last release
1 year ago

Key DID

Utility functions for did:key DIDs.

Installation

npm install @didtools/key-did

Usage

Create a DID with an optional seed

import { createDID } from '@didtools/key-did'

const seed = // 32 bytes of entropy, Uint8Array
const did = createDID(seed)

// Authenticate with the provider
await did.authenticate()

Generate a random private key and create an authenticated DID

import { generatePrivateKey, getAuthenticatedDID } from '@didtools/key-did'

const randomKey = generatePrivateKey()
const did = await getAuthenticatedDID(randomKey)

Additional Usage Notes

See the dids developer site for more details about how to use this package.

Contributing

We are happy to accept small and large contributions.

License

Apache-2.0 OR MIT