certs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyCertificates

func CopyCertificates(certPath, keyPath, destDir string) error

CopyCertificates copies certificate files to a destination directory

func FormatCertificateInfo

func FormatCertificateInfo(certPath string) (string, error)

FormatCertificateInfo formats certificate information for display

func GetCertificateDaysRemaining

func GetCertificateDaysRemaining(certPath string) (int, error)

GetCertificateDaysRemaining returns the number of days until certificate expires

func GetCertificateDomains

func GetCertificateDomains(certPath string) ([]string, error)

GetCertificateDomains returns the domains covered by the certificate

func GetCertificateExpiry

func GetCertificateExpiry(certPath string) (time.Time, error)

GetCertificateExpiry returns the expiration date of a certificate

func IsCertificateExpiringSoon

func IsCertificateExpiringSoon(certPath string, days int) (bool, error)

IsCertificateExpiringSoon checks if certificate expires within the given days

func ValidateCertificate

func ValidateCertificate(certPath string) error

ValidateCertificate validates a certificate file

Types

type Manager

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

Manager handles certificate generation with mkcert

func NewManager

func NewManager(certsDir, domain string) *Manager

NewManager creates a new certificate manager

func (*Manager) CertificatesExist

func (m *Manager) CertificatesExist() bool

CertificatesExist checks if certificates have been generated

func (*Manager) GenerateCertificates

func (m *Manager) GenerateCertificates() error

GenerateCertificates generates SSL certificates for the domain

func (*Manager) GetCALocation

func (m *Manager) GetCALocation() (string, error)

GetCALocation returns the path to the mkcert CA root certificate

func (*Manager) GetCertInfo

func (m *Manager) GetCertInfo() (map[string]interface{}, error)

GetCertInfo returns information about the generated certificates

func (*Manager) GetCertificatePath

func (m *Manager) GetCertificatePath() string

GetCertificatePath returns the path to the generated certificate

func (*Manager) GetKeyPath

func (m *Manager) GetKeyPath() string

GetKeyPath returns the path to the generated private key

func (*Manager) InstallCA

func (m *Manager) InstallCA() error

InstallCA installs the mkcert root CA into system trust stores

func (*Manager) InstallMkcert

func (m *Manager) InstallMkcert() error

InstallMkcert attempts to install mkcert

func (*Manager) IsCAInstalled

func (m *Manager) IsCAInstalled() (bool, error)

IsCAInstalled checks if the mkcert CA is installed

func (*Manager) IsMkcertInstalled

func (m *Manager) IsMkcertInstalled() bool

IsMkcertInstalled checks if mkcert is installed on the system

func (*Manager) RegenerateCertificates

func (m *Manager) RegenerateCertificates() error

RegenerateCertificates removes old certificates and generates new ones

func (*Manager) UninstallCA

func (m *Manager) UninstallCA() error

UninstallCA removes the mkcert CA from system trust stores

Jump to

Keyboard shortcuts

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