Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTLSCert ¶
func GenerateTLSCert(serial *big.Int, subject *pkix.Name, dnsNames []string, notBefore, notAfter *time.Time, privKey crypto.PrivateKey, makeRsa bool) (*tls.Certificate, error)
GenerateTLSCert will generate a new certificate. Nil values in the parameters are replaced with random or blank values.
If makeRsa is set to true, the key generated is an RSA key (EC by default).
If a nil date is passed in for notBefore and notAfter, a random date is picked in the last year.
If a nil date is passed in for notAfter, the date is set to be 2 years after the date provided (or generated) in the notBefore parameter.
Please ensure privkey is a proper private key. The go implementation of this value is challenging, so no type assertion can be made in the function definition.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.