ontid

package
v1.10.1-sdk Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: LGPL-3.0 Imports: 17 Imported by: 9

Documentation

Overview

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	MAX_KEY_SIZE   = 80
	MAX_TYPE_SIZE  = 64
	MAX_VALUE_SIZE = 512 * 1024

	MAX_NUM = 100
)
View Source
const (
	FIELD_VERSION byte = 0
	FLAG_VERSION  byte = 0x01

	FIELD_PK         byte = 1
	FIELD_ATTR       byte = 2
	FIELD_RECOVERY   byte = 3
	FIELD_CONTROLLER byte = 4
	FIELD_SERVICE    byte = 5
	FIELD_CREATED    byte = 6
	FIELD_UPDATED    byte = 7
	FIELD_PROOF      byte = 8
	FIELD_CONTEXT    byte = 9
)
View Source
const MAX_DEPTH = 8
View Source
const (
	OWNER_TOTAL_SIZE = 1024 * 1024 // 1MB
)

Variables

This section is empty.

Functions

func GetAttributeByKey added in v1.10.0

func GetAttributeByKey(srvc *native.NativeService) ([]byte, error)

func GetAttributes

func GetAttributes(srvc *native.NativeService) ([]byte, error)

func GetAttributesJson added in v1.10.0

func GetAttributesJson(srvc *native.NativeService) ([]byte, error)

func GetControllerJson added in v1.10.0

func GetControllerJson(srvc *native.NativeService) ([]byte, error)

func GetDDO

func GetDDO(srvc *native.NativeService) ([]byte, error)

deprecated

func GetDocumentJson added in v1.10.0

func GetDocumentJson(srvc *native.NativeService) ([]byte, error)

func GetKeyState

func GetKeyState(srvc *native.NativeService) ([]byte, error)

func GetPublicKeyByID

func GetPublicKeyByID(srvc *native.NativeService) ([]byte, error)

func GetPublicKeys

func GetPublicKeys(srvc *native.NativeService) ([]byte, error)

Deprecated

func GetPublicKeysJson added in v1.10.0

func GetPublicKeysJson(srvc *native.NativeService) ([]byte, error)

func GetServiceJson added in v1.10.0

func GetServiceJson(srvc *native.NativeService) ([]byte, error)

func Init

func Init()

func RegisterIDContract

func RegisterIDContract(srvc *native.NativeService)

func SerializeSigners added in v1.8.2

func SerializeSigners(s []Signer) []byte

Types

type AddNewAuthKeyParam added in v1.10.0

type AddNewAuthKeyParam struct {
	OntId        []byte
	NewPublicKey *NewPublicKey
	SignIndex    uint32
}

func (*AddNewAuthKeyParam) Deserialization added in v1.10.0

func (this *AddNewAuthKeyParam) Deserialization(source *common.ZeroCopySource) error

func (*AddNewAuthKeyParam) Serialization added in v1.10.0

func (this *AddNewAuthKeyParam) Serialization(sink *common.ZeroCopySink)

type Context added in v1.10.0

type Context struct {
	OntId    []byte
	Contexts [][]byte
	Index    uint32
}

func (*Context) Deserialization added in v1.10.0

func (this *Context) Deserialization(source *common.ZeroCopySource) error

func (*Context) Serialization added in v1.10.0

func (this *Context) Serialization(sink *common.ZeroCopySink)

type Contexts added in v1.10.0

type Contexts [][]byte

func (*Contexts) Deserialization added in v1.10.0

func (contexts *Contexts) Deserialization(source *common.ZeroCopySource) error

func (*Contexts) Serialization added in v1.10.0

func (contexts *Contexts) Serialization(sink *common.ZeroCopySink)

type Document added in v1.10.0

type Document struct {
	Contexts       []string         `json:"@context"`
	Id             string           `json:"id"`
	PublicKey      []*publicKeyJson `json:"publicKey"`
	Authentication []interface{}    `json:"authentication"`
	Controller     interface{}      `json:"controller"`
	Recovery       *GroupJson       `json:"recovery"`
	Service        []*serviceJson   `json:"service"`
	Attribute      []*attributeJson `json:"attribute"`
	Created        uint32           `json:"created"`
	Updated        uint32           `json:"updated"`
	Proof          string           `json:"proof"`
}

type Group added in v1.8.1

type Group struct {
	Members   []interface{} `json:"members"`
	Threshold uint          `json:"threshold"`
}

Group defines a group control logic

func (*Group) ToJson added in v1.8.1

func (g *Group) ToJson() []byte

type GroupJson added in v1.10.0

