Help us shape the future of Go! Take the 2026 Go Developer Survey

certmgmt

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0, MIT Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClusterDomain = "cluster.local"

Functions

func AppendCertsFromPEM

func AppendCertsFromPEM(s *x509.CertPool, pemCerts []byte) error

func Check

func Check(key []byte, cert []byte, cacert []byte, duration time.Duration, name ...string) (bool, error)

func CheckInfo

func CheckInfo(info CertificateInfo, duration time.Duration, name ...string) (bool, error)

func Equal

func GetCertificate

func GetCertificate(info CertificateInfo) (tls.Certificate, error)

func IsValid

func IsValid(key []byte, cert []byte, cacert []byte, duration time.Duration, name ...string) bool

func IsValidInfo

func IsValidInfo(info CertificateInfo, duration time.Duration, name ...string) bool

func NewSignedCert

func NewSignedCert(cfg *cert.Config, key crypto.Signer, caCert *x509.Certificate, caKey crypto.Signer, duration time.Duration) (*x509.Certificate, error)

NewSignedCert creates a signed certificate using the given CA certificate and key with the given validity duration

Types

type CertificateAccess

type CertificateAccess interface {
	Get(logger.LogContext) (CertificateInfo, error)
	Set(logger.LogContext, CertificateInfo) error
}

type CertificateHosts

type CertificateHosts interface {
	GetIPs() []net.IP
	GetDNSNames() []string
}

type CertificateInfo

type CertificateInfo interface {
	Cert() []byte
	Key() []byte
	CACert() []byte
	CAKey() []byte
}

func GetCertificateInfo

func GetCertificateInfo(logger logger.LogContext, access CertificateAccess, cfg *Config) (CertificateInfo, error)

func LoadCertInfo

func LoadCertInfo(certFile, keyFile, caFile, cakeyFile string) (CertificateInfo, error)

func NewCertInfo

func NewCertInfo(cert []byte, key []byte, cacert []byte, cakey []byte) CertificateInfo

func UpdateCertificate

func UpdateCertificate(old CertificateInfo, cfg *Config) (CertificateInfo, error)

type CompoundHosts

type CompoundHosts []CertificateHosts

func NewCompoundHosts

func NewCompoundHosts(hosts ...CertificateHosts) CompoundHosts

func (*CompoundHosts) Add

func (this *CompoundHosts) Add(hosts ...CertificateHosts) *CompoundHosts

func (CompoundHosts) GetDNSNames

func (this CompoundHosts) GetDNSNames() []string

func (CompoundHosts) GetIPs

func (this CompoundHosts) GetIPs() []net.IP

func (CompoundHosts) With

func (this CompoundHosts) With(hosts ...CertificateHosts) CompoundHosts

type Config

type Config struct {
	CommonName        string
	Organization      []string
	Hosts             CertificateHosts
	Validity          time.Duration
	Rest              time.Duration
	ExternallyManaged bool
}

type DNSName

type DNSName struct {
	NoHost
	// contains filtered or unexported fields
}

func NewDNSName

func NewDNSName(name string) *DNSName

func (*DNSName) GetDNSNames

func (this *DNSName) GetDNSNames() []string

type IP

type IP struct {
	NoHost
	// contains filtered or unexported fields
}

func NewIP

func NewIP(name net.IP) *IP

func (*IP) GetIPs

func (this *IP) GetIPs() []net.IP

type NoHost

type NoHost struct {
}

func (*NoHost) GetDNSNames

func (this *NoHost) GetDNSNames() []string

func (*NoHost) GetIPs

func (this *NoHost) GetIPs() []net.IP

type ServiceHosts

type ServiceHosts struct {
	NoHost
	// contains filtered or unexported fields
}

func NewServiceHosts

func NewServiceHosts(name, namespace string) *ServiceHosts

func (*ServiceHosts) GetDNSNames

func (this *ServiceHosts) GetDNSNames() []string

func (*ServiceHosts) GetName

func (this *ServiceHosts) GetName() string

func (*ServiceHosts) GetNamespace

func (this *ServiceHosts) GetNamespace() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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