sigs

package
v0.0.0-...-041d6b2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTaskSignature

func CheckTaskSignature(ctx context.Context, task *types.DioneTask, worker address.Address) error

func Generate

func Generate(sigType types.SigType) ([]byte, error)

Generate generates private key of given type

func RegisterSignature

func RegisterSignature(typ types.SigType, vs SigShim)

RegisterSignature should be only used during init

func Sign

func Sign(sigType types.SigType, privkey []byte, msg []byte) (*types.Signature, error)

Sign takes in signature type, private key and message. Returns a signature for that message. Valid sigTypes are: "ed25519"

func ToPublic

func ToPublic(sigType types.SigType, pk []byte) ([]byte, error)

ToPublic converts private key to public key

func Verify

func Verify(sig *types.Signature, addrByte []byte, msg []byte) error

Verify verifies signatures

Types

type SigShim

type SigShim interface {
	GenPrivate() ([]byte, error)
	ToPublic(pk []byte) ([]byte, error)
	Sign(pk []byte, msg []byte) ([]byte, error)
	Verify(sig []byte, a []byte, msg []byte) error
}

SigShim is used for introducing signature functions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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