did

package
v0.0.0-...-10d2010 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenAccount

func OpenAccount(path string, pwd string, ontSdk *osdk.OntologySdk) (*osdk.Account, error)

Types

type AlgorithmField

type AlgorithmField struct {
	Provider_did string `json:"provider_did"`
	Method       string `json:"method"`
	Name         string `json:"name"`
	Result       string `json:"result"`
}

type DataField

type DataField struct {
	Provider_did string `json:"provider_did"`
	Method       string `json:"method"`
	Name         string `json:"name"`
	UserDid      string `json:"user_did"`
	BindData     string `json:"bind_data"`
	Data         string `json:"data"`
}

type DidPubkey

type DidPubkey struct {
	Id           string      `json:"id"`
	Type         string      `json:"type"`
	Controller   interface{} `json:"controller"`
	PublicKeyHex string      `json:"publicKeyHex"`
}

type OntResolver

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

func NewOntResolver

func NewOntResolver(config *config.DidConf) (*OntResolver, error)

func (*OntResolver) CreateCredential

func (o *OntResolver) CreateCredential(did string, idx int, content interface{}, commit bool) (string, string, error)

func (*OntResolver) EncrypteDataWithDID

func (o *OntResolver) EncrypteDataWithDID(data []byte, did string) ([]byte, error)

func (*OntResolver) GetDidPubkeys

func (o *OntResolver) GetDidPubkeys(did string, idx int) (*DidPubkey, error)

func (*OntResolver) RevokeCredential

func (o *OntResolver) RevokeCredential(did string, idx int, credstr string) (string, error)

func (*OntResolver) SignData

func (o *OntResolver) SignData(data []byte) ([]byte, error)

func (*OntResolver) ValidateSig

func (o *OntResolver) ValidateSig(did string, idx int, msg string, sig string) (bool, error)

type OrangeCredential

type OrangeCredential struct {
	Data      *DataField      `json:"data"`
	Algorithm *AlgorithmField `json:"algorithm"`
}

type Resolver

type Resolver interface {
	ValidateSig(did string, idx int, msg string, sig string) (bool, error)
	CreateCredential(did string, idx int, content interface{}, commit bool) (string, string, error)
	RevokeCredential(did string, idx int, cred string) (string, error)
	SignData(data []byte) ([]byte, error)
	EncrypteDataWithDID(data []byte, did string) ([]byte, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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