peer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StoreNamespace store name space for DID Store
	StoreNamespace = "didresolver"
)

Variables

This section is empty.

Functions

func NewDoc

func NewDoc(publicKey []did.PublicKey, authentication []did.VerificationMethod,
	opts ...did.DocOption) (*did.Doc, error)

NewDoc returns the resolved variant of the genesis version of the peer DID document

Types

type DIDCreator

type DIDCreator struct {
	// contains filtered or unexported fields
}

DIDCreator implements building new dids

func NewDIDCreator

func NewDIDCreator(opts ...Option) *DIDCreator

NewDIDCreator return new instance of did creator

func (*DIDCreator) Accept

func (dc *DIDCreator) Accept(method string) bool

Accept did method

func (*DIDCreator) Build

func (dc *DIDCreator) Build(pubKey *api.PubKey, opts *api.CreateDIDOpts) (*did.Doc, error)

Build builds new DID Document

type DIDResolver

type DIDResolver struct {
	// contains filtered or unexported fields
}

DIDResolver resolver

func NewDIDResolver

func NewDIDResolver(store *DIDStore) *DIDResolver

NewDIDResolver new Peer DID resolver instance

func (*DIDResolver) Accept

func (resl *DIDResolver) Accept(method string) bool

Accept did method

func (*DIDResolver) Read

func (resl *DIDResolver) Read(didID string, _ ...didresolver.ResolveOpt) (*did.Doc, error)

Read implements didresolver.DidMethod.Read interface (https://w3c-ccg.github.io/did-resolution/#resolving-input)

type DIDStore

type DIDStore struct {
	// contains filtered or unexported fields
}

DIDStore Peer DID Document store

func NewDIDStore

func NewDIDStore(s storage.Provider) (*DIDStore, error)

NewDIDStore new Peer DID store (backing store is configurable)

func (*DIDStore) Accept

func (s *DIDStore) Accept(method string) bool

Accept did method

func (*DIDStore) Get

func (s *DIDStore) Get(id string) (*did.Doc, error)

Get returns Peer DID Document

func (*DIDStore) Put

func (s *DIDStore) Put(doc *did.Doc, by *[]didstore.ModifiedBy) error

Put saves Peer DID Document along with user key/signature.

type Option

type Option func(opts *DIDCreator)

Option configures the did creator

func WithCreatorServiceEndpoint

func WithCreatorServiceEndpoint(serviceEndpoint string) Option

WithCreatorServiceEndpoint allows for setting service endpoint

func WithCreatorServiceType

func WithCreatorServiceType(serviceType string) Option

WithCreatorServiceType is service type for this creator

Jump to

Keyboard shortcuts

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