Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Logger *log.Logger
Logger is used to log errors; if nil, the default log.Logger is used.
Functions ¶
This section is empty.
Types ¶
type CertificateResource ¶
type CertificateResource struct {
Domain string
CertURL string
PrivateKey []byte
Certificate []byte
}
CertificateResource represents a CA issued certificate. PrivateKey and Certificate are both already PEM encoded and can be directly written to disk.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the user-friendy way to ACME
func (*Client) AgreeToTos ¶
AgreeToTos updates the Client registration and sends the agreement to the server.
func (*Client) ObtainCertificates ¶
func (c *Client) ObtainCertificates(domains []string) ([]CertificateResource, error)
ObtainCertificates tries to obtain certificates from the CA server using the challenges it has configured. The returned certificates are DER encoded byte slices.
func (*Client) Register ¶
func (c *Client) Register() (*RegistrationResource, error)
Register the current account to the ACME server.
func (*Client) RevokeCertificate ¶
type Registration ¶
type Registration struct {
Resource string `json:"resource,omitempty"`
ID int `json:"id"`
Key struct {
Kty string `json:"kty"`
N string `json:"n"`
E string `json:"e"`
} `json:"key"`
Contact []string `json:"contact"`
Agreement string `json:"agreement,omitempty"`
Authorizations string `json:"authorizations,omitempty"`
Certificates string `json:"certificates,omitempty"`
}
Registration is returned by the ACME server after the registration The client implementation should save this registration somewhere.
type RegistrationResource ¶
type RegistrationResource struct {
Body Registration
URI string
NewAuthzURL string
TosURL string
}
RegistrationResource represents all important informations about a registration of which the client needs to keep track itself.
type User ¶
type User interface {
GetEmail() string
GetRegistration() *RegistrationResource
GetPrivateKey() *rsa.PrivateKey
}
User interface is to be implemented by users of this library. It is used by the client type to get user specific information.