func (kp KeyPair) TLSCertificate() (*tls.Certificate, error) {
	certBytes, err := kp.CertBytes()
	if err != nil {
		return nil, ex.New(err)
	}
	keyBytes, err := kp.KeyBytes()
	if err != nil {
		return nil, ex.New(err)
	}
	cert, err := tls.X509KeyPair(certBytes, keyBytes)
	if err != nil {
		return nil, ex.New(err)
	}
	return &cert, nil
}
// TLSCertificate returns the KeyPair as a tls.Certificate.
TLSCertificate returns the KeyPair as a tls.Certificate.
// TLSCertificate returns the KeyPair as a tls . Certificate .
func (kp KeyPair) TLSCertificate() (*tls.Certificate, error) {
	certBytes, err := kp.CertBytes()
	if err != nil {
		return nil, ex.New(err)
	}
	keyBytes, err := kp.KeyBytes()
	if err != nil {
		return nil, ex.New(err)
	}
	cert, err := tls.X509KeyPair(certBytes, keyBytes)
	if err != nil {
		return nil, ex.New(err)
	}
	return &cert, nil
}
func ( kp KeyPair ) TLSCertificate ( ) ( * tls . Certificate , error ) { certBytes , err := kp . CertBytes ( ) if err != nil { return nil , ex . New ( err ) } keyBytes , err := kp . KeyBytes ( ) if err != nil { return nil , ex . New ( err ) } cert , err := tls . X509KeyPair ( certBytes , keyBytes ) if err != nil { return nil , ex . New ( err ) } return & cert , nil }
TLSCertificate returns the KeyPair as a tls.Certificate.
TLSCertificate returns the KeyPair as a tls . Certificate .