forked from cerc-io/plugeth
Method for creating a new key from scratch
This commit is contained in:
parent
1fbea2e438
commit
dccef70728
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user