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

20 lines
323 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"
2019-02-22 17:35:49 +01:00
)
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))
}