types

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Create_DID_Operation     = "create"
	Update_DID_Operation     = "update"
	Deactivate_DID_Operation = "deactivate"
)
View Source
const DIDInfoVersion = 0x00
View Source
const DID_ELASTOS_PREFIX = "did:elastos:"
View Source
const MaxSignDataSize = 1000
View Source
const (
	RegisterDID types.TxType = 0x0a
)
View Source
const RegisterIdentification = 0x09
View Source
const RegisterIdentificationVersion = 0x00

Variables

This section is empty.

Functions

func GetDIDFromUri added in v0.1.3

func GetDIDFromUri(idURI string) string

func IsRegisterDIDTx added in v0.1.3

func IsRegisterDIDTx(tx *types.Transaction) bool

func IsRegisterIdentificationTx

func IsRegisterIdentificationTx(tx *types.Transaction) bool

func IsURIHasPrefix added in v0.1.3

func IsURIHasPrefix(did string) bool

Types

type DIDHeaderInfo added in v0.1.3

type DIDHeaderInfo struct {
	Specification string `json:"specification"`
	Operation     string `json:"operation"`
	PreviousTxid  string `json:"previousTxid,omitempty"`
}

header of DID transaction payload

func (*DIDHeaderInfo) Deserialize added in v0.1.3

func (d *DIDHeaderInfo) Deserialize(r io.Reader, version byte) error

func (*DIDHeaderInfo) Serialize added in v0.1.3

func (d *DIDHeaderInfo) Serialize(w io.Writer, version byte) error

type DIDPayloadInfo added in v0.1.3

type DIDPayloadInfo struct {
	ID             string             `json:"id"`
	PublicKey      []DIDPublicKeyInfo `json:"publicKey"`
	Authentication []interface{}      `json:"authentication"`
	Authorization  []interface{}      `json:"authorization"`
	Expires        string             `json:"expires"`
}

payload in DID transaction payload

type DIDProofInfo added in v0.1.3

type DIDProofInfo struct {
	Type               string `json:"type"`
	VerificationMethod string `json:"verificationMethod"`
	Signature          string `json:"signature"`
}

proof of DID transaction payload

func (*DIDProofInfo) Deserialize added in v0.1.3

func (d *DIDProofInfo) Deserialize(r io.Reader, version byte) error

func (*DIDProofInfo) Serialize added in v0.1.3

func (d *DIDProofInfo) Serialize(w io.Writer, version byte) error

type DIDPublicKeyInfo added in v0.1.3

type DIDPublicKeyInfo struct {
	ID              string `json:"id"`
	Type            string `json:"type"`
	Controller      string `json:"controller"`
	PublicKeyBase58 string `json:"publicKeyBase58"`
}

public keys of payload in DID transaction payload

func (*DIDPublicKeyInfo) Deserialize added in v0.1.3

func (p *DIDPublicKeyInfo) Deserialize(r io.Reader, version byte) error

func (*DIDPublicKeyInfo) Serialize added in v0.1.3

func (p *DIDPublicKeyInfo) Serialize(w io.Writer, version byte) error

type Operation added in v0.1.3

type Operation struct {
	Header  DIDHeaderInfo `json:"header"`
	Payload string        `json:"payload"`
	Proof   DIDProofInfo  `json:"proof"`

	PayloadInfo *DIDPayloadInfo
}

payload of DID transaction

func (*Operation) Data added in v0.1.3

func (p *Operation) Data(version byte) []byte

func (*Operation) Deserialize added in v0.1.3

func (p *Operation) Deserialize(r io.Reader, version byte) error

func (*Operation) GetData added in v0.1.3

func (p *Operation) GetData() []byte

func (*Operation) Serialize added in v0.1.3

func (p *Operation) Serialize(w io.Writer, version byte) error

type PayloadRegisterIdentification

type PayloadRegisterIdentification struct {
	ID       string
	Sign     []byte
	Contents []RegisterIdentificationContent
}

func (*PayloadRegisterIdentification) Data

func (p *PayloadRegisterIdentification) Data(version byte) []byte

func (*PayloadRegisterIdentification) Deserialize

func (p *PayloadRegisterIdentification) Deserialize(r io.Reader, version byte) error

func (*PayloadRegisterIdentification) GetData

func (p *PayloadRegisterIdentification) GetData() []byte

func (*PayloadRegisterIdentification) Serialize

func (p *PayloadRegisterIdentification) Serialize(w io.Writer, version byte) error

type RegisterIdentificationContent

type RegisterIdentificationContent struct {
	Path   string
	Values []RegisterIdentificationValue
}

func (*RegisterIdentificationContent) Deserialize

func (a *RegisterIdentificationContent) Deserialize(r io.Reader, version byte) error

func (*RegisterIdentificationContent) Serialize

func (a *RegisterIdentificationContent) Serialize(w io.Writer, version byte) error

type RegisterIdentificationValue

type RegisterIdentificationValue struct {
	DataHash common.Uint256
	Proof    string
	Info     string
}

func (*RegisterIdentificationValue) Deserialize

func (a *RegisterIdentificationValue) Deserialize(r io.Reader, version byte) error

func (*RegisterIdentificationValue) Serialize

func (a *RegisterIdentificationValue) Serialize(w io.Writer, version byte) error

type TranasactionData added in v0.1.3

type TranasactionData struct {
	TXID      string    `json:"txid"`
	Timestamp string    `json:"timestamp"`
	Operation Operation `json:"operation"`
}

func (*TranasactionData) Serialize added in v0.1.3

func (p *TranasactionData) Serialize(w io.Writer, version byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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