Documentation
¶
Index ¶
- type Account
- type Authorization
- type Challenge
- type Client
- func (c *Client) Directory() Directory
- func (c *Client) FetchDirectory(url string) (Directory, error)
- func (c *Client) FinalizeOrder(finalizeURL string, csrDER []byte) (*Order, error)
- func (c *Client) GetAccount(accountURL string) (*Account, error)
- func (c *Client) GetAuthorization(url string) (*Authorization, error)
- func (c *Client) GetCertificates(certificateURL string) ([][]byte, error)
- func (c *Client) GetOrder(orderURL string) (*Order, error)
- func (c *Client) NewAccount(j *jwk.PublicJWK, payload NewAccountPayload) (*Account, string, error)
- func (c *Client) NewOrder(ids []Identifier) (*Order, error)
- func (c *Client) TriggerChallenge(url string) (*Challenge, error)
- type Directory
- type Identifier
- type NewAccountPayload
- type NewOrderPayload
- type Order
- type Problem
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 ¶
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) FetchDirectory ¶
FetchDirectory retrieves the ACME directory from url and stores it on the client.
func (*Client) FinalizeOrder ¶
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 ¶
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 ¶
GetCertificates fetches certificate via POST-as-GET as DER.
func (*Client) NewAccount ¶
NewAccount creates a new ACME account and returns the Account and its KID (account URL).
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.