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: 6 Imported by: 14

Documentation

Index

Constants

View Source
const (
	// NameSpace for vc store
	NameSpace = "verifiable"
)

Variables

View Source
var ErrNotFound = errors.New("did not found under given key")

ErrNotFound signals that the entry for the given DID and key is not present in the store.

Functions

This section is empty.

Types

type Record added in v0.1.3

type Record struct {
	Name      string   `json:"name,omitempty"`
	ID        string   `json:"id,omitempty"`
	Context   []string `json:"context,omitempty"`
	Type      []string `json:"type,omitempty"`
	SubjectID string   `json:"subjectId,omitempty"`
}

Record model containing name, ID and other fields of interest

type Store

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

Store stores vc

func New

func New(ctx provider) (*Store, error)

New returns a new vc store

func (*Store) GetCredential added in v0.1.3

func (s *Store) GetCredential(id string) (*verifiable.Credential, error)

GetCredential retrieves a verifiable credential based on ID.

func (*Store) GetCredentialIDByName added in v0.1.3

func (s *Store) GetCredentialIDByName(name string) (string, error)

GetCredentialIDByName retrieves verifiable credential id based on name.

func (*Store) GetCredentials added in v0.1.3

func (s *Store) GetCredentials() ([]*Record, error)

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

func (*Store) GetPresentation added in v0.1.3

func (s *Store) GetPresentation(id string) (*verifiable.Presentation, error)

GetPresentation retrieves a verifiable presentation based on ID.

func (*Store) GetPresentationIDByName added in v0.1.3

func (s *Store) GetPresentationIDByName(name string) (string, error)

GetPresentationIDByName retrieves verifiable presentation id based on name.

func (*Store) GetPresentations added in v0.1.3

func (s *Store) GetPresentations() ([]*Record, error)

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

func (*Store) SaveCredential added in v0.1.3

func (s *Store) SaveCredential(name string, vc *verifiable.Credential) error

SaveCredential saves a verifiable credential.

func (*Store) SavePresentation added in v0.1.3

func (s *Store) SavePresentation(name string, vp *verifiable.Presentation) error

SavePresentation saves a verifiable presentation.

Jump to

Keyboard shortcuts

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