Documentation ¶
Index ¶
- func CertsFromPEM(pemCerts []byte) ([]*x509.Certificate, error)
- func IPAddressesDNSNames(hosts []string) ([]net.IP, []string)
- func NewKeyPair() (crypto.PublicKey, crypto.PrivateKey, error)
- func SecureTLSConfig(config *tls.Config) *tls.Config
- type CA
- func (ca *CA) EnsureClientCertificate(certFile, keyFile string, u user.Info) (*TLSCertificateConfig, bool, error)
- func (ca *CA) EnsureServerCert(certFile, keyFile string, hostnames sets.String) (*TLSCertificateConfig, bool, error)
- func (ca *CA) MakeClientCertificate(certFile, keyFile string, u user.Info) (*TLSCertificateConfig, error)
- func (ca *CA) MakeServerCert(certFile, keyFile string, hostnames sets.String) (*TLSCertificateConfig, error)
- type RandomSerialGenerator
- type SerialFileGenerator
- type SerialGenerator
- type TLSCARoots
- type TLSCertificateConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CertsFromPEM ¶
func CertsFromPEM(pemCerts []byte) ([]*x509.Certificate, error)
func NewKeyPair ¶
func NewKeyPair() (crypto.PublicKey, crypto.PrivateKey, error)
Types ¶
type CA ¶
type CA struct { Config *TLSCertificateConfig SerialGenerator SerialGenerator }
func EnsureCA ¶
EnsureCA returns a CA, whether it was created (as opposed to pre-existing), and any error if serialFile is empty, a RandomSerialGenerator will be used
func (*CA) EnsureClientCertificate ¶
func (*CA) EnsureServerCert ¶
func (*CA) MakeClientCertificate ¶
func (*CA) MakeServerCert ¶
type RandomSerialGenerator ¶ added in v1.1.4
type RandomSerialGenerator struct { }
RandomSerialGenerator returns a serial based on time.Now and the subject
func (*RandomSerialGenerator) Next ¶ added in v1.1.4
func (s *RandomSerialGenerator) Next(template *x509.Certificate) (int64, error)
type SerialFileGenerator ¶ added in v1.1.4
type SerialFileGenerator struct { SerialFile string Serial int64 // contains filtered or unexported fields }
SerialFileGenerator returns a unique, monotonically increasing serial number and ensures the CA on disk records that value.
func NewSerialFileGenerator ¶ added in v1.1.4
func NewSerialFileGenerator(serialFile string, createIfNeeded bool) (*SerialFileGenerator, error)
func (*SerialFileGenerator) Next ¶ added in v1.1.4
func (s *SerialFileGenerator) Next(template *x509.Certificate) (int64, error)
Next returns a unique, monotonically increasing serial number and ensures the CA on disk records that value.
type SerialGenerator ¶ added in v1.1.4
type SerialGenerator interface {
Next(template *x509.Certificate) (int64, error)
}
SerialGenerator is an interface for getting a serial number for the cert. It MUST be thread-safe.
type TLSCARoots ¶
type TLSCARoots struct {
Roots []*x509.Certificate
}
func GetTLSCARoots ¶
func GetTLSCARoots(caFile string) (*TLSCARoots, error)
type TLSCertificateConfig ¶
type TLSCertificateConfig struct { Certs []*x509.Certificate Key crypto.PrivateKey }
func GetServerCert ¶
func GetServerCert(certFile, keyFile string, hostnames sets.String) (*TLSCertificateConfig, error)
func GetTLSCertificateConfig ¶
func GetTLSCertificateConfig(certFile, keyFile string) (*TLSCertificateConfig, error)
Click to show internal directories.
Click to hide internal directories.