acme

package
v0.0.0-...-9160122 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2015 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 NewClient

func NewClient(caURL string, usr User, keyBits int, optPort string) *Client

NewClient creates a new client for the set user.

func (*Client) AgreeToTos

func (c *Client) AgreeToTos() error

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

func (c *Client) RevokeCertificate(certificate []byte) error

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.

Jump to

Keyboard shortcuts

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