util

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCertificateFiles

func CreateCertificateFiles(secret *apicorev1.Secret, filenamesPrefix string, zipFilesPassword string, pkcs12Password string) (string, error)

CreateCertificateFiles Export certificates from the Secret, namely tls.key and tls.crt, into a temporary working directory. The path for this temporary directory will be returned and is expected to be removed after CertWatcher Action processing is completed.

Along with the original tls.key and tls.crt files, additional converted versions of the same files will be included. The full list:

- tls.key - tls.crt - tls.p12 (tls.key and tls.crt included) - tls.crt.p12 (tls.crt included)

And also zipped versions of each one:

- tls.key.zip (tls.key zipped) - tls.crt.zip (tls.crt zipped) - tls.zip (tls.crt and tls.key zipped) - tls.p12.zip (tls.p12 zipped) - tls.crt.p12.zip (tls.crt.p12 zipped) - tls.all.zip (tls.key, tls.crt, tls.p12 and tls.crt.p12 zipped)

The "tls" filename prefix is determined by the filenamesPrefix argument.

If a pkcs12Password is provided, *.p12 files will be created with that password.

If a zipFilesPassword is provided, *.zip files will be created with that password.

If the function finishes successfully, creating all files, the path of the temporary working directory followed by a nil error is returned. Otherwise, an empty string followed by the error is returned.

func ProcessEmail

func ProcessEmail(cw *certwatchv1.CertWatcher, certFilesDir string, emailConfiguration *properties.Properties) error

func ProcessJob

func ProcessJob(certwatcher *certwatchv1.CertWatcher) (*v1.Job, error)

func ProcessScp

func ProcessScp(cw *certwatchv1.CertWatcher, credentialSecret v1.Secret, certFilesDir string) error

func RandoHash

func RandoHash(numCharacters int) (string, error)

Generate a random hash string in hexadecimal format.

func SecretDataChecksum

func SecretDataChecksum(s *v1.Secret) (string, error)

Calculate SHA256 from the Secret data. For simplicity, mashal the entire Data map into a json string and calculate the hash from that. Includes the object's labels as a way to give users change the checksum even when the certificate data itself did not change. This could be useful when users want to force trigger cert-watch to react to test or rerun actions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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