chore: add a helpful ed25519 key generator
This commit is contained in:
parent
ac80e17f79
commit
ede045e756
22
cmd/mkkey/main.go
Normal file
22
cmd/mkkey/main.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"crypto/ed25519"
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pubkey, prvkey, err := ed25519.GenerateKey(rand.Reader)
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Printf(
|
||||
"PUBLIC KEY: %s\nPRIVATE KEY: %s\n",
|
||||
hex.EncodeToString(pubkey),
|
||||
hex.EncodeToString(prvkey),
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue
Block a user