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