cli

package
v0.0.0-...-eae8967 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:           "credwallet",
	Short:         "credwallet is a command line wallet for Workday Credentials.",
	Long:          `credwallet is a command line wallet to demonstrate the protocols that Workday Credentials is built on.`,
	SilenceErrors: true,
	SilenceUsage:  true,
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println(cmd.UsageString())
	},
}

Functions

func BuildAndSignCredential

func BuildAndSignCredential(credInputJSON, schemaID, subjectDID string, issuerDoc ledger.DIDDoc, issuerPrivateKey ed25519.PrivateKey) (*credential.VerifiableCredential, error)

func BuildAndSignPresentationRequest

func BuildAndSignPresentationRequest(
	description string,
	verifierDoc ledger.DIDDoc,
	verifierPK ed25519.PrivateKey,
	prID string,
	url string,
	criteria []presentation.Criterion,
	supportingCreds []credential.VerifiableCredential,
	variables map[string]interface{}) (*presentation.CompositeProofRequestInstanceChallenge, error)

func BuildAndSignSchema

func BuildAndSignSchema(schemaInputJSON ledger.JSONSchemaMap, privateKey ed25519.PrivateKey, authorDIDDoc ledger.DIDDoc) (*ledger.Schema, error)

func BuildCredDef

func BuildCredDef(controller, schemaID string) (*ledger.DIDDoc, ed25519.PrivateKey, error)

TODO move to ledger-common

func CmdErr

func CmdErr(cmd *cobra.Command, err error) error

CmdErr prints the help text for the command and prints an error

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the RootCmd.

func IsJSON

func IsJSON(maybeJSON []byte) bool

IsJSON returns true if input is valid JSON, false otherwise

func StructPrinter

func StructPrinter(s interface{})

StructPrinter prints a struct as JSON to stdout

func ValidateFlags

func ValidateFlags(cmd ...*cobra.Command)

Types

type CredDefInfo

type CredDefInfo struct {
	ControllerID string
	SchemaID     string
}

func GetCredDefInfo

func GetCredDefInfo(doc ledger.DIDDoc) (*CredDefInfo, error)

type KeyMaterial

type KeyMaterial struct {
	DIDDoc     ledger.DIDDoc `json:"diddoc"`
	PrivateKey string        `json:"privatekey_hex"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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