Documentation
¶
Index ¶
- func GenerateCA() ([]byte, *rsa.PrivateKey, error)
- func GenerateCert(ca []byte, commonName string, extraSANs []string, caPrivateKey *rsa.PrivateKey) ([]byte, *rsa.PrivateKey, error)
- func PEMEncodeCertificate(certificate []byte) ([]byte, error)
- func PEMEncodePrivateKey(privateKey *rsa.PrivateKey) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCA ¶
func GenerateCA() ([]byte, *rsa.PrivateKey, error)
GenerateCA generates a self-signed CA root certificate and private key The certificate is valid for 10 years.
func GenerateCert ¶
func GenerateCert(ca []byte, commonName string, extraSANs []string, caPrivateKey *rsa.PrivateKey, ) ([]byte, *rsa.PrivateKey, error)
GenerateCert generates a certificate and private key signed by the provided CA. The certificate is valid for 10 years.
func PEMEncodeCertificate ¶
PEMEncodeCertificate encodes a certificate to PEM format.
func PEMEncodePrivateKey ¶
func PEMEncodePrivateKey(privateKey *rsa.PrivateKey) ([]byte, error)
PEMEncodePrivateKey encodes a private key to PEM format.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.