Documentation ¶
Index ¶
- func GenerateAndSave(caPath string, caKeyPath string) error
- func NewAuthority(name, organization string, validity time.Duration) (*x509.Certificate, *rsa.PrivateKey, error)
- type CertsStorage
- type Config
- func (c *Config) GetCA() *x509.Certificate
- func (c *Config) GetOrCreateCert(hostname string, ips ...net.IP) (*tls.Certificate, error)
- func (c *Config) NewTLSConfigForHost(hostname string) *tls.Config
- func (c *Config) SetOrganization(organization string)
- func (c *Config) SetValidity(validity time.Duration)
- type DomainTrieCertsStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAndSave ¶
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 (*Config) NewTLSConfigForHost ¶
func (*Config) SetOrganization ¶
func (*Config) SetValidity ¶
type DomainTrieCertsStorage ¶
type DomainTrieCertsStorage struct {
// contains filtered or unexported fields
}
DomainTrieCertsStorage cache wildcard certificates
func NewDomainTrieCertsStorage ¶
func NewDomainTrieCertsStorage() *DomainTrieCertsStorage
func (*DomainTrieCertsStorage) Get ¶
func (c *DomainTrieCertsStorage) Get(key string) (*tls.Certificate, bool)
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
Click to show internal directories.
Click to hide internal directories.