package csr

import "k8s.io/client-go/util/certificate/csr"

Index

Functions

func DurationToExpirationSeconds

func DurationToExpirationSeconds(duration time.Duration) *int32

func ExpirationSecondsToDuration

func ExpirationSecondsToDuration(expirationSeconds int32) time.Duration

func RequestCertificate

func RequestCertificate(client clientset.Interface, csrData []byte, name, signerName string, requestedDuration *time.Duration, usages []certificatesv1.KeyUsage, privateKey interface{}) (reqName string, reqUID types.UID, err error)

RequestCertificate will either use an existing (if this process has run before but not to completion) or create a certificate signing request using the PEM encoded CSR and send it to API server. An optional requestedDuration may be passed to set the spec.expirationSeconds field on the CSR to control the lifetime of the issued certificate. This is not guaranteed as the signer may choose to ignore the request.

Deprecated: use RequestCertificateWithContext instead.

func RequestCertificateWithContext

func RequestCertificateWithContext(ctx context.Context, client clientset.Interface, csrData []byte, name, signerName string, requestedDuration *time.Duration, usages []certificatesv1.KeyUsage, privateKey interface{}) (reqName string, reqUID types.UID, err error)

RequestCertificateWithContext will either use an existing (if this process has run before but not to completion) or create a certificate signing request using the PEM encoded CSR and send it to API server. An optional requestedDuration may be passed to set the spec.expirationSeconds field on the CSR to control the lifetime of the issued certificate. This is not guaranteed as the signer may choose to ignore the request.

func WaitForCertificate

func WaitForCertificate(ctx context.Context, client clientset.Interface, reqName string, reqUID types.UID) (certData []byte, err error)

WaitForCertificate waits for a certificate to be issued until timeout, or returns an error.

Source Files

csr.go

Version
v0.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
22 packages
Last checked
1 hour ago

Tools for package owners.