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

21 lines
384 B
Go

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))
}