tls

package
v2.4.8 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTLSCertExpiresSoon = fmt.Errorf("TLS certificate will expire soon")

Functions

func GetConfigFromPEMKeyPair added in v2.4.3

func GetConfigFromPEMKeyPair(permCert, pemKey []byte) (*tls.Config, error)

GetConfigFromPEMKeyPair load a TLS config from PEM encoded certificate and key.

func NewPEMKeyPair added in v2.4.3

func NewPEMKeyPair() (pemCert, pemKey []byte, err error)

NewPEMKeyPair return a new TLS private key and certificate in PEM encoded format.

func NewTLSTemplate

func NewTLSTemplate() (*x509.Certificate, error)

NewTLSTemplate creates a new TLS template certificate with a random serial number.

Types

type TLS

type TLS struct {
	// contains filtered or unexported fields
}

func New

func New(settingsPath string) *TLS

func (*TLS) GenerateCerts

func (t *TLS) GenerateCerts(template *x509.Certificate) error

GenerateCerts generates certs from the given template.

func (*TLS) GetConfig

func (t *TLS) GetConfig() (*tls.Config, error)

GetConfig tries to load TLS config or generate new one which is then returned.

func (*TLS) HasCerts

func (t *TLS) HasCerts() bool

HasCerts returns whether TLS certs have been generated.

func (*TLS) InstallCerts

func (t *TLS) InstallCerts() error

func (*TLS) UninstallCerts

func (t *TLS) UninstallCerts() error

Jump to

Keyboard shortcuts

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