cfssl: github.com/cloudflare/cfssl/transport/ca/localca Index | Files

package localca

import "github.com/cloudflare/cfssl/transport/ca/localca"

Package localca implements a localca that is useful for testing the transport package. To use the localca, see the New and Load functions.

Index

Package Files

signer.go

func ExampleRequest Uses

func ExampleRequest() *csr.CertificateRequest

ExampleRequest can be used as a sample request, or the returned request can be modified.

func ExampleSigningConfig Uses

func ExampleSigningConfig() *config.Signing

ExampleSigningConfig returns a sample config.Signing with only a default profile.

func Load Uses

func Load(lca *CA, profiles *config.Signing) (err error)

Load reads the key and certificate from the files specified in the CA.

type CA Uses

type CA struct {

    // Label and Profile are used to select the CFSSL signer
    // components if they should be anything but the default.
    Label   string `json:"label"`
    Profile string `json:"profile"`

    // The KeyFile and CertFile are required when using Load to
    // construct a CA.
    KeyFile  string `json:"private_key,omitempty"`
    CertFile string `json:"certificate,omitempty"`
    // contains filtered or unexported fields
}

CA is a local transport CertificateAuthority that is useful for tests.

func New Uses

func New(req *csr.CertificateRequest, profiles *config.Signing) (*CA, error)

New generates a new CA from a certificate request and signing profile.

func NewFromSigner Uses

func NewFromSigner(s *local.Signer) *CA

NewFromSigner constructs a local CA from a CFSSL signer.

func (*CA) CACertificate Uses

func (lca *CA) CACertificate() ([]byte, error)

CACertificate returns the certificate authority's certificate.

func (*CA) SignCSR Uses

func (lca *CA) SignCSR(csrPEM []byte) ([]byte, error)

SignCSR submits a PKCS #10 certificate signing request to a CA for signing.

func (*CA) Toggle Uses

func (lca *CA) Toggle()

Toggle switches the CA between operable mode and inoperable mode. This is useful in testing to verify behaviours when a CA is unavailable.

Package localca imports 11 packages (graph). Updated 2019-07-04. Refresh now. Tools for package owners.