Documentation
¶
Index ¶
- Constants
- Variables
- func GetCADirURL(name string) string
- func ObtainCertificate(client *lego.Client, domains []string) (*certificate.Resource, error)
- func ParsePEMBundle(content []byte, inputDomain string) (*x509.Certificate, error)
- func SanitizedDomain(domain string) (string, error)
- func SetChallenge(client *lego.Client, challenge IChallenge) error
- type Account
- type AccountsStorage
- type CertificatesStorage
- func (s *CertificatesStorage) CheckExpire(inputDomain string) (day float64, err error)
- func (s *CertificatesStorage) GetAllResource() ([]*certificate.Resource, error)
- func (s *CertificatesStorage) GetSanitizedDomainSavePath(sanitizedDomain string) string
- func (s *CertificatesStorage) GetSavePath(domain string) (string, error)
- func (s *CertificatesStorage) ParseResourceFindCertificate(resource *certificate.Resource) (*x509.Certificate, error)
- func (s *CertificatesStorage) ReadCertificate(domain string) ([]*x509.Certificate, error)
- func (s *CertificatesStorage) ReadResource(domain string) (*certificate.Resource, error)
- func (s *CertificatesStorage) SaveResource(certRes *certificate.Resource) error
- type DNSChallenge
- type EABRegister
- type HTTPChallenge
- type HTTPMemcachedHostChallenge
- type HTTPPortChallenge
- type HTTPS3BucketChallenge
- type HTTPWebrootChallenge
- type IChallenge
- type IRegister
- type Register
- type TLSChallenge
- type TLSPortChallenge
Constants ¶
View Source
const ( IssuerExt = ".issuer.crt" CertExt = ".crt" KeyExt = ".key" PemExt = ".pem" PfxExt = ".pfx" ResourceExt = ".json" )
View Source
const ( CADirURLLetsencrypt = "letsencrypt" CADirURLLetsencryptStaging = "letsencrypt_staging" CADirURLZerossl = "zerossl" CADirURLGts = "gts" )
Variables ¶
View Source
var CADirURLs = map[string]string{ CADirURLLetsencrypt: lego.LEDirectoryProduction, lego.LEDirectoryProduction: lego.LEDirectoryProduction, CADirURLLetsencryptStaging: lego.LEDirectoryStaging, lego.LEDirectoryStaging: lego.LEDirectoryStaging, CADirURLZerossl: zeroSSLURL, CADirURLGts: gtsURL, // contains filtered or unexported fields }
Functions ¶
func GetCADirURL ¶ added in v0.1.3
func ObtainCertificate ¶
func ParsePEMBundle ¶ added in v0.2.0
func ParsePEMBundle(content []byte, inputDomain string) (*x509.Certificate, error)
func SanitizedDomain ¶ added in v0.1.3
func SetChallenge ¶
func SetChallenge(client *lego.Client, challenge IChallenge) error
Types ¶
type Account ¶
type Account struct {
Email string `json:"email"`
Registration *registration.Resource `json:"registration"`
Key crypto.PrivateKey `json:"-"`
}
Account represents a users local saved credentials.
func NewLegoClient ¶
func (*Account) GetPrivateKey ¶
func (a *Account) GetPrivateKey() crypto.PrivateKey
GetPrivateKey returns the private RSA account key.
func (*Account) GetRegistration ¶
func (a *Account) GetRegistration() *registration.Resource
GetRegistration returns the server registration.
type AccountsStorage ¶
type AccountsStorage struct {
Email string
CADirURL string
// contains filtered or unexported fields
}
func NewAccountsStorage ¶
func NewAccountsStorage(savePath, email, CADirURLOrName string) (*AccountsStorage, error)
NewAccountsStorage Creates a new AccountsStorage.
func (*AccountsStorage) GetCADirURL ¶ added in v0.1.3
func (s *AccountsStorage) GetCADirURL() string
func (*AccountsStorage) GetEmail ¶
func (s *AccountsStorage) GetEmail() string
func (*AccountsStorage) LoadAccount ¶
func (s *AccountsStorage) LoadAccount() (*Account, error)
func (*AccountsStorage) Remove ¶
func (s *AccountsStorage) Remove()
func (*AccountsStorage) Save ¶
func (s *AccountsStorage) Save(account *Account) error
type CertificatesStorage ¶ added in v0.1.3
type CertificatesStorage struct {
// contains filtered or unexported fields
}
func NewCertificatesStorage ¶ added in v0.1.3
func NewCertificatesStorage(savePath, pfxFormat string) (s *CertificatesStorage, err error)
NewCertificatesStorage pfxFormat RC2
func (*CertificatesStorage) CheckExpire ¶ added in v0.1.3
func (s *CertificatesStorage) CheckExpire(inputDomain string) (day float64, err error)
func (*CertificatesStorage) GetAllResource ¶ added in v0.2.0
func (s *CertificatesStorage) GetAllResource() ([]*certificate.Resource, error)
func (*CertificatesStorage) GetSanitizedDomainSavePath ¶ added in v0.2.2
func (s *CertificatesStorage) GetSanitizedDomainSavePath(sanitizedDomain string) string
func (*CertificatesStorage) GetSavePath ¶ added in v0.1.4
func (s *CertificatesStorage) GetSavePath(domain string) (string, error)
func (*CertificatesStorage) ParseResourceFindCertificate ¶ added in v0.2.2
func (s *CertificatesStorage) ParseResourceFindCertificate(resource *certificate.Resource) (*x509.Certificate, error)
func (*CertificatesStorage) ReadCertificate ¶ added in v0.1.3
func (s *CertificatesStorage) ReadCertificate(domain string) ([]*x509.Certificate, error)
func (*CertificatesStorage) ReadResource ¶ added in v0.1.3
func (s *CertificatesStorage) ReadResource(domain string) (*certificate.Resource, error)
func (*CertificatesStorage) SaveResource ¶ added in v0.1.3
func (s *CertificatesStorage) SaveResource(certRes *certificate.Resource) error
type DNSChallenge ¶
type EABRegister ¶
func (*EABRegister) Register ¶
func (r *EABRegister) Register(lego *lego.Client) (*registration.Resource, error)
type HTTPChallenge ¶
type HTTPChallenge struct {
HeaderName string
}
type HTTPMemcachedHostChallenge ¶
type HTTPMemcachedHostChallenge struct {
Hosts []string
}
type HTTPPortChallenge ¶
type HTTPS3BucketChallenge ¶
type HTTPS3BucketChallenge struct {
Bucket string
}
type HTTPWebrootChallenge ¶
type HTTPWebrootChallenge struct {
WebRoot string
}
type IChallenge ¶
type IRegister ¶
type IRegister interface {
Register(lego *lego.Client) (*registration.Resource, error)
}
type TLSChallenge ¶
type TLSChallenge struct {
}
type TLSPortChallenge ¶
type TLSPortChallenge struct {
HostPort string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.