endorsement

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyEndorsedDocument added in v0.5.0

func VerifyEndorsedDocument(endorsedDoc EndorsedDocument) bool

VerifyEndorsedDocument checks an endorsed document

func VerifyEndorsement added in v0.5.0

func VerifyEndorsement(doc Document, en *Endorsement) bool

VerifyEndorsement checks the signature in an endorsement against a document

Types

type Document added in v0.5.0

type Document interface {
	Hash() ([]byte, error)
}

Document defines a signable docuement

type EndorsedDocument added in v0.5.0

type EndorsedDocument interface {
	Document() Document
	Endorsement() *Endorsement
}

EndorsedDocument is an signed document

type Endorsement

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

Endorsement defines an endorsement with timestamp

func Endorse added in v0.5.0

func Endorse(
	signer crypto.PrivateKey,
	doc Document,
	ts time.Time,
) (*Endorsement, error)

Endorse endorses a document

func NewEndorsement

func NewEndorsement(
	ts time.Time,
	endorserPubKey crypto.PublicKey,
	sig []byte,
) *Endorsement

NewEndorsement creates a new Endorsement

func (*Endorsement) Endorser

func (en *Endorsement) Endorser() crypto.PublicKey

Endorser returns the endorser's public key

func (*Endorsement) LoadProto added in v0.5.0

func (en *Endorsement) LoadProto(ePb *iotextypes.Endorsement) (err error)

LoadProto converts a protobuf message to endorsement

func (*Endorsement) Proto added in v0.5.0

func (en *Endorsement) Proto() (*iotextypes.Endorsement, error)

Proto converts an endorsement to protobuf message

func (*Endorsement) Signature

func (en *Endorsement) Signature() []byte

Signature returns the signature of this endorsement

func (*Endorsement) Timestamp added in v0.5.0

func (en *Endorsement) Timestamp() time.Time

Timestamp returns the signature time

Jump to

Keyboard shortcuts

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