certificate

package
v1.32.9 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

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 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(req *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