didcreator

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateDIDOpts

type CreateDIDOpts struct {
	ServiceType     string
	KeyType         string
	ServiceEndpoint string
}

CreateDIDOpts holds the options for creating DID

type Creator

type Creator interface {
	// Creates new DID document.
	//
	// Args:
	//
	// method: did method
	// opts: options to create DID
	//
	// Returns:
	//
	// did: DID document
	//
	// error: error
	Create(method string, opts ...DocOpts) (*did.Doc, error)
}

Creator allows for creation of DID document

type DidMethod

type DidMethod interface {
	// Build builds did document with specified public key and options
	Build(pubKey *PubKey, opts *CreateDIDOpts) (*did.Doc, error)
	// Accept registers this DID method document builder with the given method.
	Accept(method string) bool
}

DidMethod defines method interface for creation of did documents

type DocOpts

type DocOpts func(opts *CreateDIDOpts)

DocOpts is a create DID option

func WithKeyType

func WithKeyType(keyType string) DocOpts

WithKeyType allows for setting key type

func WithServiceEndpoint

func WithServiceEndpoint(serviceEndpoint string) DocOpts

WithServiceEndpoint allows for setting service endpoint

func WithServiceType

func WithServiceType(serviceType string) DocOpts

WithServiceType service type of DID document to be created

type PubKey

type PubKey struct {
	Value string // base58 encoded
	Type  string
}

PubKey contains public key type and value

Jump to

Keyboard shortcuts

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