iotex-core: Index | Files

package endorsement

import ""


Package Files


func VerifyEndorsedDocument Uses

func VerifyEndorsedDocument(endorsedDoc EndorsedDocument) bool

VerifyEndorsedDocument checks an endorsed document

func VerifyEndorsement Uses

func VerifyEndorsement(doc Document, en *Endorsement) bool

VerifyEndorsement checks the signature in an endorsement against a document

type Document Uses

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

Document defines a signable docuement

type EndorsedDocument Uses

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

EndorsedDocument is an signed document

type Endorsement Uses

type Endorsement struct {
    // contains filtered or unexported fields

Endorsement defines an endorsement with timestamp

func Endorse Uses

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

Endorse endorses a document

func NewEndorsement Uses

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

NewEndorsement creates a new Endorsement

func (*Endorsement) Endorser Uses

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

Endorser returns the endorser's public key

func (*Endorsement) LoadProto Uses

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

LoadProto converts a protobuf message to endorsement

func (*Endorsement) Proto Uses

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

Proto converts an endorsement to protobuf message

func (*Endorsement) Signature Uses

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

Signature returns the signature of this endorsement

func (*Endorsement) Timestamp Uses

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

Timestamp returns the signature time

Package endorsement imports 6 packages (graph) and is imported by 3 packages. Updated 2019-09-30. Refresh now. Tools for package owners.