aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ethutil/keypair.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/ethutil/keypair.go b/ethutil/keypair.go
index cf5882e2c..29fb1bac5 100644
--- a/ethutil/keypair.go
+++ b/ethutil/keypair.go
@@ -12,6 +12,12 @@ type KeyPair struct {
account *StateObject
}
+func GenerateNewKeyPair() (*KeyPair, error) {
+ _, prv := secp256k1.GenerateKeyPair()
+
+ return NewKeyPairFromSec(prv)
+}
+
func NewKeyPairFromSec(seckey []byte) (*KeyPair, error) {
pubkey, err := secp256k1.GeneratePubKey(seckey)
if err != nil {