func (a *Authority) CreateTransport(before time.Duration, request *csr.CertificateRequest) (*transport.Transport, error) {
	ident := a.createIdentityStub()
	ident.Request = request
	return transport.New(before, ident)
}
CreateTransport converts an Authority and CertificateRequest into a cfssl transport for usage.
package cert
import (
	"crypto/tls"
	"crypto/x509"
	"encoding/json"
	"encoding/pem"
	"io/ioutil"
	"time"
	"github.com/cloudflare/cfssl/api/client"
	"github.com/cloudflare/cfssl/csr"
	"github.com/cloudflare/cfssl/info"
	"github.com/cloudflare/cfssl/transport"
	"github.com/cloudflare/cfssl/transport/core"
	"github.com/pkg/errors"
)
type Authority struct {
	Remote  string `json:"remote" yaml:"remote"`
	Label   string `json:"label" yaml:"label"`
	Profile string `json:"profile" yaml:"profile"`
	AuthKey string `json:"auth_key" yaml:"auth_key"`
	RootCACert string `json:"root_ca,omitempty" yaml:"root_ca,omitempty"`
}
func (a *Authority) createIdentityStub() *core.Identity {
	return &core.Identity{
		Roots: []*core.Root{
			&core.Root{
				Type: "system",
			},
			&core.Root{
				Type: "cfssl",
				Metadata: map[string]string{
					"host":          a.Remote,
					"profile":       a.Profile,
					"label":         a.Label,
					"tls-remote-ca": a.RootCACert,
				},
			},
		},
		Profiles: map[string]map[string]string{
			"cfssl": map[string]string{
				"remote":        a.Remote,
				"profile":       a.Profile,
				"label":         a.Label,
				"tls-remote-ca": a.RootCACert,
				"auth-type":     "standard",
				"auth-key":      a.AuthKey,
			},
		},
	}
}