Documentation ¶
Index ¶
- Constants
- func Generate(host, dest string, opts ...Option) error
- func ParsePemCertFile(path string) (*x509.Certificate, error)
- func ParsePemKeyFile(path string) (any, error)
- func Verify(rootCertPath, certPath, dnsName string) error
- type Option
- func WithCA() Option
- func WithCertFileName(certFileName string) Option
- func WithDuration(duration time.Duration) Option
- func WithED25519() Option
- func WithKeyFileName(keyFileName string) Option
- func WithP224() Option
- func WithP256() Option
- func WithP384() Option
- func WithP521() Option
- func WithRSABits(bits int) Option
- func WithSignByParent(parentCertPath, parentKeyPath string) Option
- func WithStartDate(startDate string) Option
Constants ¶
const ( CurveP224 = "P224" CurveP256 = "P256" CurveP384 = "P384" CurveP521 = "P521" )
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate a self-signed X.509 certificate for a TLS server. Outputs 'cert.pem' and 'key.pem' into dest directory and will overwrite existing files. host is a comma-separated hostnames and IPs to generate a certificate for
func ParsePemCertFile ¶ added in v1.0.2
func ParsePemCertFile(path string) (*x509.Certificate, error)
ParsePemCertFile parses the given pem certificate file
func ParsePemKeyFile ¶ added in v1.0.2
ParsePemKeyFile parses the given pem key file
Types ¶
type Option ¶
type Option func(*options)
func WithCertFileName ¶ added in v1.0.2
WithCertFileName the generated cert file name (default cert.pem)
func WithDuration ¶
WithDuration duration that certificate is valid for
func WithKeyFileName ¶ added in v1.0.2
WithKeyFileName the generated key file name (default key.pem)
func WithP256 ¶
func WithP256() Option
WithP256 ECDSA P256 (recommended) curve to use to generate a key
func WithRSABits ¶
WithRSABits size of RSA key to generate. Ignored if --ecdsa-curve is set
func WithSignByParent ¶ added in v1.0.2
WithSignByParent signs the generated certificate as parent (path of cert and key file of the signer)
func WithStartDate ¶
WithStartDate creation date formatted as Jan 1 15:04:05 2011