23 lines
453 B
Go
23 lines
453 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"forge.cadoles.com/Cadoles/go-http-peering/crypto"
|
|
"github.com/pkg/errors"
|
|
|
|
peering "forge.cadoles.com/Cadoles/go-http-peering"
|
|
)
|
|
|
|
func createToken() {
|
|
privateKey, err := loadPrivateKey()
|
|
if err != nil {
|
|
handleError(errors.WithStack(err))
|
|
}
|
|
token, err := crypto.CreateServerToken(privateKey, tokenIssuer, peering.PeerID(tokenPeerID))
|
|
if err != nil {
|
|
handleError(errors.WithStack(err))
|
|
}
|
|
fmt.Println(token)
|
|
}
|