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 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 ¶
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
Click to show internal directories.
Click to hide internal directories.