func (d *DefaultLeaf) ToPemParts() ([]byte, []byte, error) {
	certBuf := bytes.Buffer{}
	err := CertificateToPemWriter(&certBuf, map[string]string{
		HeaderLeafGroup: d.group,
	}, d.Certificate(), d.Chain()...)
	if err != nil {
		return nil, nil, errors.Annotate(err, "turning leaf certificate to pem")
	}

	keyBuf := bytes.Buffer{}
	err = SignerToPemWriter(&keyBuf, d.Signer())
	if err != nil {
		return nil, nil, errors.Annotate(err, "turning leaf key to pem")
	}

	return certBuf.Bytes(), keyBuf.Bytes(), nil
}
// ToPemParts implements Leaf interface ToPemParts
ToPemParts implements Leaf interface ToPemParts
// ToPemParts implements Leaf interface ToPemParts
func (d *DefaultLeaf) ToPemParts() ([]byte, []byte, error) {
	certBuf := bytes.Buffer{}
	err := CertificateToPemWriter(&certBuf, map[string]string{
		HeaderLeafGroup: d.group,
	}, d.Certificate(), d.Chain()...)
	if err != nil {
		return nil, nil, errors.Annotate(err, "turning leaf certificate to pem")
	}
	keyBuf := bytes.Buffer{}
	err = SignerToPemWriter(&keyBuf, d.Signer())
	if err != nil {
		return nil, nil, errors.Annotate(err, "turning leaf key to pem")
	}
	return certBuf.Bytes(), keyBuf.Bytes(), nil
}
func ( d * DefaultLeaf ) ToPemParts ( ) ( [ ] byte , [ ] byte , error ) { certBuf := bytes . Buffer { } err := CertificateToPemWriter ( & certBuf , map [ string ] string { HeaderLeafGroup : d . group , } , d . Certificate ( ) , d . Chain ( ) ... ) if err != nil { return nil , nil , errors . Annotate ( err , " " ) } keyBuf := bytes . Buffer { } err = SignerToPemWriter ( & keyBuf , d . Signer ( ) ) if err != nil { return nil , nil , errors . Annotate ( err , " " ) } return certBuf . Bytes ( ) , keyBuf . Bytes ( ) , nil }
ToPemParts implements Leaf interface ToPemParts
ToPemParts implements Leaf interface ToPemParts