tlscerts

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package tlscerts provides a store for TLS certificates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// CertLists is a list of TLS certificate lists.
	CertLists []TLSCertListConfig `json:"certLists"`

	// X509CertPools is a list of X.509 certificate pools.
	X509CertPools []X509CertPoolConfig `json:"x509CertPools"`
}

Config is the configuration for the TLS certificate store.

func (*Config) NewStore

func (c *Config) NewStore() (*Store, error)

NewStore creates a new store for TLS certificates.

type Store

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

Store is a store for TLS certificates.

func (*Store) GetCertList

func (s *Store) GetCertList(name string) (certs []tls.Certificate, getCert func(*tls.ClientHelloInfo) (*tls.Certificate, error), ok bool)

GetCertList gets a TLS server certificate list by name.

func (*Store) GetClientCertList

func (s *Store) GetClientCertList(name string) (certs []tls.Certificate, getClientCert func(*tls.CertificateRequestInfo) (*tls.Certificate, error), ok bool)

GetClientCertList gets a TLS client certificate list by name.

func (*Store) GetX509CertPool

func (s *Store) GetX509CertPool(name string) (pool *x509.CertPool, ok bool)

GetX509CertPool gets an X.509 certificate pool by name.

type TLSCertConfig

type TLSCertConfig struct {
	// CertPath is the path to the PEM-encoded certificate.
	CertPath string `json:"certPath"`

	// KeyPath is the path to the PEM-encoded private key.
	KeyPath string `json:"keyPath"`
}

TLSCertConfig is the configuration for a TLS certificate.

func (*TLSCertConfig) Load

func (c *TLSCertConfig) Load() (cert tls.Certificate, err error)

Load loads the TLS certificate.

type TLSCertListConfig

type TLSCertListConfig struct {
	// Name is the name of the certificate list.
	Name string `json:"name"`

	// Certs is a list of TLS certificates.
	Certs []TLSCertConfig `json:"certs"`
}

TLSCertListConfig is the configuration for a list of TLS certificates.

func (*TLSCertListConfig) Load

func (c *TLSCertListConfig) Load() (certs []tls.Certificate, err error)

Load loads the TLS certificate list.

type X509CertPoolConfig

type X509CertPoolConfig struct {
	// Name is the name of the certificate pool.
	Name string `json:"name"`

	// CertPaths is a list of paths to PEM-encoded certificates.
	CertPaths []string `json:"certPaths"`
}

X509CertPoolConfig is the configuration for an X.509 certificate pool.

func (*X509CertPoolConfig) Load

func (c *X509CertPoolConfig) Load() (pool *x509.CertPool, err error)

Load loads the X.509 certificate pool.

Jump to

Keyboard shortcuts

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