cli

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSilent = errors.New("silent")

ErrSilent signals that the error's message has already been printed to stderr by the code that produced it (e.g. an "Unknown X subcommand" line), so the top-level caller in cmd/certifier/main.go should set a non-zero exit code without printing anything further.

Functions

func CheckCRL added in v1.0.0

func CheckCRL(args []string)

CheckCRL checks whether a certificate is revoked according to a CRL (wrapper that calls CheckCRLCmd and handles exit)

func CheckCRLCmd added in v1.0.0

func CheckCRLCmd(args []string) error

CheckCRLCmd checks whether a certificate is revoked according to a CRL and returns an error instead of exiting

func CheckOCSPStatus added in v1.0.0

func CheckOCSPStatus(args []string)

CheckOCSPStatus checks a certificate's revocation status against a live OCSP responder (wrapper that calls CheckOCSPStatusCmd and handles exit).

func CheckOCSPStatusCmd added in v1.0.0

func CheckOCSPStatusCmd(args []string) error

CheckOCSPStatusCmd checks a certificate's revocation status against a live OCSP responder and returns an error instead of exiting.

func CreateOCSPRequest added in v1.0.0

func CreateOCSPRequest(args []string)

CreateOCSPRequest creates an OCSP request (wrapper that calls CreateOCSPRequestCmd and handles exit)

func CreateOCSPRequestCmd added in v1.0.0

func CreateOCSPRequestCmd(args []string) error

CreateOCSPRequestCmd creates an OCSP request and returns an error instead of exiting

func DecodeCert added in v1.0.0

func DecodeCert(args []string)

DecodeCert converts a DER or PKCS12 certificate back to PEM (wrapper that calls DecodeCertCmd and handles exit)

func DecodeCertCmd added in v1.0.0

func DecodeCertCmd(args []string) error

DecodeCertCmd converts a DER or PKCS12 certificate back to PEM and returns an error instead of exiting

func EncodeCert added in v1.0.0

func EncodeCert(args []string)

EncodeCert converts a PEM certificate to DER or PKCS12 (wrapper that calls EncodeCertCmd and handles exit)

func EncodeCertCmd added in v1.0.0

func EncodeCertCmd(args []string) error

EncodeCertCmd converts a PEM certificate to DER or PKCS12 and returns an error instead of exiting

func GenerateCA

func GenerateCA(args []string)

GenerateCA generates a CA certificate (wrapper that calls GenerateCACmd and handles exit)

func GenerateCACmd

func GenerateCACmd(args []string) error

GenerateCACmd generates a CA certificate and returns an error instead of exiting

func GenerateCRL added in v1.0.0

func GenerateCRL(args []string)

GenerateCRL generates a Certificate Revocation List (wrapper that calls GenerateCRLCmd and handles exit)

func GenerateCRLCmd added in v1.0.0

func GenerateCRLCmd(args []string) error

GenerateCRLCmd generates a Certificate Revocation List and returns an error instead of exiting

func GenerateCSR

func GenerateCSR(args []string)

GenerateCSR generates a Certificate Signing Request (wrapper that calls GenerateCSRCmd and handles exit)

func GenerateCSRCmd

func GenerateCSRCmd(args []string) error

GenerateCSRCmd generates a Certificate Signing Request and returns an error instead of exiting

func GenerateCSRFromFile

func GenerateCSRFromFile(configPath string)

GenerateCSRFromFile generates CSRs from a configuration file

func GenerateCSRFromFileCmd

func GenerateCSRFromFileCmd(configPath string) error

GenerateCSRFromFileCmd generates CSRs from a config file and returns an error

func GenerateCert

func GenerateCert(args []string)

GenerateCert generates a certificate (wrapper that calls GenerateCertCmd and handles exit)

func GenerateCertCmd

func GenerateCertCmd(args []string) error

GenerateCertCmd generates a certificate and returns an error instead of exiting

func GenerateCertFromFile

func GenerateCertFromFile(configPath string)

GenerateCertFromFile generates certificates and CSRs from a configuration file

func GenerateCertFromFileCmd

func GenerateCertFromFileCmd(configPath string) error

GenerateCertFromFileCmd generates certificates from a config file and returns an error

func GenerateOCSPResponse added in v1.0.0

func GenerateOCSPResponse(args []string)

GenerateOCSPResponse generates an OCSP response (wrapper that calls GenerateOCSPResponseCmd and handles exit)

func GenerateOCSPResponseCmd added in v1.0.0

func GenerateOCSPResponseCmd(args []string) error

GenerateOCSPResponseCmd generates an OCSP response and returns an error instead of exiting

func RootCommand added in v1.0.0

func RootCommand() *cliv3.Command

RootCommand builds the full certifier command tree.

func SignCert added in v1.0.0

func SignCert(args []string)

SignCert signs a CSR with a CA (wrapper that calls SignCertCmd and handles exit)

func SignCertCmd added in v1.0.0

func SignCertCmd(args []string) error

SignCertCmd signs a CSR with a CA to produce a certificate and returns an error instead of exiting

func SummaryTable

func SummaryTable(details map[string]interface{})

SummaryTable displays a summary of certificate details before generation

func ValidateCert added in v1.0.0

func ValidateCert(args []string)

