document

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 4 Imported by: 44

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DIDDocument

type DIDDocument map[string]interface{}

DIDDocument Defines DID Document data structure used by Sidetree for basic type safety checks.

func DIDDocumentFromReader

func DIDDocumentFromReader(r io.Reader) (DIDDocument, error)

DIDDocumentFromReader creates an instance of DIDDocument by reading a JSON document from Reader

func DidDocumentFromBytes

func DidDocumentFromBytes(data []byte) (DIDDocument, error)

DidDocumentFromBytes creates an instance of DIDDocument by reading a JSON document from bytes

func (*DIDDocument) Bytes

func (doc *DIDDocument) Bytes() []byte

Bytes returns byte representation of did document

func (*DIDDocument) Context

func (doc *DIDDocument) Context() []string

Context is the context of did document

func (*DIDDocument) ID

func (doc *DIDDocument) ID() string

ID is identifier for DID subject (what DID Document is about)

func (DIDDocument) JSONLdObject

func (doc DIDDocument) JSONLdObject() map[string]interface{}

JSONLdObject returns map that represents JSON LD Object

func (*DIDDocument) PublicKeys

func (doc *DIDDocument) PublicKeys() []PublicKey

PublicKeys are used for digital signatures, encryption and other cryptographic operations

func (*DIDDocument) Services

func (doc *DIDDocument) Services() []Service

Services is an array of service endpoints

func (*DIDDocument) String

func (doc *DIDDocument) String() string

String returns string representation of did document

type Document

type Document map[string]interface{}

Document defines generic document data structure

func FromBytes

func FromBytes(data []byte) (Document, error)

FromBytes creates an instance of Document by reading a JSON document from bytes

func (*Document) Bytes

func (doc *Document) Bytes() ([]byte, error)

Bytes returns byte representation of did document

func (*Document) GetStringValue

func (doc *Document) GetStringValue(key string) string

GetStringValue returns string value for specified key or "" if not found or wrong type

func (*Document) ID

func (doc *Document) ID() string

ID is document identifier

func (Document) JSONLdObject

func (doc Document) JSONLdObject() map[string]interface{}

JSONLdObject returns map that represents JSON LD Object

type PublicKey

type PublicKey map[string]interface{}

PublicKey must include id and type properties, and exactly one value property

func NewPublicKey

func NewPublicKey(pk map[string]interface{}) PublicKey

NewPublicKey creates new public key

func (*PublicKey) Controller

func (pk *PublicKey) Controller() string

Controller identifies the entity that controls the corresponding private key.

func (*PublicKey) ID

func (pk *PublicKey) ID() string

ID is public key ID

func (*PublicKey) PublicKeyBase58

func (pk *PublicKey) PublicKeyBase58() string

PublicKeyBase58 is value property

func (*PublicKey) PublicKeyBase64

func (pk *PublicKey) PublicKeyBase64() string

PublicKeyBase64 is value property

func (*PublicKey) PublicKeyHex

func (pk *PublicKey) PublicKeyHex() string

PublicKeyHex is value property

func (*PublicKey) PublicKeyJWK

func (pk *PublicKey) PublicKeyJWK() string

PublicKeyJWK is value property

func (*PublicKey) PublicKeyPEM

func (pk *PublicKey) PublicKeyPEM() string

PublicKeyPEM is value property

func (*PublicKey) Type

func (pk *PublicKey) Type() string

Type is public key type

type Service

type Service map[string]interface{}

Service represents any type of service the entity wishes to advertise

func NewService

func NewService(m map[string]interface{}) Service

NewService creates new service

func (*Service) Endpoint

func (s *Service) Endpoint() interface{}

Endpoint is service endpoint

func (*Service) ID

func (s *Service) ID() interface{}

ID is service ID

func (*Service) Type

func (s *Service) Type() interface{}

Type is service type

Jump to

Keyboard shortcuts

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