mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-01 00:53:47 +00:00
Method for creating a new key from scratch
This commit is contained in:
parent
1fbea2e438
commit
dccef70728
1 changed files with 6 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue