installer

package
v5.6.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DayDuration = time.Hour * 24

DayDuration represents a day (24 hours) in the Duration type

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	X509cert   x509.Certificate
	Thumbprint string
}

func CreateX509Cert

func CreateX509Cert(pcc *certificate.PEMCollection, certReq *certificate.Request, decryptPK bool) (*Certificate, *certificate.PEMCollection, error)

CreateX509Cert takes a PEMCollection and creates an x509.Certificate object from it Could also add the x509.Certificate object directly to the PEM collection in the original constructor

type Installer

type Installer interface {

	// Check is the method in charge of making the validations to install a new certificate:
	// 1. Does the certificate exists? > Install if it doesn't.
	// 2. Does the certificate is about to expire? Renew if about to expire.
	// Returns true if the certificate needs to be installed.
	Check(renewBefore string, request domain.PlaybookRequest) (bool, error)

	// Backup takes the certificate request and backs up the current version prior to overwriting
	Backup() error

	// Install takes the certificate bundle and moves it to the location specified in the installer
	Install(pcc certificate.PEMCollection) error

	// AfterInstallActions runs any instructions declared in the Installer on a terminal.
	//
	// No validations happen over the content of the AfterAction string, so caution is advised
	AfterInstallActions() (string, error)

	// InstallValidationActions runs any instructions declared in the Installer on a terminal and expects
	// "0" for successful validation and "1" for a validation failure
	// No validations happen over the content of the InstallValidation string, so caution is advised
	InstallValidationActions() (string, error)
}

Installer represents the interface for all installers. A new Installer must implement this interface to be picked up.

func GetInstaller

func GetInstaller(inst domain.Installation) Installer

GetInstaller returns a proper installer according to the type defined in inst

type JKSInstaller

type JKSInstaller struct {
	domain.Installation
}

JKSInstaller represents an installation that will use the Java KeyStore format for the certificate bundle

func NewJKSInstaller

func NewJKSInstaller(inst domain.Installation) JKSInstaller

NewJKSInstaller returns a new installer of type JKS with the values defined in inst

func (JKSInstaller) AfterInstallActions

func (r JKSInstaller) AfterInstallActions() (string, error)

AfterInstallActions runs any instructions declared in the Installer on a terminal.

No validations happen over the content of the AfterAction string, so caution is advised

func (JKSInstaller) Backup

func (r JKSInstaller) Backup() error

Backup takes the certificate request and backs up the current version prior to overwriting

func (JKSInstaller) Check

func (r JKSInstaller) Check(renewBefore string, _ domain.PlaybookRequest) (bool, error)

Check is the method in charge of making the validations to install a new certificate: 1. Does the certificate exists? > Install if it doesn't. 2. Does the certificate is about to expire? Renew if about to expire. Returns true if the certificate needs to be installed.

func (JKSInstaller) Install

Install takes the certificate bundle and moves it to the location specified in the installer

func (JKSInstaller) InstallValidationActions

func (r JKSInstaller) InstallValidationActions() (string, error)

InstallValidationActions runs any instructions declared in the Installer on a terminal and expects "0" for successful validation and "1" for a validation failure No validations happen over the content of the InstallValidation string, so caution is advised

type PEMInstaller

type PEMInstaller struct {
	domain.Installation
}

PEMInstaller represents an installation that will use the PEM format for the certificate bundle

func NewPEMInstaller

func NewPEMInstaller(inst domain.Installation) PEMInstaller

NewPEMInstaller returns a new installer of type PEM with the values defined in inst

func (PEMInstaller) AfterInstallActions

func (r PEMInstaller) AfterInstallActions() (string, error)

AfterInstallActions runs any instructions declared in the Installer on a terminal.

No validations happen over the content of the AfterAction string, so caution is advised

func (PEMInstaller) Backup

func (r PEMInstaller) Backup() error

Backup takes the certificate request and backs up the current version prior to overwriting

func (PEMInstaller) Check

func (r PEMInstaller) Check(renewBefore string, _ domain.PlaybookRequest) (bool, error)

Check is the method in charge of making the validations to install a new certificate: 1. Does the certificate exists? > Install if it doesn't. 2. Does the certificate is about to expire? Renew if about to expire. Returns true if the certificate needs to be installed.

func (PEMInstaller) Install

Install takes the certificate bundle and moves it to the location specified in the installer

func (PEMInstaller) InstallValidationActions

func (r PEMInstaller) InstallValidationActions() (string, error)

InstallValidationActions runs any instructions declared in the Installer on a terminal and expects "0" for successful validation and "1" for a validation failure No validations happen over the content of the InstallValidation string, so caution is advised

type PKCS12Installer

type PKCS12Installer struct {
	domain.Installation
}

PKCS12Installer represents an installation that will use the PKCS12 format for the certificate bundle

func NewPKCS12Installer

func NewPKCS12Installer(inst domain.Installation) PKCS12Installer

NewPKCS12Installer returns a new installer of type PKCS12 with the values defined in inst

func (PKCS12Installer) AfterInstallActions

func (r PKCS12Installer) AfterInstallActions() (string, error)

AfterInstallActions runs any instructions declared in the Installer on a terminal.

No validations happen over the content of the AfterAction string, so caution is advised

func (PKCS12Installer) Backup

func (r PKCS12Installer) Backup() error

Backup takes the certificate request and backs up the current version prior to overwriting

func (PKCS12Installer) Check

func (r PKCS12Installer) Check(renewBefore string, _ domain.PlaybookRequest) (bool, error)

Check is the method in charge of making the validations to install a new certificate: 1. Does the certificate exists? > Install if it doesn't. 2. Does the certificate is about to expire? Renew if about to expire. Returns true if the certificate needs to be installed.

func (PKCS12Installer) Install

Install takes the certificate bundle and moves it to the location specified in the installer

func (PKCS12Installer) InstallValidationActions

func (r PKCS12Installer) InstallValidationActions() (string, error)

InstallValidationActions runs any instructions declared in the Installer on a terminal and expects "0" for successful validation and "1" for a validation failure No validations happen over the content of the InstallValidation string, so caution is advised

Jump to

Keyboard shortcuts

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