display the private key

This commit is contained in:
Wei Yang 2017-10-20 08:44:58 +08:00
parent 5c88b24c2c
commit c410eb2f1d
1 changed files with 5 additions and 1 deletions

View File

@ -6,9 +6,13 @@ import (
)
func (cli *CLI) generateKey() {
_, public := newKeyPair()
private, public := newKeyPair()
fmt.Println("Public Key:")
fmt.Println(hex.EncodeToString(public))
priKey := append(private.PublicKey.X.Bytes(), private.PublicKey.Y.Bytes()...)
priKey = append(priKey, private.D.Bytes()...)
fmt.Println("Private Key:")
fmt.Printf("%d%s\n", private.Curve, hex.EncodeToString(priKey))
}
func (cli *CLI) getAddress(pubKey string) {