cert

package
v1.53.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAndSave

func GenerateAndSave(caPath string, caKeyPath string) error

GenerateAndSave generate CA private key and CA certificate and dump them to file

Types

type CertsStorage

type CertsStorage interface {
	Get(key string) (*tls.Certificate, bool)

	Set(key string, cert *tls.Certificate)
}

type Config

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

func NewConfig

func NewConfig(rootCA *x509.Certificate, rootPrivateKey any) (*Config, error)

func (*Config) GetOrCreateCert

func (c *Config) GetOrCreateCert(hostname string, ips ...net.IP) (*tls.Certificate, error)

func (*Config) GetRootCA

func (c *Config) GetRootCA() *x509.Certificate

func (*Config) NewTLSConfigForHost

func (c *Config) NewTLSConfigForHost(hostname string) *tls.Config

func (*Config) SetValidity

func (c *Config) SetValidity(validity time.Duration)

type DomainTrieCertsStorage

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

DomainTrieCertsStorage cache wildcard certificates

func NewDomainTrieCertsStorage

func NewDomainTrieCertsStorage() *DomainTrieCertsStorage

func (*DomainTrieCertsStorage) Get

Get gets the certificate from the storage

func (*DomainTrieCertsStorage) Set

func (c *DomainTrieCertsStorage) Set(key string, cert *tls.Certificate)

Set saves the certificate to the storage

Jump to

Keyboard shortcuts

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