signature

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHashData

func GetHashData(data SignableData) []byte

func GetHashForSigning

func GetHashForSigning(data SignableData) []byte

func Sign

func Sign(data SignableData, prikey []byte) ([]byte, error)

func SignBySigner

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

func VerifySignableData

func VerifySignableData(signableData SignableData) error

func VerifySignature

func VerifySignature(signableData SignableData, pubKey, signature []byte) (bool, error)

Types

type SignableData

type SignableData interface {
	GetProgramHashes() ([]common.Uint160, error)
	SetPrograms([]*pb.Program)
	GetPrograms() []*pb.Program
	SerializeUnsigned(io.Writer) error
}

SignableData describe the data need be signed.

type Signer

type Signer interface {
	PrivKey() []byte
	PubKey() []byte
}

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