letsencrypt

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2016 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StorageDir       = "/etc/letsencrypt"
	ProductionApiUri = "https://acme-v01.api.letsencrypt.org/directory"
	StagingApiUri    = "https://acme-staging.api.letsencrypt.org/directory"
)
View Source
const (
	CLOUDFLARE   = DnsProvider("CloudFlare")
	DIGITALOCEAN = DnsProvider("DigitalOcean")
	ROUTE53      = DnsProvider("Route53")
	DNSIMPLE     = DnsProvider("DNSimple")
	DYN          = DnsProvider("Dyn")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Email        string                     `json:"email"`
	Registration *lego.RegistrationResource `json:"registrations"`
	// contains filtered or unexported fields
}

func NewAccount

func NewAccount(email string, apiVer ApiVersion, keyType lego.KeyType) (*Account, error)

NewAccount creates a new or gets a stored LE account for the given email

func (*Account) GetEmail

func (a *Account) GetEmail() string

GetEmail returns the email address for the account

func (*Account) GetPrivateKey

func (a *Account) GetPrivateKey() crypto.PrivateKey

GetPrivateKey returns the private RSA account key.

func (*Account) GetRegistration

func (a *Account) GetRegistration() *lego.RegistrationResource

GetRegistration returns the server registration

func (*Account) Save

func (a *Account) Save() error

Save the account to disk

type AcmeCertificate

type AcmeCertificate struct {
	lego.CertificateResource
	DnsNames     string    `json:"dnsNames"`
	ExpiryDate   time.Time `json:"expiryDate"`
	SerialNumber string    `json:"serialNumber"`
}

AcmeCertificate represents a CA issued certificate, PrivateKey and Certificate are both PEM encoded.

Anonymous fields: PrivateKey []byte Certificate []byte Domain string

type ApiVersion added in v0.2.6

type ApiVersion string
const (
	Production ApiVersion = "Production"
	Sandbox    ApiVersion = "Sandbox"
)

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a Lets Encrypt client

func NewClient

func NewClient(email string, kt KeyType, apiVer ApiVersion, provider ProviderOpts) (*Client, error)

NewClient returns a new Lets Encrypt client

func (*Client) CertPath added in v0.2.6

func (c *Client) CertPath(certName string) string

func (*Client) ConfigPath added in v0.2.6

func (c *Client) ConfigPath() string

func (*Client) EnableDebug added in v0.2.6

func (c *Client) EnableDebug()

EnableDebugLogging enables logging in the upstream lego library

func (*Client) GetStoredCertificate added in v0.2.6

func (c *Client) GetStoredCertificate(certName string, domains []string) (bool, *AcmeCertificate)

GetStoredCertificate returns the locally stored certificate for the given domains

func (*Client) Issue

func (c *Client) Issue(certName string, domains []string) (*AcmeCertificate, map[string]error)

Issue obtains a new SAN certificate from the Lets Encrypt CA

func (*Client) Renew

func (c *Client) Renew(certName string) (*AcmeCertificate, error)

Renew renewes the given stored certificate

type DnsProvider

type DnsProvider string

type KeyType added in v0.2.6

type KeyType string
const (
	RSA2048 KeyType = "RSA-2048"
	RSA4096 KeyType = "RSA-4096"
	RSA8192 KeyType = "RSA-8192"
	EC256   KeyType = "ECDSA-256"
	EC384   KeyType = "ECDSA-384"
)

type ProviderOpts

type ProviderOpts struct {
	Provider DnsProvider

	// CloudFlare credentials
	CloudflareEmail string
	CloudflareKey   string

	// DigitalOcean credentials
	DoAccessToken string

	// AWS Route 53 credentials
	AwsAccessKey string
	AwsSecretKey string

	// DNSimple credentials
	DNSimpleEmail string
	DNSimpleKey   string

	// Dyn credentials
	DynCustomerName string
	DynUserName     string
	DynPassword     string
}

ProviderOpts is used to configure the DNS provider used by the Let's Encrypt client for domain validation

Jump to

Keyboard shortcuts

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