example

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoteColor   = "\033[1;34m%s\033[0m"
	ActionColor = "\033[1;36m%s\033[0m"
	StepColor   = "\033[1;33m%s\033[0m"
	ErrorColor  = "\033[1;31m%s\033[0m"
	DebugColor  = "\033[0;36m%s\033[0m"
	OKColor     = "\033[0;32m%s\033[0m"
)

Color coding to make it easier to read terminal

Variables

This section is empty.

Functions

func HandleExampleError

func HandleExampleError(err error, msg string)

HandleExampleError writes an error to stderr and terminates the program

func WriteAction

func WriteAction(s string)

func WriteError

func WriteError(s string)

func WriteNote

func WriteNote(s string)

func WriteOK

func WriteOK(s string)

func WriteStep

func WriteStep(s string, step int)

Types

type SimpleWallet

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

SimpleWallet is a sample wallet This would NOT be how it would be stored in production, but serves for demonstrative purposes This holds the assigned DIDs, their associated private keys, and VCs

func NewSimpleWallet

func NewSimpleWallet() *SimpleWallet

func (*SimpleWallet) AddCredentials

func (s *SimpleWallet) AddCredentials(cred credential.VerifiableCredential) error

func (*SimpleWallet) AddDIDKey

func (s *SimpleWallet) AddDIDKey(k string, key string) error

func (*SimpleWallet) AddPrivateKey

func (s *SimpleWallet) AddPrivateKey(k string, key gocrypto.PrivateKey) error

AddPrivateKey Adds a Private Key to a wallet

func (*SimpleWallet) GetDID

func (s *SimpleWallet) GetDID(k string) (string, error)

func (*SimpleWallet) Init

func (s *SimpleWallet) Init(keyType string) error

Init stores a DID for a particular user and adds it to the registry

func (*SimpleWallet) Size

func (s *SimpleWallet) Size() int

Directories

Path Synopsis
A simple application using a did:key.
A simple application using a did:key.
|------------| |----------------------| |------------| | Verifier | ----> | Presentation Request | -----> | Holder | | | | \Definition | | | |------------| |----------------------| |------------|
|------------| |----------------------| |------------| | Verifier | ----> | Presentation Request | -----> | Holder | | | | \Definition | | | |------------| |----------------------| |------------|
usecase
This is a simple application which creates a Verifiable Credential.
This is a simple application which creates a Verifiable Credential.

Jump to

Keyboard shortcuts

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