exported

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DidPrefix = "did:ixo:"

Functions

func GenerateMnemonic added in v0.12.2

func GenerateMnemonic() (string, error)

func UnprefixedDid added in v0.12.2

func UnprefixedDid(did Did) string

func UnprefixedDidFromPubKey added in v0.12.2

func UnprefixedDidFromPubKey(pubKey string) string

func VerifyKeyToAddr

func VerifyKeyToAddr(verifyKey string) sdk.AccAddress

Types

type Did

type Did = string

type DidDoc

type DidDoc interface {
	proto.Message

	SetDid(did Did) error
	GetDid() Did
	SetPubKey(pubkey string) error
	GetPubKey() string
	Address() sdk.AccAddress
}

type IxoDid

type IxoDid struct {
	Did                 string `json:"did" yaml:"did"`
	VerifyKey           string `json:"verifyKey" yaml:"verifyKey"`
	EncryptionPublicKey string `json:"encryptionPublicKey" yaml:"encryptionPublicKey"`
	Secret              Secret `json:"secret" yaml:"secret"`
}

func FromMnemonic added in v0.12.2

func FromMnemonic(mnemonic string) (IxoDid, error)

func FromSeed added in v0.12.2

func FromSeed(seed [32]byte) (IxoDid, error)

func Gen added in v0.12.2

func Gen() (IxoDid, error)

func NewIxoDid added in v0.12.2

func NewIxoDid(did, verifyKey, encryptionPublicKey string, secret Secret) IxoDid

func (IxoDid) Address

func (id IxoDid) Address() sdk.AccAddress

func (IxoDid) Equals added in v0.12.2

func (id IxoDid) Equals(other IxoDid) bool

func (IxoDid) SignMessage added in v0.12.2

func (id IxoDid) SignMessage(msg []byte) ([]byte, error)

func (IxoDid) String

func (id IxoDid) String() string

func (IxoDid) VerifySignedMessage added in v0.12.2

func (id IxoDid) VerifySignedMessage(msg []byte, sig []byte) bool

type Secret

type Secret struct {
	Seed                 string `json:"seed" yaml:"seed"`
	SignKey              string `json:"signKey" yaml:"signKey"`
	EncryptionPrivateKey string `json:"encryptionPrivateKey" yaml:"encryptionPrivateKey"`
}

func NewSecret added in v0.12.2

func NewSecret(seed, signKey, encryptionPrivateKey string) Secret

func (Secret) Equals added in v0.12.2

func (s Secret) Equals(other Secret) bool

func (Secret) String

func (s Secret) String() string

Jump to

Keyboard shortcuts

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