cfssl: github.com/cloudflare/cfssl/api/generator Index | Files

package generator

import "github.com/cloudflare/cfssl/api/generator"

Package generator implements the HTTP handlers for certificate generation.

Index

Package Files

generator.go

Constants

const (
    CSRNoHostMessage = "" /* 315 byte string literal not displayed */

    NoBundlerMessage = `This request requires a bundler, but one is not initialized for the API server.`
)

func CSRValidate Uses

func CSRValidate(req *csr.CertificateRequest) error

CSRValidate does nothing and will never return an error. It exists because NewHandler requires a Validator as a parameter.

func NewCertGeneratorHandler Uses

func NewCertGeneratorHandler(validator Validator, caFile, caKeyFile string, policy *config.Signing) (http.Handler, error)

NewCertGeneratorHandler builds a new handler for generating certificates directly from certificate requests; the validator covers the certificate request and the CA's key and certificate are used to sign the generated request. If remote is not an empty string, the handler will send signature requests to the CFSSL instance contained in remote.

func NewCertGeneratorHandlerFromSigner Uses

func NewCertGeneratorHandlerFromSigner(validator Validator, signer signer.Signer) http.Handler

NewCertGeneratorHandlerFromSigner returns a handler directly from the signer and validation function.

func NewHandler Uses

func NewHandler(validator Validator) (http.Handler, error)

NewHandler builds a new Handler from the validation function provided.

type CertGeneratorHandler Uses

type CertGeneratorHandler struct {
    // contains filtered or unexported fields
}

A CertGeneratorHandler accepts JSON-encoded certificate requests and returns a new private key and signed certificate; it handles sending the CSR to the server.

func (*CertGeneratorHandler) Handle Uses

func (cg *CertGeneratorHandler) Handle(w http.ResponseWriter, r *http.Request) error

Handle responds to requests for the CA to generate a new private key and certificate on behalf of the client. The format for these requests is documented in the API documentation.

func (*CertGeneratorHandler) SetBundler Uses

func (cg *CertGeneratorHandler) SetBundler(caBundleFile, intBundleFile string) (err error)

SetBundler allows injecting an optional Bundler into the CertGeneratorHandler.

type CertRequest Uses

type CertRequest struct {
    Key  string         `json:"private_key"`
    CSR  string         `json:"certificate_request"`
    Sums map[string]Sum `json:"sums"`
}

A CertRequest stores a PEM-encoded private key and corresponding CSR; this is returned from the CSR generation endpoint.

type Handler Uses

type Handler struct {
    // contains filtered or unexported fields
}

A Handler accepts JSON-encoded certificate requests and returns a new private key and certificate request.

func (*Handler) Handle Uses

func (g *Handler) Handle(w http.ResponseWriter, r *http.Request) error

Handle responds to requests for the CA to generate a new private key and certificate request on behalf of the client. The format for these requests is documented in the API documentation.

type Sum Uses

type Sum struct {
    MD5  string `json:"md5"`
    SHA1 string `json:"sha-1"`
}

Sum contains digests for a certificate or certificate request.

type Validator Uses

type Validator func(*csr.CertificateRequest) error

Validator is a type of function that contains the logic for validating a certificate request.

Package generator imports 16 packages (graph) and is imported by 120 packages. Updated 2019-07-09. Refresh now. Tools for package owners.