func (k *KeyPair) OutputPublicKeyPem() (string, error) {
    der := k.OutputPublicKeyDer()
    if der == nil {
        return "", errors.New("failed to export the public key to pem format")
    }