mi-v1/tools/paseto-key-gen.go

22 lines
331 B
Go

//+build ignore
package main
import (
"crypto/ed25519"
"encoding/hex"
"fmt"
)
func main() {
publicKey, privateKey, err := ed25519.GenerateKey(nil)
if err != nil {
panic(err)
}
fmt.Printf(
"PASETO_PUBLIC_KEY=%s\nPASETO_PRIVATE_KEY=%s\n",
hex.EncodeToString(publicKey),
hex.EncodeToString([]byte(privateKey)),
)
}