func (c *Info) PublicKey() []byte {
	data := c.KeyPair().Certificate[0]
	return pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: data})
}
PublicKey is a convenience to encode the underlying public key to ASCII.
package cert
import (
	"crypto/rsa"
	"crypto/sha256"
	"crypto/tls"
	"crypto/x509"
	"encoding/pem"
	"fmt"
	"github.com/pkg/errors"
)
type Info struct {
	keypair tls.Certificate
	ca      *x509.Certificate
}
func NewInfo(keypair tls.Certificate, ca *x509.Certificate) *Info {
	return &Info{
		keypair: keypair,
		ca:      ca,
	}
}
func (c *Info) KeyPair() tls.Certificate {
	return c.keypair
}
func (c *Info) CA() *x509.Certificate {
	return c.ca
}