Commit dccef707 authored by obscuren's avatar obscuren

Method for creating a new key from scratch

parent 1fbea2e4
...@@ -12,6 +12,12 @@ type KeyPair struct { ...@@ -12,6 +12,12 @@ type KeyPair struct {
account *StateObject account *StateObject
} }
func GenerateNewKeyPair() (*KeyPair, error) {
_, prv := secp256k1.GenerateKeyPair()
return NewKeyPairFromSec(prv)
}
func NewKeyPairFromSec(seckey []byte) (*KeyPair, error) { func NewKeyPairFromSec(seckey []byte) (*KeyPair, error) {
pubkey, err := secp256k1.GeneratePubKey(seckey) pubkey, err := secp256k1.GeneratePubKey(seckey)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment