signpb

package
v0.0.0-...-e2e270a Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSignature = errors.New("signpb: invalid signature")

Functions

func SignMarshal

func SignMarshal(ctx context.Context, k PrivateKey, msg proto.Message) ([]byte, error)

func VerifyUnmarshal

func VerifyUnmarshal(k PublicKey, b []byte, m proto.Message) error

Types

type Key

type Key interface {
	PublicKey
	PrivateKey
}

type PrivateKey

type PrivateKey interface {
	crypto.Signer
	HashFunc() crypto.Hash
}

type PublicKey

type PublicKey interface {
	HashFunc() crypto.Hash
	Verify(digest, sig []byte) bool
}

Jump to

Keyboard shortcuts

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