Documentation
¶
Overview ¶
Package mkcert is a library adaptation of https://github.com/FiloSottile/mkcert (which is intentionally not importable as a Go module). It creates and loads the local development CA in mkcert's CAROOT using mkcert's exact file format and naming, so the CA is fully shared with the mkcert tool: a CA created by mkcert is reused here, a CA created here works with "mkcert -install" and certificates issued by either are interchangeable.
The code is adapted from mkcert's cert.go and main.go: it returns errors instead of exiting, and the PKCS#12, CSR and client-certificate paths are removed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CA ¶
type CA struct {
Cert *x509.Certificate
// contains filtered or unexported fields
}
CA is the local development certificate authority stored in CAROOT.
func LoadOrCreateCA ¶
LoadOrCreateCA loads the CA from CAROOT, creating a new one first when none exists yet (adapted from mkcert's loadCA/newCA). It returns the CA and whether it was newly created.