func NewDefaultLeaf(group string, cert *x509.Certificate,
	chain []*x509.Certificate, signer crypto.Signer) *DefaultLeaf {

	tlsCert := &tls.Certificate{
		Certificate: make([][]byte, len(chain)+1),
		PrivateKey:  signer,
		Leaf:        cert,
	}
	tlsCert.Certificate[0] = cert.Raw

	for i, chainCert := range chain {
		tlsCert.Certificate[i+1] = chainCert.Raw
	}

	return &DefaultLeaf{
		group:          group,
		certificate:    cert,
		chain:          chain,
		signer:         signer,
		tlsCertificate: tlsCert,
	}
}
// NewDefaultLeaf constructs a new DefaultLeaf for the supplied certificate and
// key
NewDefaultLeaf constructs a new DefaultLeaf for the supplied certificate and
key
// NewDefaultLeaf constructs a new DefaultLeaf for the supplied certificate and // key
func NewDefaultLeaf(group string, cert *x509.Certificate,
	chain []*x509.Certificate, signer crypto.Signer) *DefaultLeaf {
	tlsCert := &tls.Certificate{
		Certificate: make([][]byte, len(chain)+1),
		PrivateKey:  signer,
		Leaf:        cert,
	}
	tlsCert.Certificate[0] = cert.Raw
	for i, chainCert := range chain {
		tlsCert.Certificate[i+1] = chainCert.Raw
	}
	return &DefaultLeaf{
		group:          group,
		certificate:    cert,
		chain:          chain,
		signer:         signer,
		tlsCertificate: tlsCert,
	}
}
func NewDefaultLeaf ( group string , cert * x509 . Certificate , chain [ ] * x509 . Certificate , signer crypto . Signer ) * DefaultLeaf { tlsCert := & tls . Certificate { Certificate : make ( [ ] [ ] byte , len ( chain ) + 1 ) , PrivateKey : signer , Leaf : cert , } tlsCert . Certificate [ 0 ] = cert . Raw for i , chainCert := range chain { tlsCert . Certificate [ i + 1 ] = chainCert . Raw } return & DefaultLeaf { group : group , certificate : cert , chain : chain , signer : signer , tlsCertificate : tlsCert , } }
NewDefaultLeaf constructs a new DefaultLeaf for the supplied certificate and
key
NewDefaultLeaf constructs a new DefaultLeaf for the supplied certificate and key