ztls

package
v0.12.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertFromCa

func CertFromCa(config *CertConfig, caCert tls.Certificate) (cert tls.Certificate, err error)

Creates a certificate signed by the given CA certificate.

func CreateCA

func CreateCA(config *CertConfig) (caCert tls.Certificate, err error)

func LoadCertOrCreateCert

func LoadCertOrCreateCert(config *LoadConfig, persistCerts bool) (cert, caCert tls.Certificate, err error)

Loads the given certs or creates self-signed ones if they don't exist.

func LoadOrCreateTLS

func LoadOrCreateTLS(config *LoadConfig, persistCerts bool) (tlsConfig *tls.Config, err error)

Loads the given TLS config or creates a self-signed one if it doesn't exist.

Types

type CertConfig

type CertConfig struct {
	SerialNumber *big.Int
	Ips          []net.IP
	Duration     time.Duration
	Subject      pkix.Name
	SubjectKeyId []byte
}

type LoadConfig

type LoadConfig struct {
	CAPath     string
	CAKeyPath  string
	CertPath   string
	KeyPath    string
	CertConfig *CertConfig
}

func (*LoadConfig) SetDefaults

func (c *LoadConfig) SetDefaults() (config *LoadConfig, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL