func (sp *StandardProvider) Persistent() bool {
	return sp.Paths.KeyFile != "" && sp.Paths.CertFile != ""
}
Persistent returns true if the key and certificate will be stored
on disk.
package kp
import (
	"crypto"
	"crypto/ecdsa"
	"crypto/elliptic"
	"crypto/rand"
	"crypto/rsa"
	"crypto/tls"
	"crypto/x509"
	"encoding/pem"
	"errors"
	"io/ioutil"
	"strings"
	"github.com/cloudflare/cfssl/csr"
	"github.com/cloudflare/cfssl/helpers"
	"github.com/cloudflare/cfssl/transport/core"
)
const (
	curveP256 = 256
	curveP384 = 384
	curveP521 = 521
)
type KeyProvider interface {
	Certificate() *x509.Certificate
	CertificateRequest(*csr.CertificateRequest) ([]byte, error)
	Check() error
	Generate(algo string, size int) error
	Load() error
	Persistent() bool
	Ready() bool
	SetCertificatePEM([]byte) error
	SignalFailure(err error) bool
	SignCSR(csr *x509.CertificateRequest) ([]byte, error)
	Store() error
	X509KeyPair() (tls.Certificate, error)
}
type StandardPaths struct {
	KeyFile  string `json:"private_key"`
	CertFile string `json:"certificate"`
}
type StandardProvider struct {
	Paths    StandardPaths `json:"paths"`
	internal struct {
		priv crypto.Signer
		cert *x509.Certificate
		keyPEM  []byte
		certPEM []byte
	}
}
func NewStandardProvider(id *core.Identity) (*StandardProvider, error) {
	if id == nil {
		return nil, errors.New("transport: the identity hasn't been initialised. Has it been loaded from disk?")
	}
	paths := id.Profiles["paths"]
	if paths == nil {
		return &StandardProvider{}, nil
	}
	sp := &StandardProvider{
		Paths: StandardPaths{
			KeyFile:  paths["private_key"],
			CertFile: paths["certificate"],
		},
	}
	err := sp.Check()
	if err != nil {
		return nil, err
	}
	return sp, nil
}
func (sp *StandardProvider) resetCert() {
	sp.internal.cert = nil
	sp.internal.certPEM = nil
}
func (sp *StandardProvider) resetKey() {
	sp.internal.priv = nil
	sp.internal.keyPEM = nil
}
var (
	ErrMissingKeyPath = errors.New("transport: standard provider is missing a private key path to accompany the certificate path")
	ErrMissingCertPath = errors.New("transport: standard provider is missing a certificate path to accompany the certificate path")
)
func (sp *StandardProvider) Check() error {
	if sp.Paths.KeyFile == "" && sp.Paths.CertFile == "" {
		return nil
	}
	if sp.Paths.KeyFile == "" {
		return ErrMissingKeyPath
	}
	if sp.Paths.CertFile == "" {
		return ErrMissingCertPath
	}
	return nil
}