didclient

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 28 Imported by: 2

Documentation

Overview

Package didclient provides did commands.

Index

Constants

View Source
const (
	// CommandName package command name.
	CommandName = "didclient"
	// CreateOrbDIDCommandMethod command method.
	CreateOrbDIDCommandMethod = "CreateOrbDID"
	// ResolveOrbDIDCommandMethod command method.
	ResolveOrbDIDCommandMethod = "ResolveOrbDID"
	// CreatePeerDIDCommandMethod command method.
	CreatePeerDIDCommandMethod = "CreatePeerDID"

	// BLS12381G2KeyType BLS12381G2 key type.
	BLS12381G2KeyType = "bls12381g2"
)
View Source
const (
	// InvalidRequestErrorCode is typically a code for validation errors.
	InvalidRequestErrorCode = command.Code(iota + command.DIDClient)

	// CreateDIDErrorCode is typically a code for create did errors.
	CreateDIDErrorCode

	// ResolveDIDErrorCode is typically a code for resolve did errors.
	ResolveDIDErrorCode
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

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

Command is controller command for DID Exchange.

func New

func New(domain, didAnchorOrigin, token string, unanchoredDIDMaxLifeTime int, p Provider) (*Command, error)

New returns new DID Exchange controller command instance.

func (*Command) CreateOrbDID added in v0.1.7

func (c *Command) CreateOrbDID(rw io.Writer, req io.Reader) command.Error

CreateOrbDID creates a new orb DID.

func (*Command) CreatePeerDID

func (c *Command) CreatePeerDID(rw io.Writer, req io.Reader) command.Error

CreatePeerDID creates a new peer DID.

func (*Command) GetHandlers

func (c *Command) GetHandlers() []command.Handler

GetHandlers returns list of all commands supported by this controller command.

func (*Command) ResolveOrbDID added in v0.1.8

func (c *Command) ResolveOrbDID(rw io.Writer, req io.Reader) command.Error

ResolveOrbDID resolve orb DID.

type CreateOrbDIDRequest added in v0.1.7

type CreateOrbDIDRequest struct {
	ServiceID          string      `json:"serviceID,omitempty"`
	ServiceEndpoint    string      `json:"serviceEndpoint,omitempty"`
	DIDcommServiceType string      `json:"didcommServiceType,omitempty"`
	PublicKeys         []PublicKey `json:"publicKeys,omitempty"`
	RoutersKeyAgrIDS   []string    `json:"routerKAIDS,omitempty"`
	RouterConnections  []string    `json:"routerConnections,omitempty"`
}

CreateOrbDIDRequest model

This is used for creating orb DID.

type CreatePeerDIDRequest

type CreatePeerDIDRequest struct {
	RouterConnectionID string `json:"routerConnectionID,omitempty"`
}

CreatePeerDIDRequest model

This is used for creating peer DID.

type Provider

type Provider interface {
	VDRegistry() vdr.Registry
	Service(id string) (interface{}, error)
	KMS() kms.KeyManager
}

Provider describes dependencies for the client.

type PublicKey

type PublicKey struct {
	ID       string   `json:"id,omitempty"`
	Type     string   `json:"type,omitempty"`
	Encoding string   `json:"encoding,omitempty"`
	KeyType  string   `json:"keyType,omitempty"`
	Purposes []string `json:"purposes,omitempty"`
	Recovery bool     `json:"recovery,omitempty"`
	Update   bool     `json:"update,omitempty"`
	Value    string   `json:"value,omitempty"`
}

PublicKey public key.

type ResolveOrbDIDRequest added in v0.1.8

type ResolveOrbDIDRequest struct {
	DID string `json:"did,omitempty"`
}

ResolveOrbDIDRequest model

This is used for resolving orb DID.

Jump to

Keyboard shortcuts

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