go-http-peering/cmd/keygen/create_token.go

22 lines
390 B
Go
Raw Normal View History

2019-02-22 17:35:49 +01:00
package main
import (
"fmt"
"forge.cadoles.com/wpetit/go-http-peering/crypto"
peering "forge.cadoles.com/wpetit/go-http-peering"
)
func createToken() {
privateKey, err := loadPrivateKey()
if err != nil {
handleError(err)
}
token, err := crypto.CreateServerToken(privateKey, tokenIssuer, peering.PeerID(tokenPeerID))
if err != nil {
handleError(err)
}
fmt.Println(token)
}