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

20 lines
322 B
Go

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