endorsement

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyEndorsedDocument

func VerifyEndorsedDocument(endorsedDoc EndorsedDocument) bool

VerifyEndorsedDocument checks an endorsed document

func VerifyEndorsement

func VerifyEndorsement(doc Document, en *Endorsement) bool

VerifyEndorsement checks the signature in an endorsement against a document

Types

type Document

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

Document defines a signable docuement

type EndorsedDocument

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

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

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

LoadProto converts a protobuf message to endorsement

func (*Endorsement) Proto

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

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