cmd/api: generate an RSA key with requests
This commit is contained in:
parent
cb6e57b670
commit
43535b44c3
|
@ -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{}
|
||||
|
||||
|
|
Loading…
Reference in New Issue