0.11.0 • Published 1 year ago

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

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year 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

1 year ago

0.10.1-next.6

1 year ago

0.10.1-next.9

1 year ago

0.10.1-next.8

1 year ago

0.10.1-next.2

1 year ago

0.9.1-next.121

1 year ago

0.10.1-next.14

1 year ago

0.10.1-next.13

1 year ago

0.10.2-next.11

1 year ago

0.11.0

1 year ago

0.9.1-next.42

1 year ago

0.9.1-next.109

1 year ago

0.9.1-next.107

1 year ago

0.9.1-next.105

1 year ago

0.9.1-next.103

1 year ago

0.9.1-next.100

1 year ago

0.9.1-next.56

1 year ago

0.9.1-next.55

1 year ago

0.9.1-next.9

1 year ago

0.9.1-next.69

1 year ago

0.9.1-next.62

1 year ago

0.9.1-next.89

1 year ago

0.8.1-next.272

1 year ago

0.9.1-next.17

1 year ago

0.9.1-next.16

1 year ago

0.9.1-next.15

1 year ago

0.9.1-next.13

1 year ago

0.9.1-next.12

1 year ago

0.9.1-next.99

1 year ago

0.9.1-next.11

1 year ago

0.9.1-next.10

1 year ago

0.9.1-next.97

1 year ago

0.9.1-next.96

1 year ago

0.9.0

1 year ago

0.9.1-next.118

1 year ago

0.9.1-next.116

1 year ago

0.9.1-next.114

1 year ago

0.9.1-next.113

1 year ago

0.9.1-next.21

1 year ago

0.9.1-next.120

1 year ago

0.8.1-next.190

1 year ago

0.8.1-next.192

1 year ago

0.8.1-next.194

1 year ago

0.8.1-next.146

1 year ago

0.8.1-next.154

1 year ago

0.8.1-next.156

1 year ago

0.8.1-next.157

1 year ago

0.8.1-next.158

1 year ago

0.8.1-next.114

1 year ago

0.8.1-next.159

1 year ago

0.8.1-next.117

1 year ago

0.8.1-next.119

1 year ago

0.8.1-next.161

1 year ago

0.8.1-next.162

1 year ago

0.8.1-next.163

1 year ago

0.8.1-next.164

1 year ago

0.8.1-next.120

1 year ago

0.8.1-next.165

1 year ago

0.8.1-next.121

1 year ago

0.8.1-next.166

1 year ago

0.8.1-next.122

1 year ago

0.8.1-next.167

1 year ago

0.8.1-next.123

1 year ago

0.8.1-next.168

1 year ago

0.8.1-next.169

1 year ago

0.8.1-next.179

1 year ago

0.8.1-next.26

2 years ago

0.8.1-next.66

2 years ago

0.8.1-next.31

2 years ago

0.8.1-next.77

2 years ago

0.8.1-next.84

2 years ago

0.8.1-next.42

2 years ago

0.8.1-next.50

2 years ago

0.8.1-next.57

2 years ago

0.8.1-next.55

2 years ago

0.7.1-next.54

2 years ago

0.8.1-unstable.9

2 years ago

0.8.1-unstable.5

2 years ago

0.8.1-unstable.4

2 years ago

0.7.1-next.66

2 years ago

0.7.1-next.68

2 years ago

0.8.1-next.3

2 years ago

0.8.1-next.6

2 years ago

0.8.1-next.12

2 years ago

0.8.1-next.2

2 years ago

0.8.1-next.18

2 years ago

0.8.0

2 years ago

0.7.1-next.43

2 years ago

0.7.1-next.40

2 years ago

0.7.1-next.39

2 years ago

0.7.1-next.38

2 years ago

0.7.1-next.18

2 years ago