Documentation ¶
Index ¶
- Constants
- func CA() (cert *x509.Certificate, key crypto.PrivateKey, err error)
- func CAPEM() (cert []byte, key []byte, err error)
- func Cert(sans ...string) (tls.Certificate, error)
- func Key() (priv *ecdsa.PrivateKey, err error)
- func LocalSANs() []string
- func PEM(sans ...string) (cert []byte, key []byte, err error)
- func Pool(cert tls.Certificate) (*x509.CertPool, error)
Constants ¶
View Source
const ( // SerialNumber is a constant magic number used in generated certificates. SerialNumber = 42 // Organization is used in the x509 subject. Organization = "Insecure; DO NOT USE IN PRODUCTION" )
Variables ¶
This section is empty.
Functions ¶
func CA ¶
func CA() (cert *x509.Certificate, key crypto.PrivateKey, err error)
CA returns the mkcert CA certificate and key if found. Returns an error if either fail to load or parse.
func CAPEM ¶
CAPEM returns the raw PEM mkcert CA certificate and key if found. Returns an error if either doesn’t exist or fails to load.
func Cert ¶
func Cert(sans ...string) (tls.Certificate, error)
Cert returns a deterministic self-signed certificate and private key for the specified list of SANs. If SANs are not specified, a default set of local SANs will be used.
func Key ¶
func Key() (priv *ecdsa.PrivateKey, err error)
Key returns a P-256 ECDSA private key generated WITHOUT randomess.
func LocalSANs ¶
func LocalSANs() []string
LocalSANs is a default list of local SANs (Subject Alternative Names) used for generating an insecure local certificate. The return value may be mutated.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.