utils

package
v0.0.0-...-0cb9d36 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvitationKey    = "Invitation"
	ConnectionReqKey = "ConnectionReq"
	ConnectionKey    = "Connection"
	BasicMsgKey      = "Basic"
	ACK_SUCCEED      = "succeed"
	ACK_FAILED       = "failed"
)

Variables

View Source
var Version = ""

Functions

func Base64Decode

func Base64Decode(s string) ([]byte, error)

func Base64Encode

func Base64Encode(bs []byte) string

func CheckConnection

func CheckConnection(myDid, theirDid string, db store.Store) error

func ClearPasswd

func ClearPasswd(passwd []byte)

func CutDId

func CutDId(did string) string

func CutRouter

func CutRouter(router string) string

did@index#svrIndex => did@svrIndex

func GenUUID

func GenUUID() string

func GetDidDocByDid

func GetDidDocByDid(did string, ontSdk *sdk.OntologySdk) (*message.DIDDoc, error)

func GetIndex

func GetIndex(did string) string

Did format did@index#svrIndex

func GetPassword

func GetPassword() ([]byte, error)

func GetPubKeyByDid

func GetPubKeyByDid(did string, ontSdk *sdk.OntologySdk) (string, error)

func GetServiceEndpointByDid

func GetServiceEndpointByDid(did string, ontSdk *sdk.OntologySdk) ([]string, error)

func HttpPostData

func HttpPostData(client *http.Client, url, data string) ([]byte, error)

func NewClient

func NewClient() *http.Client

func OpenAccount

func OpenAccount(path string, ontSdk *sdk.OntologySdk) (*sdk.Account, error)

func ValidateDid

func ValidateDid(did string) bool

Types

type Authentication

type Authentication struct {
	Did       string
	PublicKey PublicKey
}

type DidPubkey

type DidPubkey struct {
	Id           string      `json:"id"`
	Type         string      `json:"type"`
	Controller   interface{} `json:"controller"`
	PublicKeyHex string      `json:"publicKeyHex"`
}

type Doc

type Doc struct {
	Context        []string
	Id             string
	PublicKey      []PublicKey
	Authentication Authentication
	Controller     interface{}
	Recovery       interface{}
	Service        []ServiceDoc
	Attribute      interface{}
	Created        interface{}
	Updated        interface{}
	Proof          interface{}
}

type PublicKey

type PublicKey struct {
	ID           string
	Type         string
	Controller   string
	PublicKeyHex string
}

type ServiceDoc

type ServiceDoc struct {
	ServiceID       string
	ServiceType     string
	ServiceEndpoint string
}

Jump to

Keyboard shortcuts

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