aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-06-01 10:41:29 +0200
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-06-01 10:41:29 +0200
commit17a1cf31764541daa509cf59f1bbb32c25b28c8c (patch)
tree6ce80deed5c6fa389e65a1ac23218f4ab8b7c8c2
parentb853bb6095179c56c8605b1da920b5b3bda21f67 (diff)
added keygen command
-rw-r--r--client/cmd/keygen/main.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/client/cmd/keygen/main.go b/client/cmd/keygen/main.go
new file mode 100644
index 0000000..c1c1b58
--- /dev/null
+++ b/client/cmd/keygen/main.go
@@ -0,0 +1,17 @@
+package main
+
+import (
+ "crypto/ed25519"
+ "crypto/rand"
+ "fmt"
+ "log"
+)
+
+func main() {
+ vk, sk, err := ed25519.GenerateKey(rand.Reader)
+ if err != nil {
+ log.Fatalf("GenerateKey: %v", err)
+ }
+ fmt.Printf("sk: %x\n", sk[:])
+ fmt.Printf("vk: %x\n", vk[:])
+}