certificate

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 37 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstantLogger

func ConstantLogger(logger logr.Logger) func() logr.Logger

func DefaultKubeAPIServerClientGetUsages

func DefaultKubeAPIServerClientGetUsages(privateKey any) []certificatesv1.KeyUsage

func GenerateAndCreateCertificateSigningRequest

func GenerateAndCreateCertificateSigningRequest(
	ctx context.Context,
	c client.Client,
	signerName string,
	template *x509.CertificateRequest,
	getUsages func(privateKey any) []certificatesv1.KeyUsage,
	requestedDuration *time.Duration,
) (csrObj *certificatesv1.CertificateSigningRequest, keyPEM []byte, privateKey any, err error)

func GenerateCertificateSigningRequestData

func GenerateCertificateSigningRequestData(template *x509.CertificateRequest) (csrPEM, keyPEM []byte, key interface{}, err error)

func MakeCertificatesCertificateSigningRequest

func MakeCertificatesCertificateSigningRequest(
	signerName string,
	csrPem []byte,
	usages []certificatesv1.KeyUsage,
	requestedDuration *time.Duration,
) *certificatesv1.CertificateSigningRequest

func Marshal

func Marshal(cert *tls.Certificate) (certPEM, keyPEM []byte, err error)

func RequestCertificate

func RequestCertificate(
	ctx context.Context,
	c client.WithWatch,
	signerName string,
	template *x509.CertificateRequest,
	getUsages func(privateKey any) []certificatesv1.KeyUsage,
	requestedDuration *time.Duration,
) (*tls.Certificate, error)

func TLSCertificateLeaf

func TLSCertificateLeaf(cert *tls.Certificate) (*x509.Certificate, error)

func WaitForCertificate

func WaitForCertificate(ctx context.Context, c client.WithWatch, name string, uid types.UID) ([]byte, error)

Types

type Rotator

type Rotator interface {
	manager.Runnable
	healthz.HealthChecker
	Init(ctx context.Context, force bool) error
	Certificate() *tls.Certificate
	AddListener(listener RotatorListener) RotatorListenerRegistration
	RemoveListener(reg RotatorListenerRegistration)
}

func NewRotator

func NewRotator(opts RotatorOptions) (Rotator, error)

type RotatorListener

type RotatorListener interface {
	Enqueue()
}

type RotatorListenerFunc

type RotatorListenerFunc func()

func (RotatorListenerFunc) Enqueue

func (f RotatorListenerFunc) Enqueue()

type RotatorListenerRegistration

type RotatorListenerRegistration interface{}

type RotatorOptions

type RotatorOptions struct {
	Name              string
	NewClient         func(cert *tls.Certificate) (client.WithWatch, error)
	LogConstructor    func() logr.Logger
	SignerName        string
	Template          *x509.CertificateRequest
	GetUsages         func(privateKey any) []certificatesv1.KeyUsage
	RequestedDuration *time.Duration
	ForceInitial      bool
	InitCertificate   *tls.Certificate
	InitContext       func(ctx context.Context) (context.Context, context.CancelFunc)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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