shared

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoggingLevel int

Functions

func ValidatePEM

func ValidatePEM(raw string, csr bool) (string, error)

ValidatePEM checks either a CSR or PEM certificate block to ensure that it can be successfully decoded, passes very simple tests and is current. For valid PEMs it returns the common name, and for invalid PEMs it returns an error.

func WriteLog

func WriteLog(content string, level int, color int)

WriteLog is a shared logging function that can be used right across the project. It supports writing to stdout using multiple colors and takes a verbosity level Some colors that can be used are 31-Red, 32-Green, 33-Yellow, 36-Aqua

Types

type StepAttestationRequestData

type StepAttestationRequestData struct {
	Timestamp       string `json:"timestamp"`
	AttestationData struct {
		PermanentIdentifier string `json:"permanentIdentifier"`
	} `json:"attestationData"`
	X509CertificateRequest struct {
		Raw string `json:"raw"`
	} `json:"x509CertificateRequest"`
}

StepAttestationRequestData defines the structure of the incoming JSON from step-ca we currently only unmarshal the parts we are interested in, but this can be easily expanded or changed in the future

type StepResponseData

type StepResponseData struct {
	Allow bool                   `json:"allow"`
	Data  map[string]interface{} `json:"data,omitempty"`
}

StepResponseData defines the structure of the JSON we will return to step-ca there is always an Allow boolean, and Data is optional. Data is a map[string]interface{} to allow for flexibility in the JSON returned

Jump to

Keyboard shortcuts

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