acmelib

package
v0.0.0-...-2a03479 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LetsEncryptLiveDirectory is the directory path to the live environment for LE.
	LetsEncryptLiveDirectory = acme.LetsEncryptURL
	// LetsEncryptStagingDirectory is the directory path to the staging environment for LE.
	// Use of this directory won't create real certificates.
	LetsEncryptStagingDirectory = "https://acme-staging.api.letsencrypt.org/directory"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	URI          string
	Email        string
	Key          crypto.Signer
	KeyBytes     []byte
	CurrentTerms string
	AgreedTerms  string
}

Account describes a user account for use with the ACME service

type AuthChallenge

type AuthChallenge struct {
	URI string
	// contains filtered or unexported fields
}

AuthChallenge describes any ACME authorization challenge

type CertificateBundle

type CertificateBundle struct {
	CertificatesRaw [][]byte
	Certificates    []*x509.Certificate
	PrivateKey      []byte
	PrivateKeyType  string
}

CertificateBundle contains the certificate chain and private key

func (*CertificateBundle) CertificatesPEM

func (c *CertificateBundle) CertificatesPEM() []byte

CertificatesPEM encodes the certificates to PEM format

func (*CertificateBundle) PrivateKeyPEM

func (c *CertificateBundle) PrivateKeyPEM() []byte

PrivateKeyPEM encodes the private key to PEM format

type Client

type Client interface {
	// RegisterAccount creates a new user account for use with the directoy
	RegisterAccount(ctx context.Context, email string, acceptTOS bool) (*Account, error)
	// UseAccount uses the specified account for directory methods
	UseAccount(ctx context.Context, account *Account) (*Account, error)
	// CreateCertificate creates a new certificate
	CreateCertificate(ctx context.Context, domain string, san []string) (*CertificateBundle, error)
	// BeginAuthorize begins authorization on a domain by requesting the challenge
	BeginAuthorize(ctx context.Context, domain string) (*HTTPAuthChallenge, error)
	// CompleteAuthorize waits for authorization to complete on a challenge
	CompleteAuthorize(ctx context.Context, challenge AuthChallenge) error
	// CompleteAuthorizeURI waits for authorization to complete on a challenge
	CompleteAuthorizeURI(ctx context.Context, challengeURI string) error
}

Client represents an acme client

func NewClient

func NewClient(directoryURL string) (Client, error)

NewClient creates a new client connection to the ACME directory

type HTTPAuthChallenge

type HTTPAuthChallenge struct {
	AuthChallenge
	Path     string
	Response string
}

HTTPAuthChallenge describes an ACME http-01 challenge

Jump to

Keyboard shortcuts

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