vdr

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2022 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package vdr is a generated GoMock package.

Package vdr contains a verifiable data registry to the w3c specification and provides primitives for storing and working with Nuts DID based identities. It provides an easy to work with web api and a command line interface. It provides underlying storage back ends to store, update and search for Nuts identities.

Index

Constants

This section is empty.

Variables

View Source
var ErrThumbprintMismatch = errors.New("thumbprint of signing key does not match DID")

ErrThumbprintMismatch is returned when a transaction publishing a new DID is signed with a different key than the DID is generated from

View Source
var TestDIDA, _ = did.ParseDID("did:nuts:GvkzxsezHvEc8nGhgz6Xo3jbqkHwswLmWw3CYtCm7hAW")

Two TestDIDs which can be used during testing: TestDIDA is a testDID

View Source
var TestDIDB, _ = did.ParseDID("did:nuts:B8PUHs2AUHbFF1xLLK4eZjgErEcMXHxs68FteY7NDtCY")

TestDIDB is a testDID

View Source
var TestMethodDIDA, _ = did.ParseDIDURL(TestDIDA.String() + "#abc-method-1")

TestMethodDIDA is a test method DID for the TestDIDA

View Source
var TestMethodDIDB, _ = did.ParseDIDURL(TestDIDB.String() + "#abc-method-2")

TestMethodDIDB is a test method DID for the TestDIDB

Functions

func CreateDocumentValidator

func CreateDocumentValidator() did.Validator

CreateDocumentValidator creates a DID Document validator that checks for inconsistencies in the the DID Document: - validate it according to the W3C DID Core Data Model specification - validate is according to the Nuts DID Method specification:

  • it checks validationMethods for the following conditions:
  • every validationMethod id must have a fragment
  • every validationMethod id should have the DID prefix
  • every validationMethod id must be unique
  • it checks services for the following conditions:
  • every service id must have a fragment
  • every service id should have the DID prefix
  • every service id must be unique

func TestMethodDIDAPrivateKey

func TestMethodDIDAPrivateKey() crypto.TestKey

TestMethodDIDAPrivateKey returns the key for TestMethodDIDA

func TestMethodDIDBPrivateKey

func TestMethodDIDBPrivateKey() crypto.TestKey

TestMethodDIDBPrivateKey returns the key for TestMethodDIDB

Types

type Ambassador

type Ambassador interface {
	// Configure instructs the ambassador to start receiving DID Documents from the network.
	Configure()
}

Ambassador acts as integration point between VDR and network by sending DID Documents network and process DID Documents received through the network.

func NewAmbassador

func NewAmbassador(networkClient network.Transactions, didStore types.Store) Ambassador

NewAmbassador creates a new Ambassador,

type Config

type Config struct{}

Config holds the config for the VDR engine

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a fresh Config filled with default values

func TestVDRConfig

func TestVDRConfig() Config

type VDR

type VDR struct {
	OnChange func(registry *VDR)
	// contains filtered or unexported fields
}

VDR stands for the Nuts Verifiable Data Registry. It is the public entrypoint to work with W3C DID documents. It connects the Resolve, Create and Update DID methods to the network, and receives events back from the network which are processed in the store. It is also a Runnable, Diagnosable and Configurable Nuts Engine.

func NewTestVDRInstance

func NewTestVDRInstance(testDirectory string) *VDR

func NewVDR

func NewVDR(config Config, cryptoClient crypto.KeyStore, networkClient network.Transactions, store types.Store) *VDR

NewVDR creates a new VDR with provided params

func (*VDR) Config

func (r *VDR) Config() interface{}

func (*VDR) Configure

func (r *VDR) Configure(_ core.ServerConfig) error

Configure configures the VDR engine.

func (*VDR) ConflictedDocuments

func (r *VDR) ConflictedDocuments() ([]did.Document, []types.DocumentMetadata, error)

func (VDR) Create

func (r VDR) Create(options types.DIDCreationOptions) (*did.Document, crypto.Key, error)

Create generates a new DID Document

func (*VDR) Diagnostics

func (r *VDR) Diagnostics() []core.DiagnosticResult

Diagnostics returns the diagnostics for this engine

func (*VDR) Name

func (r *VDR) Name() string

func (VDR) Update

func (r VDR) Update(id did.DID, current hash.SHA256Hash, next did.Document, _ *types.DocumentMetadata) error

Update updates a DID Document based on the DID and current hash

Directories

Path Synopsis
api
v1
Package v1 provides primitives to interact with the openapi HTTP API.
Package v1 provides primitives to interact with the openapi HTTP API.
Package doc contains DID Document related functionality that only matters to the current node.
Package doc contains DID Document related functionality that only matters to the current node.
Package types is a generated GoMock package.
Package types is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL