cert

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: GPL-3.0 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

func NewAuthority

func NewAuthority(name, organization string, validity time.Duration) (*x509.Certificate, *rsa.PrivateKey, error)

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(ca *x509.Certificate, caPrivateKey *rsa.PrivateKey) (*Config, error)

func (*Config) GetCA

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

func (*Config) GetOrCreateCert

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

func (*Config) NewTLSConfigForHost

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

func (*Config) SetOrganization

func (c *Config) SetOrganization(organization string)

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