example

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: Apache-2.0 Imports: 10 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) AddCredentialJWT

func (s *SimpleWallet) AddCredentialJWT(credID, cred string) error

func (*SimpleWallet) AddDID

func (s *SimpleWallet) AddDID(id string) error

func (*SimpleWallet) AddPrivateKey

func (s *SimpleWallet) AddPrivateKey(id, kid string, pubKey gocrypto.PrivateKey) error

AddPrivateKey Adds a Private Key to a wallet

func (*SimpleWallet) GetDIDs

func (s *SimpleWallet) GetDIDs() []string

func (*SimpleWallet) GetKey

func (s *SimpleWallet) GetKey(kid string) (string, gocrypto.PrivateKey, error)

func (*SimpleWallet) GetKeysForDID

func (s *SimpleWallet) GetKeysForDID(id string) ([]WalletKeys, error)

func (*SimpleWallet) Init

func (s *SimpleWallet) Init(didMethod did.Method) error

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

func (*SimpleWallet) Size

func (s *SimpleWallet) Size() int

type WalletKeys

type WalletKeys struct {
	ID  string
	Key gocrypto.PrivateKey
}

Directories

Path Synopsis
A simple application using a did:key.
A simple application using a did:key.
A simple example of making a credential manifest and issuing a credential from it, using a credential application.
A simple example of making a credential manifest and issuing a credential from it, using a credential application.
|------------| |----------------------| |------------| | 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