signature

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataSignature

func DataSignature(key *ecdsa.PrivateKey, src DataSource, opts ...SignOption) ([]byte, error)

func SignData

func SignData(key *ecdsa.PrivateKey, v DataWithSignature, opts ...SignOption) error

func SignDataWithHandler

func SignDataWithHandler(key *ecdsa.PrivateKey, src DataSource, handler KeySignatureHandler, opts ...SignOption) error

func VerifyData

func VerifyData(src DataWithSignature, opts ...SignOption) error

func VerifyDataWithSource

func VerifyDataWithSource(dataSrc DataSource, sigSrc KeySignatureSource, opts ...SignOption) error

Types

type DataSource

type DataSource interface {
	ReadSignedData([]byte) ([]byte, error)
	SignedDataSize() int
}

type DataWithSignature

type DataWithSignature interface {
	DataSource
	GetSignatureWithKey() (key, sig []byte)
	SetSignatureWithKey(key, sig []byte)
}

type KeySignatureHandler

type KeySignatureHandler func(key []byte, sig []byte)

type KeySignatureSource

type KeySignatureSource func() (key, sig []byte)

type SignOption

type SignOption func(*cfg)

func SignWithRFC6979

func SignWithRFC6979() SignOption

Jump to

Keyboard shortcuts

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