plugeth/cmd/ethkey
Eng Zer Jun 8d066f1f42
all: use T.TempDir to create temporary test directories (#24633)
This commit replaces ioutil.TempDir with t.TempDir in tests. The
directory created by t.TempDir is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using ioutil.TempDir
had to be removed manually by calling os.RemoveAll, which is omitted in
some tests. The error handling boilerplate e.g.

	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}

is also tedious, but t.TempDir handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-04-08 15:44:55 +02:00
..
changepassword.go cmd: abstract getPassPhrase functions into one (#21219) 2020-06-30 09:56:40 +02:00
generate.go accounts/keystore: use github.com/google/uuid (#22217) 2021-02-26 15:28:34 +01:00
inspect.go cmd/ethkey: support --passwordfile in generate command (#21183) 2020-06-08 11:55:51 +02:00
main.go cmd/clef: change --rpcport to --http.port and update flags in docs (#21318) 2020-07-14 10:35:32 +02:00
message_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
message.go cmd/ethkey: support --passwordfile in generate command (#21183) 2020-06-08 11:55:51 +02:00
README.md all: replace passPHRASE with passWORD in user interactions (#19932) 2019-08-12 12:00:38 +03:00
run_test.go all: update license information (#16089) 2018-02-14 13:49:11 +01:00
utils.go cmd/ethkey: fix comment typo (#24205) 2022-01-07 16:46:24 +02:00

ethkey

ethkey is a simple command-line tool for working with Ethereum keyfiles.

Usage

ethkey generate

Generate a new keyfile. If you want to use an existing private key to use in the keyfile, it can be specified by setting --privatekey with the location of the file containing the private key.

ethkey inspect <keyfile>

Print various information about the keyfile. Private key information can be printed by using the --private flag; make sure to use this feature with great caution!

ethkey signmessage <keyfile> <message/file>

Sign the message with a keyfile. It is possible to refer to a file containing the message. To sign a message contained in a file, use the --msgfile flag.

ethkey verifymessage <address> <signature> <message/file>

Verify the signature of the message. It is possible to refer to a file containing the message. To sign a message contained in a file, use the --msgfile flag.

ethkey changepassword <keyfile>

Change the password of a keyfile. use the --newpasswordfile to point to the new password file.

Passwords

For every command that uses a keyfile, you will be prompted to provide the password for decrypting the keyfile. To avoid this message, it is possible to pass the password by using the --passwordfile flag pointing to a file that contains the password.

JSON

In case you need to output the result in a JSON format, you shall by using the --json flag.