cert

package
v0.0.0-...-68b8a53 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServerKey is the name of the key associated with the secret's private key.
	ServerKey = "server-key.pem"
	// ServerCert is the name of the key associated with the secret's public key.
	ServerCert = "server-cert.pem"
	// CACert is the name of the key associated with the certificate of the CA for
	// the keypair.
	CACert = "ca-cert.pem"

	// Expiration is a default duration after which the certificates should expire
	Expiration = 365 * 24 * time.Hour
)

Variables

This section is empty.

Functions

func CreateCerts

func CreateCerts(name, namespace string, notAfter time.Time) (serverKey, serverCert, caCert []byte, err error)

CreateCerts creates and returns a CA certificate and certificate and key for the server. serverKey and serverCert are used by the server to establish trust for clients, CA certificate is used by the client to verify the server authentication chain. notAfter specifies the expiration date.

func EnsureSecret

func EnsureSecret(ctx context.Context, cl client.Client, namespace, certSecretName, serviceName string, expiration time.Duration) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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