Documentation
¶
Index ¶
- type CertPoolConfig
- type CertPoolConstructor
- type CertificateByteConfig
- type CertificateByteConstructor
- type CertificateConfig
- type CertificateConstructor
- type CertificateFileConfig
- type CertificateFileConstructor
- type Config
- type Constructor
- type RandConfig
- type RandConstructor
- type RandCryptoConfig
- type RandCryptoConstructor
- type RandZeroConfig
- type RandZeroConstructor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertPoolConfig ¶
type CertPoolConfig struct {
CertificateConfig
}
CertPoolConfig is a container for options related to client certificate pool construction.
type CertPoolConstructor ¶
type CertPoolConstructor struct {
Certificates *CertificateConstructor
}
CertPoolConstructor builds a client x509 certificate pool that is used to verify server certificates.
func NewCertPoolConstructor ¶
func NewCertPoolConstructor() *CertPoolConstructor
NewCertPoolConstructor generates a default constructor.
func (*CertPoolConstructor) New ¶
func (c *CertPoolConstructor) New(ctx context.Context, conf *CertPoolConfig) (*x509.CertPool, error)
New generates an x509 certificate pool. If not custom certificates are defined then it defaults to nil which triggers the default TLS configuration behavior in Go.
func (*CertPoolConstructor) Settings ¶
func (c *CertPoolConstructor) Settings() *CertPoolConfig
Settings generates the default configurations.
type CertificateByteConfig ¶
CertificateByteConfig contains settings for loading a cert from provided byte strings. This is used in cases where the full cert and key blocks are provided as configuration rather than being pre-stored on a host.
type CertificateByteConstructor ¶
type CertificateByteConstructor struct{}
CertificateByteConstructor is used to load certs from byte strings.
func NewCertificateByteConstructor ¶
func NewCertificateByteConstructor() *CertificateByteConstructor
NewCertificateByteConstructor generates a default CertificateByteConstructor.
func (*CertificateByteConstructor) New ¶
func (c *CertificateByteConstructor) New(ctx context.Context, conf *CertificateByteConfig) (tls.Certificate, error)
New constructs a certificate from byte strings.
func (*CertificateByteConstructor) Settings ¶
func (c *CertificateByteConstructor) Settings() *CertificateByteConfig
Settings generates the default configuration.
type CertificateConfig ¶
type CertificateConfig struct {
Files []CertificateFileConfig
Bytes []CertificateByteConfig
}
CertificateConfig is an aggregate container for certificate options.
type CertificateConstructor ¶
type CertificateConstructor struct {
Files *CertificateFileConstructor
Bytes *CertificateByteConstructor
}
CertificateConstructor is an aggregate constructor for generate certificates.
func NewCertificateConstructor ¶
func NewCertificateConstructor() *CertificateConstructor
NewCertificateConstructor generates a default constructor.
func (*CertificateConstructor) New ¶
func (c *CertificateConstructor) New(ctx context.Context, conf *CertificateConfig) ([]tls.Certificate, error)
New generates a slice of certifcates to use
func (*CertificateConstructor) Settings ¶
func (c *CertificateConstructor) Settings() *CertificateConfig
Settings generates the default configuration.
type CertificateFileConfig ¶
CertificateFileConfig contains settings for loading a cert from a local file. Each value represents a file path.
type CertificateFileConstructor ¶
type CertificateFileConstructor struct{}
CertificateFileConstructor is used to load certs from local files.
func NewCertificateFileConstructor ¶
func NewCertificateFileConstructor() *CertificateFileConstructor
NewCertificateFileConstructor generates a default CertificateFileConstructor.
func (*CertificateFileConstructor) New ¶
func (c *CertificateFileConstructor) New(ctx context.Context, conf *CertificateFileConfig) (tls.Certificate, error)
New constructs a certificate from file paths.
func (*CertificateFileConstructor) Settings ¶
func (c *CertificateFileConstructor) Settings() *CertificateFileConfig
Settings generates the default configuration.
type Config ¶
type Config struct {
Rand *RandConfig
Certificates *CertificateConfig
RootCAs *CertPoolConfig
ClientCAs *CertPoolConfig
ServerName *string
ClientAuth *string
InsecureSkipVerify *bool
}
Config contains settings for constructing a tls.Config.
type Constructor ¶
type Constructor struct {
Rand *RandConstructor
Certificates *CertificateConstructor
RootCAs *CertPoolConstructor
ClientCAs *CertPoolConstructor
}
Constructor creates tls.Configuration instances.
func NewConstructor ¶
func NewConstructor() *Constructor
NewConstructor generates a default constructor.
func (*Constructor) Settings ¶
func (c *Constructor) Settings() *Config
Settings generates the default configurations.
type RandConfig ¶
type RandConfig struct {
Zero *RandZeroConfig
Crypto *RandCryptoConfig
Choice string
}
RandConfig is an aggregate of all random related options.
type RandConstructor ¶
type RandConstructor struct {
Zero *RandZeroConstructor
Crypto *RandCryptoConstructor
}
RandConstructor selects between available choices.
func NewRandConstructor ¶
func NewRandConstructor() *RandConstructor
NewRandConstructor generates a default constructor.
func (*RandConstructor) New ¶
func (c *RandConstructor) New(ctx context.Context, conf *RandConfig) (io.Reader, error)
New selects a random implementation.
func (*RandConstructor) Settings ¶
func (c *RandConstructor) Settings() *RandConfig
Settings generates the default configuration.
type RandCryptoConfig ¶
type RandCryptoConfig struct{}
RandCryptoConfig contains configuration options for the crypto/rand source.
type RandCryptoConstructor ¶
type RandCryptoConstructor struct{}
RandCryptoConstructor generates a crypto/rand based random source.
func NewRandCryptoConstructor ¶
func NewRandCryptoConstructor() *RandCryptoConstructor
NewRandCryptoConstructor generates a default constructor.
func (*RandCryptoConstructor) New ¶
func (c *RandCryptoConstructor) New(ctx context.Context, conf *RandCryptoConfig) (io.Reader, error)
New generates a crypto/rand based random source.
func (*RandCryptoConstructor) Settings ¶
func (c *RandCryptoConstructor) Settings() *RandCryptoConfig
Settings generates the default constructor input.
type RandZeroConfig ¶
type RandZeroConfig struct{}
RandZeroConfig contains configuration options for the zero random source.
type RandZeroConstructor ¶
type RandZeroConstructor struct{}
RandZeroConstructor generates a zero based random source.
func NewRandZeroConstructor ¶
func NewRandZeroConstructor() *RandZeroConstructor
NewRandZeroConstructor generates a default constructor.
func (*RandZeroConstructor) New ¶
func (c *RandZeroConstructor) New(ctx context.Context, conf *RandZeroConfig) (io.Reader, error)
New generates a zero based random source.
func (*RandZeroConstructor) Settings ¶
func (c *RandZeroConstructor) Settings() *RandZeroConfig
Settings generates the default constructor input.