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

20 lines
323 B
Go

package main
import (
"fmt"
"forge.cadoles.com/Cadoles/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))
}