verifiable

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 28 Imported by: 9

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

	// SavePresentationErrorCode for save presentation error
	SavePresentationErrorCode

	// GetPresentationErrorCode for get vp error
	GetPresentationErrorCode

	// GetCredentialsErrorCode for get credential records
	GetCredentialsErrorCode

	// GetPresentationsErrorCode for get presentation records
	GetPresentationsErrorCode
)

Error codes

View Source
const (

	// Ed25519Signature2018 ed25519 signature suite
	Ed25519Signature2018 = "Ed25519Signature2018"
	// JSONWebSignature2020 json web signature suite
	JSONWebSignature2020 = "JsonWebSignature2020"

	// Ed25519KeyType ed25519 key type
	Ed25519KeyType = "Ed25519"

	// P256KeyType EC P-256 key type
	P256KeyType = "P256"

	// Ed25519VerificationKey ED25519 verification key type
	Ed25519VerificationKey = "Ed25519VerificationKey"
)

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 added in v0.1.3

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

GeneratePresentation generates verifiable presentation from a verifiable credential.

func (*Command) GeneratePresentationByID added in v0.1.3

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 added in v0.1.3

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 added in v0.1.3

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

GetCredentials retrieves the verifiable credential records containing name and fields of interest.

func (*Command) GetHandlers

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

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

func (*Command) GetPresentation added in v0.1.3

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

GetPresentation retrieves the verifiable presentation from the store.

func (*Command) GetPresentations added in v0.1.3

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

GetPresentations retrieves the verifiable presentation records containing name and fields of interest.

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) SavePresentation added in v0.1.3

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

SavePresentation saves the presentation 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 added in v0.1.3

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

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

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 added in v0.1.3

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

NameArg model

This is used for querying by name from input json.

type Presentation added in v0.1.3

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

Presentation is model for verifiable presentation.

type PresentationExt added in v0.1.3

type PresentationExt struct {
	Presentation
	Name string `json:"name,omitempty"`
}

PresentationExt is model for presentation with fields related to command features.

type PresentationRequest added in v0.1.3

type PresentationRequest struct {
	VerifiableCredentials []json.RawMessage `json:"verifiableCredential,omitempty"`
	Presentation          json.RawMessage   `json:"presentation,omitempty"`
	DID                   string            `json:"did,omitempty"`
	*ProofOptions
	// SkipVerify can be used to skip verification of `VerifiableCredentials` provided.
	SkipVerify bool `json:"skipVerify,omitempty"`
}

PresentationRequest is model for verifiable presentation request.

type PresentationRequestByID added in v0.1.3

type PresentationRequestByID struct {
	// ID
	ID string `json:"id"`

	// DID ID
	DID string `json:"did"`

	// SignatureType
	SignatureType string `json:"signatureType"`
}

PresentationRequestByID model

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

type ProofOptions added in v0.1.3

type ProofOptions struct {
	// VerificationMethod is the URI of the verificationMethod used for the proof.
	VerificationMethod string `json:"verificationMethod,omitempty"`
	// Created date of the proof. If omitted current system time will be used.
	Created *time.Time `json:"created,omitempty"`
	// Domain is operational domain of a digital proof.
	Domain string `json:"domain,omitempty"`
	// Challenge is a random or pseudo-random value option authentication
	Challenge string `json:"challenge,omitempty"`
	// KeyType key type of the private key
	KeyType string `json:"keyType,omitempty"`
	// SignatureType signature type used for signing
	SignatureType string `json:"signatureType,omitempty"`
	// PrivateKey is used to sign instead of DID
	// deprecate : TODO to be removed as part of #1748
	PrivateKey string `json:"privateKey,omitempty"`
	// contains filtered or unexported fields
}

ProofOptions is model to allow the dynamic proofing options by the user.

type RecordResult added in v0.1.3

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

RecordResult holds the credential records.

Jump to

Keyboard shortcuts

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