certs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateAuthority

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

CertificateAuthority handles generation of CA and dynamic minting of leaf certificates for TLS bumping.

func NewCertificateAuthority

func NewCertificateAuthority(certPath, keyPath string) (*CertificateAuthority, error)

NewCertificateAuthority initializes or loads a CA from the provided paths or default config directory.

func (*CertificateAuthority) GetCACertificatePEM

func (ca *CertificateAuthority) GetCACertificatePEM() []byte

GetCACertificatePEM returns the Root CA certificate in PEM format.

func (*CertificateAuthority) MintCertificate

func (ca *CertificateAuthority) MintCertificate(rawHost string) (certDER []byte, keyDER crypto.Signer, err error)

MintCertificate dynamically signs a leaf certificate for the given hostname using fast ECDSA P-256.

type CertificateManager

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

CertificateManager caches leaf certificates by host to avoid redundant signing.

func NewCertificateManager

func NewCertificateManager(ca *CertificateAuthority) *CertificateManager

NewCertificateManager creates a new CertificateManager.

func (*CertificateManager) GetCACertificatePEM

func (cm *CertificateManager) GetCACertificatePEM() []byte

GetCACertificatePEM returns the root CA in PEM format.

func (*CertificateManager) GetOrCreateCertificate

func (cm *CertificateManager) GetOrCreateCertificate(host string) (*tls.Certificate, error)

GetOrCreateCertificate returns a cached certificate or generates a new one.

func (*CertificateManager) GetTLSConfig

func (cm *CertificateManager) GetTLSConfig() *tls.Config

GetTLSConfig returns a tls.Config suitable for server-side TLS termination (TLS bumping).

Jump to

Keyboard shortcuts

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