certificate

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	Certificate *x509.Certificate
	PrivateKey  interface{}
	CertBytes   []byte
	KeyBytes    []byte
}

Certificate represents a certificate with its key

type Manager

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

Manager handles certificate generation and management

func NewManager

func NewManager() *Manager

NewManager creates a new certificate manager

func (*Manager) CacheCertificate

func (m *Manager) CacheCertificate(hostname string, cert *Certificate) error

CacheCertificate caches a certificate

func (*Manager) ClearCache

func (m *Manager) ClearCache()

ClearCache clears all cached certificates

func (*Manager) DisableAutoGenerate

func (m *Manager) DisableAutoGenerate()

DisableAutoGenerate disables automatic certificate generation

func (*Manager) EnableAutoGenerate

func (m *Manager) EnableAutoGenerate()

EnableAutoGenerate enables automatic certificate generation

func (*Manager) GenerateProxyCertificate

func (m *Manager) GenerateProxyCertificate(hostname string) (*Certificate, error)

GenerateProxyCertificate generates a proxy certificate for MITM

func (*Manager) GenerateSelfSigned

func (m *Manager) GenerateSelfSigned() (*Certificate, error)

GenerateSelfSigned generates a self-signed CA certificate

func (*Manager) GetCACertificate

func (m *Manager) GetCACertificate() (*Certificate, error)

GetCACertificate returns the CA certificate

func (*Manager) GetCertificate

func (m *Manager) GetCertificate(hostname string) (*Certificate, error)

GetCertificate retrieves a cached certificate

func (*Manager) GetCertificateCount

func (m *Manager) GetCertificateCount() int

GetCertificateCount returns the number of cached certificates

func (*Manager) IsAutoGenerateEnabled

func (m *Manager) IsAutoGenerateEnabled() bool

IsAutoGenerateEnabled checks if auto-generation is enabled

func (*Manager) Save

func (m *Manager) Save(cert *Certificate, certPath, keyPath string) error

Save saves a certificate to file

Jump to

Keyboard shortcuts

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