crypto

package
v0.0.0-...-d673ec7 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FlagKeystore = cli.StringFlag{
		Name:  "keystore",
		Usage: "keystore directory",
		Value: DefaultKeystore(),
	}
	FlagPassword = cli.StringFlag{
		Name:  "password",
		Usage: "password file",
		Value: DefaultPassword(),
	}
)
View Source
var BuildTxCmd = cli.Command{
	Name:      "tx",
	Usage:     "build a new tx",
	UsageText: "tx <nonce> <to> <value> <gasLimit> <gasPrice> [data]",
	Action:    BuildTxAction,
	Flags:     []cli.Flag{},
}
View Source
var CalcHashCmd = cli.Command{
	Name:      "hash",
	Usage:     "calculate keccak256 hash of data",
	UsageText: "hash <data>",
	Action:    CalcHashAction,
	Flags:     []cli.Flag{},
}
View Source
var CryptoCmd = cli.Command{
	Name:  "crypto",
	Usage: "crypto operations",
	Flags: []cli.Flag{FlagKeystore, FlagPassword},
	Subcommands: []cli.Command{
		CalcHashCmd,
		SignHashCmd,
		BuildTxCmd,
		SignTxCmd,
		VerifyCmd,
		EcrecoverCmd,
		PackCmd,
	},
}
View Source
var DefaultKeystore = utils.DefaultKeystore
View Source
var DefaultPassword = utils.DefaultPassword
View Source
var EcrecoverCmd = cli.Command{
	Name:      "ecrecover",
	Usage:     "recover address from a signature",
	UsageText: "ecrecover <hash> <sig>",
	Action:    EcrecoverAction,
	Flags:     []cli.Flag{},
}
View Source
var (
	ErrInsufficientArguments = fmt.Errorf("insufficient arguments")
)
View Source
var PackCmd = cli.Command{
	Name:      "pack",
	Usage:     "pack arguments",
	UsageText: "pack <type0> <arg0> <type1> <arg1> ...",
	Action:    PackAction,
	Flags:     []cli.Flag{},
}
View Source
var ParseBigInt = utils.ParseBigInt
View Source
var ParseUint64 = utils.ParseUint64
View Source
var SignHashCmd = cli.Command{
	Name:      "signhash",
	Usage:     "sign a hash",
	UsageText: "sign <account> <hash>",
	Action:    SignHashAction,
	Flags:     []cli.Flag{},
}
View Source
var SignTxCmd = cli.Command{
	Name:      "signtx",
	Usage:     "sign a transaction",
	UsageText: "sign <account> <tx>",
	Action:    SignTxAction,
	Flags:     []cli.Flag{},
}
View Source
var VerifyCmd = cli.Command{
	Name:      "verify",
	Usage:     "verify a signature",
	UsageText: "verify <pubkey> <hash> <sig>",
	Action:    VerifyAction,
	Flags:     []cli.Flag{},
}

Functions

func BuildTx

func BuildTx(nonce, to, amount, gasLimit, gasPrice, data string) error

func BuildTxAction

func BuildTxAction(c *cli.Context) error

func CalcHashAction

func CalcHashAction(c *cli.Context) error

func Ecrecover

func Ecrecover(hash string, sig string) error

func EcrecoverAction

func EcrecoverAction(c *cli.Context) error

func PackAction

func PackAction(c *cli.Context) error

func PackArguments

func PackArguments(args []string) error

func ParseFlagKeystore

func ParseFlagKeystore(c *cli.Context) string

func ParseFlagPassword

func ParseFlagPassword(c *cli.Context) string

func ReadPassphrase

func ReadPassphrase(c *cli.Context) (string, error)

func SignHash

func SignHash(ksPath string, account, passphrase string, hash string) error

func SignHashAction

func SignHashAction(c *cli.Context) error

func SignTx

func SignTx(ksPath string, account, passphrase string, rawTxStr string, chainId string) error

func SignTxAction

func SignTxAction(c *cli.Context) error

func Verify

func Verify(pub, hash, sig string) error

func VerifyAction

func VerifyAction(c *cli.Context) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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