Documentation
¶
Index ¶
- type Cert
- type CertOpt
- func WithCASubject(organization, commonName string) CertOpt
- func WithCombinedFile() CertOpt
- func WithDNSName(dnsName string) CertOpt
- func WithExtKeyUsage(eku ...x509.ExtKeyUsage) CertOpt
- func WithIPAddr(ipAddr net.IP) CertOpt
- func WithNoDefaultIPAddrs() CertOpt
- func WithNotAfter(notAfter time.Time) CertOpt
- func WithNotBefore(notBefore time.Time) CertOpt
- type CertOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cert ¶
type Cert struct {
// Path to the SSL certificates.
CACertPath, CertPath string
// Path to the private keys for the SSL certificates.
CAKeyPath, KeyPath string
}
func (*Cert) ClientTLSConfig ¶
type CertOpt ¶
type CertOpt func(*CertOptions)
func WithCASubject ¶
func WithCombinedFile ¶
func WithCombinedFile() CertOpt
func WithDNSName ¶
func WithExtKeyUsage ¶ added in v1.13.0
func WithExtKeyUsage(eku ...x509.ExtKeyUsage) CertOpt
WithExtKeyUsage replaces the leaf certificate's extended key usages, which default to server and client authentication. Passing no usages omits the extension entirely, leaving the certificate unrestricted.
func WithIPAddr ¶
func WithNoDefaultIPAddrs ¶
func WithNoDefaultIPAddrs() CertOpt
func WithNotAfter ¶
func WithNotBefore ¶
type CertOptions ¶
type CertOptions struct {
// DNSNames for cert
DNSNames []string
// IP Addresses for cert
IPAddrs []net.IP
// SkipDefaultIPAddrs indicates if the default IPAddrs should be skipped if IPAddrs is not set.
SkipDefaultIPAddrs bool
// NotBefore for certificate
NotBefore time.Time
// NotAfter for certificate
NotAfter time.Time
// CombinedFile indicates if the certificate and key should be combined into a single file
CombinedFile bool
// CAOrganization sets the CA certificate's Subject.Organization field
CAOrganization string
// CACommonName sets the CA certificate's Subject.CommonName field
CACommonName string
// ExtKeyUsage replaces the leaf certificate's extended key usages. It is
// only consulted when ExtKeyUsageSet is true, so that an empty value can
// omit the extension entirely rather than mean "unset".
ExtKeyUsage []x509.ExtKeyUsage
// ExtKeyUsageSet indicates ExtKeyUsage was configured with WithExtKeyUsage.
ExtKeyUsageSet bool
}
Click to show internal directories.
Click to hide internal directories.