func (v *Vault) NewKeyPair() (pub ecc.PublicKey, err error) {
	privKey, err := ecc.NewRandomPrivateKey()
	if err != nil {
		return
	}
	v.KeyBag.Keys = append(v.KeyBag.Keys, privKey)
	pub = privKey.PublicKey()
	return
}
NewKeyPair creates a new EOS keypair, saves the private key in the
local wallet and returns the public key. It does NOT save the
wallet, you better do that soon after.
package vault
import (
	"encoding/json"
	"fmt"
	"os"
	eos "github.com/eoscanada/eos-go"
	"github.com/eoscanada/eos-go/ecc"
)
type Vault struct {
	Kind    string `json:"kind"`
	Version int    `json:"version"`
	Comment string `json:"comment"`
	SecretBoxWrap       string `json:"secretbox_wrap"`
	SecretBoxCiphertext string `json:"secretbox_ciphertext"`
	KeyBag *eos.KeyBag `json:"-"`
}
func NewVaultFromWalletFile(filename string) (*Vault, error) {
	v := NewVault()
	fl, err := os.Open(filename)
	if err != nil {
		return nil, err
	}
	defer fl.Close()
	err = json.NewDecoder(fl).Decode(&v)
	if err != nil {
		return nil, err
	}
	return v, nil
}
func NewVaultFromKeysFile(keysFile string) (*Vault, error) {
	v := NewVault()
	if err := v.KeyBag.ImportFromFile(keysFile); err != nil {
		return nil, err
	}
	return v, nil
}
func NewVaultFromSingleKey(privKey string) (*Vault, error) {
	v := NewVault()
	key, err := ecc.NewPrivateKey(privKey)
	if err != nil {
		return nil, fmt.Errorf("import private key: %s", err)
	}
	v.KeyBag.Keys = append(v.KeyBag.Keys, key)
	return v, nil
}
func NewVault() *Vault {
	return &Vault{
		Kind:    "eosc-vault-wallet",
		Version: 1,
		KeyBag:  eos.NewKeyBag(),
	}
}