acme

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: BSD-2-Clause Imports: 11 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 {
	Status  string   `json:"status"`
	Contact []string `json:"contact,omitempty"`
	Orders  string   `json:"orders,omitempty"`
}

Account represents an ACME account object.

type Authorization

type Authorization struct {
	Status     string      `json:"status"`
	Identifier Identifier  `json:"identifier"`
	Challenges []Challenge `json:"challenges"`
	Wildcard   bool        `json:"wildcard,omitempty"`
}

Authorization represents an ACME authorization object.

type Challenge

type Challenge struct {
	Type      string `json:"type"`
	URL       string `json:"url"`
	Status    string `json:"status"`
	Token     string `json:"token"`
	Validated string `json:"validated,omitempty"`
}

Challenge represents an individual ACME challenge.

type Client

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

Client is a ACME protocol client, using an ES256 account key.

func NewClient

func NewClient(httpClient *http.Client, signer *jws.Signer, kid string) *Client

NewClient creates a new ACME client. If httpClient is nil, http.DefaultClient is used. You may use Client.FetchDirectory to associate the client with an ACME provider. Supply an empty kid during initial registration.

func (*Client) Directory

func (c *Client) Directory() Directory

Directory returns the last directory fetched for this client.

func (*Client) FetchDirectory

func (c *Client) FetchDirectory(url string) (Directory, error)

FetchDirectory retrieves the ACME directory from url and stores it on the client.

func (*Client) FinalizeOrder

func (c *Client) FinalizeOrder(finalizeURL string, csrDER []byte) (*Order, error)

FinalizeOrder sends the CSR to the order's finalize URL and returns the updated order.

csrDER must be a DER-encoded certificate signing request.

func (*Client) GetAccount

func (c *Client) GetAccount(accountURL string) (*Account, error)

GetAccount fetches the current account object via POST-as-GET.

accountURL is both the request URL and the KID.

func (*Client) GetAuthorization

func (c *Client) GetAuthorization(url string) (*Authorization, error)

GetAuthorization fetches an authorization object via POST-as-GET.

func (*Client) GetCertificates

func (c *Client) GetCertificates(certificateURL string) ([][]byte, error)

GetCertificates fetches certificate via POST-as-GET as DER.

func (*Client) GetOrder

func (c *Client) GetOrder(orderURL string) (*Order, error)

GetOrder fetches an order object via POST-as-GET.

func (*Client) NewAccount

func (c *Client) NewAccount(j *jwk.PublicJWK, payload NewAccountPayload) (*Account, string, error)

NewAccount creates a new ACME account and returns the Account and its KID (account URL).

func (*Client) NewOrder

func (c *Client) NewOrder(ids []Identifier) (*Order, error)

NewOrder creates a new order.

func (*Client) TriggerChallenge

func (c *Client) TriggerChallenge(url string) (*Challenge, error)

TriggerChallenge requests validation for the given challenge URL and returns the updated challenge.

type Directory

type Directory struct {
	NewNonce   string `json:"newNonce"`
	NewAccount string `json:"newAccount"`
	NewOrder   string `json:"newOrder"`
	RevokeCert string `json:"revokeCert"`
	KeyChange  string `json:"keyChange"`
}

Directory contains ACME server endpoint URLs.

type Identifier

type Identifier struct {
	Type  string `json:"type"`  // e.g. "dns"
	Value string `json:"value"` // e.g. "example.com"
}

Identifier represents an ACME identifier, usually a DNS name.

type NewAccountPayload

type NewAccountPayload struct {
	Contact              []string `json:"contact,omitempty"`
	TermsOfServiceAgreed bool     `json:"termsOfServiceAgreed"`
}

NewAccountPayload is sent to the ACME newAccount endpoint.

type NewOrderPayload

type NewOrderPayload struct {
	Identifiers []Identifier `json:"identifiers"`
}

NewOrderPayload is used when creating a new order.

type Order

type Order struct {
	Status         string       `json:"status"`
	Expires        string       `json:"expires,omitempty"`
	Identifiers    []Identifier `json:"identifiers"`
	Authorizations []string     `json:"authorizations"`
	Finalize       string       `json:"finalize"`
	Certificate    string       `json:"certificate,omitempty"`

	URL string `json:"-"` // Location header
}

Order represents an ACME order object.

type Problem

type Problem struct {
	Type        string    `json:"type"`
	Detail      string    `json:"detail"`
	Status      int       `json:"status"`
	Subproblems []Problem `json:"subproblems,omitempty"`
}

Problem represents an ACME problem.

func (*Problem) Error

func (p *Problem) Error() string

Jump to

Keyboard shortcuts

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