Documentation
¶
Index ¶
- func DecodePEM(data []byte) ([]*pem.Block, error)
- type CertMeta
- type Source
- type Store
- func (s *Store) Delete(ctx context.Context, domain string) error
- func (s *Store) Get(domain string) (CertMeta, bool)
- func (s *Store) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
- func (s *Store) Import(ctx context.Context, domain string, certPEM, keyPEM []byte) (*CertMeta, error)
- func (s *Store) List() []CertMeta
- func (s *Store) Load(ctx context.Context) error
- func (s *Store) Obtain(ctx context.Context, domains []string) error
- func (s *Store) RefreshACME(domains []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CertMeta ¶
type CertMeta struct {
Domain string `json:"domain"`
SANs []string `json:"sans,omitempty"`
Issuer string `json:"issuer,omitempty"`
NotBefore string `json:"not_before,omitempty"`
NotAfter string `json:"not_after,omitempty"`
Source Source `json:"source"`
KeyType string `json:"key_type,omitempty"`
AutoRenew bool `json:"auto_reew"`
}
CertMeta is metadata for a stored certificate.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements engine.CertProvider and provides certificate management capabilities including manual PEM import and metadata tracking.
func New ¶
New creates a certificate store. acmeMgr may be nil (manual-only mode). cacheDir is used for persistence; empty means no persistence.
func (*Store) Delete ¶
Delete removes a certificate. For ACME certs, removes metadata only. For manual certs, also removes PEM files from disk.
func (*Store) GetCertificate ¶
func (s *Store) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate returns a TLS certificate for the given SNI name. Implements engine.CertProvider. Checks manual certs first, then ACME.
func (*Store) Import ¶
func (s *Store) Import(ctx context.Context, domain string, certPEM, keyPEM []byte) (*CertMeta, error)
Import stores a manually provided PEM certificate+key pair.
func (*Store) Load ¶
Load reads persisted metadata and manual certificates from disk. Call this once after New, before first use.
func (*Store) Obtain ¶
Obtain requests a certificate via ACME for the given domains. Implements engine.CertProvider.
func (*Store) RefreshACME ¶
RefreshACME updates metadata for ACME-obtained certs after renewal. Called by the acme.Manager onObtain callback.