did

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package did is corresponding Go package for libindy's anoncreds namespace. We suggest that you read indy SDK documentation for more information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(wallet int) ctx.Channel

Create creates a DID to a wallet with empty seed which means that seed is generated by indy.

func CreateAndStore

func CreateAndStore(wallet int, did Did) ctx.Channel

CreateAndStore creates a DID to a wallet with JSON DID configuration. Use this if DID seed is needed.

func Endpoint

func Endpoint(wallet, pool int, did string) ctx.Channel

Endpoint reads an endpoint values from a wallet and from a ledger if wallet does not have it.

func Key

func Key(pool, wallet int, didName string) ctx.Channel

Key returns DIDs key from wallet. Indy's internal version tries to get the key from the ledger if it cannot get from wallet. NOTE! Because we have our Ledger Plugin system at the top of the wrappers we cannot guarantee that ledger fetch will work. Make sure that the key is stored to the wallet.

func KeyAndMeta

func KeyAndMeta(wallet int, did string) ctx.Channel

KeyAndMeta fetches the key and meta data of the DID.

func List

func List(wallet int) ctx.Channel

List list DIDs in a wallet.

func LocalKey

func LocalKey(wallet int, did string) ctx.Channel

LocalKey reads the DID's key from a wallet. Use this instead of Key function to prevent unnecessary ledger read.

func Meta

func Meta(wallet int, did string) ctx.Channel

Meta gets meta data of the DID.

func SetEndpoint

func SetEndpoint(wallet int, did, address, key string) ctx.Channel

SetEndpoint sets an endpoint and an endpoint key for a DID. Note that this function does not write it to a ledger even the Key function is capable to fetch endpoint data from a ledger.

func SetMeta

func SetMeta(wallet int, did, meta string) ctx.Channel

SetMeta sets meta data of the DID.

func StoreTheir

func StoreTheir(wallet int, idJSON string) ctx.Channel

StoreTheir saves their DID to wallet. Use did.Did configuration struct to build the JSON string.

Types

type Did

type Did struct {
	Did        string `json:"did,omitempty"`
	Seed       string `json:"seed,omitempty"`
	CryptoType string `json:"crypto_type,omitempty"`
	Cid        bool   `json:"cid,omitempty"`
	VerKey     string `json:"verkey,omitempty"`
}

Did is a helper struct to build JSON data for indy functions.

Jump to

Keyboard shortcuts

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