verifiable

package
v0.1.3-0...-617a0de Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InvalidRequestErrorCode is typically a code for invalid requests
	InvalidRequestErrorCode = command.Code(iota + command.VC)

	// ValidateCredential for validate vc error
	ValidateCredentialErrorCode

	// SaveCredentialErrorCode for save vc error
	SaveCredentialErrorCode

	// GetCredentialErrorCode for get vc error
	GetCredentialErrorCode

	// GetCredentialErrorCode for get vc by name error
	GetCredentialByNameErrorCode

	// GeneratePresentationErrorCode for get generate vp error
	GeneratePresentationErrorCode

	// GeneratePresentationByIDErrorCode for get generate vp by vc id error
	GeneratePresentationByIDErrorCode
)

Error codes

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

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

Command contains command operations provided by verifiable credential controller.

func New

func New(p provider) (*Command, error)

New returns new verifiable credential controller command instance.

func (*Command) GeneratePresentation

func (o *Command) GeneratePresentation(rw io.Writer, req io.Reader) command.Error

GeneratePresentation generates verifiable presentation from a verifiable credential.

func (*Command) GeneratePresentationByID

func (o *Command) GeneratePresentationByID(rw io.Writer, req io.Reader) command.Error

GeneratePresentationByID generates verifiable presentation from a stored verifiable credential.

func (*Command) GetCredential

func (o *Command) GetCredential(rw io.Writer, req io.Reader) command.Error

GetCredential retrieves the verifiable credential from the store.

func (*Command) GetCredentialByName

func (o *Command) GetCredentialByName(rw io.Writer, req io.Reader) command.Error

GetCredentialByName retrieves the verifiable credential by name from the store.

func (*Command) GetCredentials

func (o *Command) GetCredentials(rw io.Writer, req io.Reader) command.Error

GetCredentials retrieves the verifiable credential records containing name and vcID.

func (*Command) GetHandlers

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

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

func (*Command) SaveCredential

func (o *Command) SaveCredential(rw io.Writer, req io.Reader) command.Error

SaveCredential saves the verifiable credential to the store.

func (*Command) ValidateCredential

func (o *Command) ValidateCredential(rw io.Writer, req io.Reader) command.Error

ValidateCredential validates the verifiable credential.

type Credential

type Credential struct {
	VerifiableCredential string `json:"verifiableCredential,omitempty"`
}

Credential is model for verifiable credential.

type CredentialExt

type CredentialExt struct {
	Credential
	Name string `json:"name,omitempty"`
}

CredentialExt is model for verifiable credential with fields related to command features.

type CredentialRecordResult

type CredentialRecordResult struct {
	// Result
	Result []*verifiable.CredentialRecord `json:"result,omitempty"`
}

CredentialRecordResult holds the credential records.

type IDArg

type IDArg struct {
	// ID
	ID string `json:"id"`
}

IDArg model

This is used for querying/removing by ID from input json.

type NameArg

type NameArg struct {
	// Name
	Name string `json:"name"`
}

NameArg model

This is used for querying by name from input json.

type Presentation

type Presentation struct {
	VerifiablePresentation string `json:"verifiablePresentation,omitempty"`
}

Presentation is model for verifiable presentation.

Jump to

Keyboard shortcuts

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