ValidateCert validates a certificate (wrapper that calls ValidateCertCmd and handles exit)

func ValidateCertCmd added in v1.0.0

func ValidateCertCmd(args []string) error

ValidateCertCmd validates a certificate and returns an error instead of exiting

func VerifyOCSPResponse added in v1.0.0

func VerifyOCSPResponse(args []string)

VerifyOCSPResponse verifies an OCSP response (wrapper that calls VerifyOCSPResponseCmd and handles exit)

func VerifyOCSPResponseCmd added in v1.0.0

func VerifyOCSPResponseCmd(args []string) error

VerifyOCSPResponseCmd verifies an OCSP response and returns an error instead of exiting

func ViewCA

func ViewCA(args []string)

ViewCA views CA details (wrapper that calls ViewCACmd and handles exit)

func ViewCACmd

func ViewCACmd(args []string) error

ViewCACmd views CA details and returns an error instead of exiting

func ViewCRL added in v1.0.0

func ViewCRL(args []string)

ViewCRL displays CRL details (wrapper that calls ViewCRLCmd and handles exit)

func ViewCRLCmd added in v1.0.0

func ViewCRLCmd(args []string) error

ViewCRLCmd displays CRL details and returns an error instead of exiting

func ViewCSR added in v1.0.0

func ViewCSR(args []string)

ViewCSR displays CSR details (wrapper that calls ViewCSRCmd and handles exit)

func ViewCSRCmd added in v1.0.0

func ViewCSRCmd(args []string) error

ViewCSRCmd displays CSR details and returns an error instead of exiting

func ViewCert

func ViewCert(args []string)

ViewCert views certificate details (wrapper that calls ViewCertCmd and handles exit)

func ViewCertCmd

func ViewCertCmd(args []string) error

ViewCert views certificate details ViewCertCmd views certificate details and returns an error instead of exiting

func ViewCertificateDetails

func ViewCertificateDetails(certFile string)

ViewCertificateDetails displays certificate information (wrapper that calls ViewCertificateDetailsCmd and handles exit)

func ViewCertificateDetailsCmd

func ViewCertificateDetailsCmd(certFile string) error

ViewCertificateDetailsCmd displays certificate information and returns an error instead of exiting

Types

type InteractiveMode

type InteractiveMode struct {
	// contains filtered or unexported fields
}

InteractiveMode enables interactive prompting for certificate generation

func NewInteractiveMode

func NewInteractiveMode() *InteractiveMode

NewInteractiveMode creates a new interactive mode instance

func (*InteractiveMode) ConfirmGeneration

func (im *InteractiveMode) ConfirmGeneration() bool

ConfirmGeneration asks for confirmation before generating certificate

func (*InteractiveMode) PromptCertificateType

func (im *InteractiveMode) PromptCertificateType() string

PromptCertificateType prompts for certificate type (client, server, or both)

func (*InteractiveMode) PromptDNSNames

func (im *InteractiveMode) PromptDNSNames() []string

PromptDNSNames prompts for DNS names (SANs)

func (*InteractiveMode) PromptEmailAddresses

func (im *InteractiveMode) PromptEmailAddresses() []string

PromptEmailAddresses prompts for email addresses

func (*InteractiveMode) PromptExtendedKeyUsageOIDs

func (im *InteractiveMode) PromptExtendedKeyUsageOIDs() []string

PromptExtendedKeyUsageOIDs prompts for custom Extended Key Usage OIDs

func (*InteractiveMode) PromptFileOutput

func (im *InteractiveMode) PromptFileOutput(defaultName string) string

PromptFileOutput prompts for output file paths

func (*InteractiveMode) PromptIPAddresses

func (im *InteractiveMode) PromptIPAddresses() []net.IP

PromptIPAddresses prompts for IP addresses (SANs)

func (*InteractiveMode) PromptInt

func (im *InteractiveMode) PromptInt(prompt string, defaultValue int) int

PromptInt prompts for an integer value with optional default

func (*InteractiveMode) PromptKeyType

func (im *InteractiveMode) PromptKeyType() string

func (*InteractiveMode) PromptString

func (im *InteractiveMode) PromptString(prompt, defaultValue string) string

PromptString prompts for a string value with optional default

func (*InteractiveMode) PromptStringSlice

func (im *InteractiveMode) PromptStringSlice(prompt string) []string

PromptStringSlice prompts for multiple string values (one per line, empty to finish)

func (*InteractiveMode) PromptSubjectInfo

func (im *InteractiveMode) PromptSubjectInfo() map[string]string

PromptSubjectInfo prompts for subject information

func (*InteractiveMode) PromptValidity

func (im *InteractiveMode) PromptValidity() int

PromptValidity prompts for certificate validity period

func (*InteractiveMode) PromptYesNo

func (im *InteractiveMode) PromptYesNo(prompt string, defaultYes bool) bool

PromptYesNo prompts for yes/no confirmation

type MenuMode struct {
	// contains filtered or unexported fields
}

MenuMode handles the main interactive menu interface

func NewMenuMode

func NewMenuMode() *MenuMode

NewMenuMode creates a new menu mode handler

func (m *MenuMode) DisplayMainMenu()

DisplayMainMenu shows the main menu and handles command routing

Jump to

Keyboard shortcuts

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