certificate

package
v1.58.7 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyCaSelfSignedCertFilter

func ApplyCaSelfSignedCertFilter(obj *unstructured.Unstructured) (go_hook.FilterResult, error)

func GenerateCSR

func GenerateCSR(logger *logrus.Entry, cn string, options ...Option) (csrPEM, key []byte, err error)

func IsCertificateExpiringSoon

func IsCertificateExpiringSoon(cert []byte, durationLeft time.Duration) (bool, error)

func ParseCertificate added in v1.35.0

func ParseCertificate(crt string) (*x509.Certificate, error)

ParseCertificate parse x509 certificate PEM encoded

func ParseCertificatesFromBase64

func ParseCertificatesFromBase64(ca, crt, key string) (*x509.Certificate, *tls.Certificate, error)

ParseCertificatesFromBase64 parsing base64 input string and return ca cert and/or verified tls.Certificate

func ParseCertificatesFromPEM

func ParseCertificatesFromPEM(ca, crt, key string) (*x509.Certificate, *tls.Certificate, error)

ParseCertificatesFromPEM parsing PEM input strings and return ca cert and/or verified tls.Certificate

func Validator

func Validator(_ *csr.CertificateRequest) error

Validator does nothing and will never return an error. It exists because creating a csr.Generator requires a Validator.

Types

type Authority

type Authority struct {
	Key  string `json:"key"`
	Cert string `json:"cert"`
}

func GenerateCA

func GenerateCA(logger *logrus.Entry, cn string, options ...Option) (Authority, error)

func GetOrCreateCa

func GetOrCreateCa(input *go_hook.HookInput, snapshot, cn string) (*Authority, error)

type Certificate

type Certificate struct {
	Key  string `json:"key"`
	Cert string `json:"cert"`
	CA   string `json:"ca"`
}

func GenerateSelfSignedCert

func GenerateSelfSignedCert(logger *logrus.Entry, cn string, ca Authority, options ...interface{}) (Certificate, error)

type Option

type Option func(request *csr.CertificateRequest)

func WithCAConfig

func WithCAConfig(caConfig *csr.CAConfig) Option

func WithCAExpiry

func WithCAExpiry(expiry string) Option

func WithCSRKeyRequest

func WithCSRKeyRequest(keyRequest *csr.KeyRequest) Option

WithCSRKeyRequest redeclare basic(ecdsa 2048) key alg and size

func WithGroups

func WithGroups(groups ...string) Option

func WithKeyAlgo

func WithKeyAlgo(algo string) Option

func WithKeyRequest

func WithKeyRequest(keyRequest *csr.KeyRequest) Option

func WithKeySize

func WithKeySize(size int) Option

func WithNames

func WithNames(names ...csr.Name) Option

func WithSANs

func WithSANs(sans ...string) Option

type SigningOption

type SigningOption func(signing *config.Signing)

func WithSigningDefaultExpiry

func WithSigningDefaultExpiry(expiry time.Duration) SigningOption

func WithSigningDefaultUsage

func WithSigningDefaultUsage(usage []string) SigningOption

Jump to

Keyboard shortcuts

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