Documentation
¶
Index ¶
- type CA
- func (c *CA) Generate(commonName string, validityDuration time.Duration) error
- func (c *CA) LoadFromFile(caCertFile, caKeyFile string) error
- func (c *CA) LoadFromSecret(ctx context.Context, k8sClient *kubernetes.Clientset) error
- func (c *CA) LoadedFromSecret() bool
- func (c *CA) StoreAsConfigMap(ctx context.Context, k8sClient *kubernetes.Clientset) error
- func (c *CA) StoreAsSecret(ctx context.Context, k8sClient *kubernetes.Clientset) error
- type Cert
- func (c *Cert) Generate(ca *x509.Certificate, caSigner crypto.Signer) error
- func (c *Cert) StoreAsSecret(ctx context.Context, k8sClient *kubernetes.Clientset) error
- func (c *Cert) StoreAsSecretWithCACert(ctx context.Context, k8sClient *kubernetes.Clientset, ca *CA) error
- func (c *Cert) WithHosts(hosts []string) *Cert
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CA ¶
type CA struct {
SecretName string
SecretNamespace string
ConfigMapName string
ConfigMapNamespace string
CACertBytes []byte
CAKeyBytes []byte
CACert *x509.Certificate
CAKey crypto.Signer
// contains filtered or unexported fields
}
CA contains the data and metadata of the certificate authority
func (*CA) Generate ¶
Generate the root certificate and keyfile. Populates c.CACertBytes and c.CAKeyBytes
func (*CA) LoadFromFile ¶
LoadFromFile populates c.CACertBytes and c.CAKeyBytes by reading them from file.
func (*CA) LoadFromSecret ¶ added in v0.1.1
LoadFromSecret populates c.CACertBytes and c.CAKeyBytes by reading them from a secret
func (*CA) LoadedFromSecret ¶ added in v0.1.3
LoadedFromSecret returns true if this CA was loaded from a K8s secret
func (*CA) StoreAsConfigMap ¶
StoreAsConfigMap creates or updates the CA certificate in a K8s configmap
func (*CA) StoreAsSecret ¶ added in v0.1.1
StoreAsSecret creates or updates the CA certificate in a K8s secret
type Cert ¶
type Cert struct {
CommonName string
ValidityDuration time.Duration
Usage []string
Name string
Namespace string
Hosts []string
CertBytes []byte
KeyBytes []byte
}
CA contains the data and metadata of the certificate and keyfile
func NewCert ¶
func NewCert( commonName string, validityDuration time.Duration, usage []string, name string, namespace string, ) *Cert
NewCert creates a new certificate blueprint
func (*Cert) StoreAsSecret ¶
StoreAsSecret creates or updates the certificate and keyfile in a K8s secret
func (*Cert) StoreAsSecretWithCACert ¶ added in v0.1.1
func (c *Cert) StoreAsSecretWithCACert(ctx context.Context, k8sClient *kubernetes.Clientset, ca *CA) error
StoreAsSecretWithCACert creates or updates the certificate, keyfile, and ca cert in a K8s secret