0.11.0 • Published 2 years ago

@sphereon/ssi-sdk-wellknown-did-verifier v0.11.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Warning: This package still is in very early development. Breaking changes without notice will happen at this point!


A Sphereon SSI-SDK plugin to verify relationships between the controller of an origin and a DID conforming to the DIF spec for well-known DID Configurations It is written in Typescript and can be compiled to any target JavaScript version.

Available functions

  • registerSignatureValidation
  • removeSignatureValidation
  • verifyDomainLinkage
  • verifyDidConfigurationResource

Usage

Adding the plugin to an agent:

import { IWellKnownDidVerifier, WellKnownDidVerifier } from '@sphereon/ssi-sdk-wellknown-did-verifier'

const agent = createAgent<IWellKnownDidVerifier>({
  plugins: [
    new WellKnownDidVerifier({
      signatureVerifications: { verified: () => Promise.resolve({ verified: true }) },
      onlyVerifyServiceDids: true,
    }),
  ],
})

Register signature verification callback:

Registers a callback function to be called within the verification process, to verify the signature of the credentials within the DID configuration resource.

agent
  .registerSignatureVerification({
    callbackName: 'example_key',
    signatureVerification: () => Promise.resolve({ verified: true }),
  })
  .then(() => console.log('success'))
  .catch(() => console.log('failed'))

Remove signature verification callback:

Removes a registered callback function.

agent
  .removeSignatureVerification({ callbackName: 'example_key' })
  .then(() => console.log('success'))
  .catch(() => console.log('failed'))

Verify domain linkage:

Verifies the relationship between the controller of an origin and a given DID. Option available to only verify the service DID.

agent
  .verifyDomainLinkage({
    did: 'did:key:z6MkoTHsgNNrby8JzCNQ1iRLyW5QQ6R8Xuu6AA8igGrMVPUM',
    signatureVerification: 'verified',
    onlyVerifyServiceDids: false,
  })
  .then((result: IDomainLinkageValidation) => console.log(result.status))

Verify DID configuration resource:

Verifies a DID configuration resource and domain linkage credentials it holds.

You can either pass in a DID configuration resource or fetch it remotely by setting a secure well-known location (origin). Option available to only verify a given DID.

agent
  .verifyDidConfigurationResource({
    signatureVerification: () => Promise.resolve({ verified: true }),
    origin: 'https://example.com',
    did: 'did:key:z6MkoTHsgNNrby8JzCNQ1iRLyW5QQ6R8Xuu6AA8igGrMVPUM#foo',
  })
  .then((result: IResourceValidation) => console.log(result.status))

Installation

yarn add @sphereon/ssi-sdk-wellknown-did-verifier

Build

yarn build
0.10.0

2 years ago

0.10.1-next.6

2 years ago

0.10.1-next.9

2 years ago

0.10.1-next.8

2 years ago

0.10.1-next.2

2 years ago

0.9.1-next.121

2 years ago

0.10.1-next.14

2 years ago

0.10.1-next.13

2 years ago

0.10.2-next.11

2 years ago

0.11.0

2 years ago

0.9.1-next.42

2 years ago

0.9.1-next.109

2 years ago

0.9.1-next.107

2 years ago

0.9.1-next.105

2 years ago

0.9.1-next.103

2 years ago

0.9.1-next.100

2 years ago

0.9.1-next.56

2 years ago

0.9.1-next.55

2 years ago

0.9.1-next.9

2 years ago

0.9.1-next.69

2 years ago

0.9.1-next.62

2 years ago

0.9.1-next.89

2 years ago

0.8.1-next.272

2 years ago

0.9.1-next.17

2 years ago

0.9.1-next.16

2 years ago

0.9.1-next.15

2 years ago

0.9.1-next.13

2 years ago

0.9.1-next.12

2 years ago

0.9.1-next.99

2 years ago

0.9.1-next.11

2 years ago

0.9.1-next.10

2 years ago

0.9.1-next.97

2 years ago

0.9.1-next.96

2 years ago

0.9.0

2 years ago

0.9.1-next.118

2 years ago

0.9.1-next.116

2 years ago

0.9.1-next.114

2 years ago

0.9.1-next.113

2 years ago

0.9.1-next.21

2 years ago

0.9.1-next.120

2 years ago

0.8.1-next.190

2 years ago

0.8.1-next.192

2 years ago

0.8.1-next.194

2 years ago

0.8.1-next.146

3 years ago

0.8.1-next.154

3 years ago

0.8.1-next.156

3 years ago

0.8.1-next.157

3 years ago

0.8.1-next.158

3 years ago

0.8.1-next.114

3 years ago

0.8.1-next.159

3 years ago

0.8.1-next.117

3 years ago

0.8.1-next.119

3 years ago

0.8.1-next.161

3 years ago

0.8.1-next.162

3 years ago

0.8.1-next.163

3 years ago

0.8.1-next.164

3 years ago

0.8.1-next.120

3 years ago

0.8.1-next.165

3 years ago

0.8.1-next.121

3 years ago

0.8.1-next.166

3 years ago

0.8.1-next.122

3 years ago

0.8.1-next.167

3 years ago

0.8.1-next.123

3 years ago

0.8.1-next.168

3 years ago

0.8.1-next.169

3 years ago

0.8.1-next.179

2 years ago

0.8.1-next.26

3 years ago

0.8.1-next.66

3 years ago

0.8.1-next.31

3 years ago

0.8.1-next.77

3 years ago

0.8.1-next.84

3 years ago

0.8.1-next.42

3 years ago

0.8.1-next.50

3 years ago

0.8.1-next.57

3 years ago

0.8.1-next.55

3 years ago

0.7.1-next.54

3 years ago

0.8.1-unstable.9

3 years ago

0.8.1-unstable.5

3 years ago

0.8.1-unstable.4

3 years ago

0.7.1-next.66

3 years ago

0.7.1-next.68

3 years ago

0.8.1-next.3

3 years ago

0.8.1-next.6

3 years ago

0.8.1-next.12

3 years ago

0.8.1-next.2

3 years ago

0.8.1-next.18

3 years ago

0.8.0

3 years ago

0.7.1-next.43

3 years ago

0.7.1-next.40

3 years ago

0.7.1-next.39

3 years ago

0.7.1-next.38

3 years ago

0.7.1-next.18

3 years ago