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

23 lines
453 B
Go
Raw Normal View History

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