signature

package
v0.0.0-...-640f24c Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2018 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefaultScheme

func SetDefaultScheme(scheme string) error

func Sign

func Sign(privKey keypair.PrivateKey, data []byte) ([]byte, error)

func SignBySigner

func SignBySigner(data SignableData, signer Signer) ([]byte, error)

func Verify

func Verify(pubKey keypair.PublicKey, data, signature []byte) error

func VerifyMultiSignature

func VerifyMultiSignature(data []byte, keys []keypair.PublicKey, m int, sigs [][]byte) error

func VerifySignableDataContracts

func VerifySignableDataContracts(data SignableData) error

Types

type SignableData

type SignableData interface {
	interfaces.CodeContainer

	////Get the the SignableData's program hashes
	GetProgramHashes() ([]common.Address, error)

	SetPrograms([]*program.Program)

	GetPrograms() []*program.Program

	//TODO: add SerializeUnsigned
	SerializeUnsigned(io.Writer) error
}

SignableData describe the data need be signed.

type Signer

type Signer interface {
	//get signer's private key
	PrivKey() keypair.PrivateKey

	//get signer's public key
	PubKey() keypair.PublicKey
}

Signer is the abstract interface of user's information(Keys) for signing data.

Jump to

Keyboard shortcuts

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