From 43535b44c3135bbe950dc08f433316d77a3674bd Mon Sep 17 00:00:00 2001 From: Cadey Dodrill Date: Thu, 19 Jan 2017 17:14:45 -0800 Subject: [PATCH] cmd/api: generate an RSA key with requests --- cmd/api/main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/api/main.go b/cmd/api/main.go index 703e6b8..8e5cb19 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -1,6 +1,8 @@ package main import ( + "crypto/rand" + "crypto/rsa" "log" "net/rpc" @@ -13,9 +15,14 @@ func main() { log.Fatal(err) } + pKey, err := rsa.GenerateKey(rand.Reader, 1024) + if err != nil { + log.Fatal(err) + } + req := routerpc.AddHostRequest{ APIKey: "hunter2", - PrivKey: nil, + PrivKey: pKey, } resp := &routerpc.AddHostResponse{}