@sphereon/ssi-sdk-lto-did-provider
v0.11.0
Published
Veramo LTO Network DID provider
Downloads
361
Readme
Lto-did-provider is a Veramo plugin to create and delete DIDs and to add and manage verification methods on LTO Network.
createIdentifier
Creating a DID means you have to create a public/private keypair first. You can do this using lto-api package or any other means to create a ed25519 keypair. We are accepting an optional ed25519 private key to keep it flexible for everyone.
const privateKeyHex = '18a58bad89...'
const identifier = await ltoDIDProvider.createIdentifier(
{
options: {
privateKeyHex,
},
},
context
)
addKey
You can add one or more verification methods to an existing DID, or you can add them during DID creation. Internally this is accomplished using LTO Networks, associations. This means new private/public keypairs are needed. Again you can use your own ed25519 private key.
import { LtoVerificationMethod } from '@sphereon/lto-did-ts'
const key = {
kid: 'did:lto:1234567890abc',
kms: 'local',
type: 'Ed25519' as const,
privateKeyHex,
publicKeyHex: '27f3h29f3h7...',
}
const did = await ltoDIDProvider.addKey({
identifier,
key,
options: {
verificationMethod: LtoVerificationMethod.VerificationMethod,
},
}, context)
Installation
yarn add @sphereon/ssi-sdk-lto-did-provider
Build
yarn build