Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
KeyType string
Email string
KeyPath string
CertPath string
DomainsCertificate *DomainCertificate
Logger logger.Interface `json:"-"`
PrivateKey []byte
Registration *registration.Resource
}
Account is used to store lets encrypt registration info and implements the acme.User interface.
func NewAccount ¶
func NewAccount(email string, domain *Domain, keyType string, keyPath, certPath string, logger logger.Interface) (*Account, error)
NewAccount creates a new account for the specified email and domain.
func (*Account) GetKeyType ¶
func (a *Account) GetKeyType() certcrypto.KeyType
GetKeyType the type from which private keys should be generated
func (*Account) GetPrivateKey ¶
func (a *Account) GetPrivateKey() crypto.PrivateKey
GetPrivateKey returns private key.
func (*Account) GetRegistration ¶
func (a *Account) GetRegistration() *registration.Resource
GetRegistration returns lets encrypt registration resource.
type DomainCertificate ¶
type DomainCertificate struct {
Certificate *Resource
Domain *Domain
TLSCert *tls.Certificate `json:"-"`
}
DomainCertificate contains a certificate for a domain and SANs.
func (*DomainCertificate) AddCertificate ¶
func (dc *DomainCertificate) AddCertificate(acmeCert *certificate.Resource, domain *Domain) error
AddCertificate add the certificate for the domain.
func (*DomainCertificate) Init ¶
func (dc *DomainCertificate) Init() error
Init initialises the tls certificate.
func (*DomainCertificate) RenewCertificate ¶
func (dc *DomainCertificate) RenewCertificate(acmeCert *certificate.Resource, domain *Domain) error
RenewCertificate renew the certificate for the domain.
type Resource ¶
type Resource struct {
Domain string `json:"domain"`
CertURL string `json:"certUrl"`
CertStableURL string `json:"certStableUrl"`
PrivateKey []byte `json:"privateKey"`
Certificate []byte `json:"certificate"`
IssuerCertificate []byte `json:"issuerCertificate"`
CSR []byte `json:"CSR"`
}
Certificate is used to store certificate info. copy struct from github.com/go-acme/lego/v4/certificate.Resource but allow save PrivateKey and Certificate field etc ... Resource represents a CA issued certificate. PrivateKey, Certificate and IssuerCertificate are all already PEM encoded and can be directly written to disk. Certificate may be a certificate bundle, depending on the options supplied to create it.