type GroupJson struct {
	Members   []interface{} `json:"members"`
	Threshold uint          `json:"threshold"`
}

type NewPublicKey added in v1.10.0

type NewPublicKey struct {
	// contains filtered or unexported fields
}

func (*NewPublicKey) Deserialization added in v1.10.0

func (this *NewPublicKey) Deserialization(source *common.ZeroCopySource) error

func (*NewPublicKey) Serialization added in v1.10.0

func (this *NewPublicKey) Serialization(sink *common.ZeroCopySink)

type ProofParam added in v1.10.0

type ProofParam struct {
	ProofType      string
	Created        string
	Creator        string
	SignatureValue string
}

func (*ProofParam) Deserialization added in v1.10.0

func (this *ProofParam) Deserialization(source *common.ZeroCopySource) error

func (*ProofParam) Serialization added in v1.10.0

func (this *ProofParam) Serialization(sink *common.ZeroCopySink)

type RemoveAuthKeyParam added in v1.10.0

type RemoveAuthKeyParam struct {
	OntId     []byte
	Index     uint32
	SignIndex uint32
}

func (*RemoveAuthKeyParam) Deserialization added in v1.10.0

func (this *RemoveAuthKeyParam) Deserialization(source *common.ZeroCopySource) error

func (*RemoveAuthKeyParam) Serialization added in v1.10.0

func (this *RemoveAuthKeyParam) Serialization(sink *common.ZeroCopySink)

type SearchServiceParam added in v1.10.0

type SearchServiceParam struct {
	OntId     []byte `json:"id"`
	ServiceId []byte `json:"serviceId"`
}

func (*SearchServiceParam) Deserialization added in v1.10.0

func (this *SearchServiceParam) Deserialization(source *common.ZeroCopySource) error

func (*SearchServiceParam) Serialization added in v1.10.0

func (this *SearchServiceParam) Serialization(sink *common.ZeroCopySink)

type Service added in v1.10.0

type Service struct {
	ServiceId      []byte
	Type           []byte
	ServiceEndpint []byte
}

func (*Service) Deserialization added in v1.10.0

func (this *Service) Deserialization(source *common.ZeroCopySource) error

func (*Service) Serialization added in v1.10.0

func (this *Service) Serialization(sink *common.ZeroCopySink)

type ServiceParam added in v1.10.0

type ServiceParam struct {
	OntId          []byte
	ServiceId      []byte
	Type           []byte
	ServiceEndpint []byte
	Index          uint32
}

func (*ServiceParam) Deserialization added in v1.10.0

func (this *ServiceParam) Deserialization(source *common.ZeroCopySource) error

func (*ServiceParam) Serialization added in v1.10.0

func (this *ServiceParam) Serialization(sink *common.ZeroCopySink)

type ServiceRemoveParam added in v1.10.0

type ServiceRemoveParam struct {
	OntId     []byte
	ServiceId []byte
	Index     uint32
}

func (*ServiceRemoveParam) Deserialization added in v1.10.0

func (this *ServiceRemoveParam) Deserialization(source *common.ZeroCopySource) error

func (*ServiceRemoveParam) Serialization added in v1.10.0

func (this *ServiceRemoveParam) Serialization(sink *common.ZeroCopySink)

type Services added in v1.10.0

type Services []Service

func (*Services) Deserialization added in v1.10.0

func (services *Services) Deserialization(source *common.ZeroCopySource) error

func (*Services) Serialization added in v1.10.0

func (services *Services) Serialization(sink *common.ZeroCopySink)

type SetAuthKeyParam added in v1.10.0

type SetAuthKeyParam struct {
	OntId     []byte
	Index     uint32
	SignIndex uint32
}

func (*SetAuthKeyParam) Deserialization added in v1.10.0

func (this *SetAuthKeyParam) Deserialization(source *common.ZeroCopySource) error

func (*SetAuthKeyParam) Serialization added in v1.10.0

func (this *SetAuthKeyParam) Serialization(sink *common.ZeroCopySink)

type SetKeyAccessParam added in v1.10.0

type SetKeyAccessParam struct {
	OntId     []byte
	SetIndex  uint32
	Access    string
	SignIndex uint32
}

func (*SetKeyAccessParam) Deserialization added in v1.10.0

func (this *SetKeyAccessParam) Deserialization(source *common.ZeroCopySource) error

func (*SetKeyAccessParam) Serialization added in v1.10.0

func (this *SetKeyAccessParam) Serialization(sink *common.ZeroCopySink)

type Signer added in v1.8.1

type Signer struct {
	Id    []byte
	Index uint32
}

Jump to

Keyboard shortcuts

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