Documentation
¶
Overview ¶
Package tls provides helpers
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCert ¶
GenerateCert generates key.pem, cert.pem file contents and write them through io.Writer interfaces.
opts.Host is a required value. opts.validFor defaults to 1 year, opts.RSABits defaults to 2048.
Types ¶
type Options ¶
type Options struct {
Host string
//ValidFrom is creation date formatted as Jan 1 15:04:05 2011
ValidFrom string
//ValidFor is the duration that certificate is valid for
ValidFor time.Duration
//IsCA is whether this cert should be its own Certificate Authority
IsCA bool
//RSABits is the size of RSA key to generate. Ignored if EcdsaCurve is set
RSABits int
//ECDSA is the ECDSA curve to use to generate a key. Valid values are P224,
//P256 (recommended), P384, P521
ECDSACurve string
}
Options is the key and certficate options for generate functions
Click to show internal directories.
Click to hide internal directories.