types

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: BSD-2-Clause Imports: 12 Imported by: 0

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) GetEmail

func (a *Account) GetEmail() string

GetEmail returns email.

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 Domain

type Domain struct {
	Main string
	SANs []string
}

Domain holds a domain name with SANs.

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/v3/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.

Jump to

Keyboard shortcuts

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