package main import ( "fmt" "forge.cadoles.com/Cadoles/go-http-peering/crypto" "github.com/pkg/errors" ) func getPublicKey() { privateKey, err := loadPrivateKey() if err != nil { handleError(errors.WithStack(err)) } publicPEM, err := crypto.EncodePublicKeyToPEM(privateKey.Public()) if err != nil { handleError(errors.WithStack(err)) } fmt.Print(string(publicPEM)) }