api

package
v5.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoARI = errors.New("renewalInfo[get/post]: server does not advertise a renewal info endpoint")

ErrNoARI is returned when the server does not advertise a renewal info endpoint.

Functions

func MakeARICertID

func MakeARICertID(leaf *x509.Certificate) (string, error)

MakeARICertID constructs a certificate identifier as described in RFC 9773, section 4.1.

Types

type AccountService

type AccountService service

func (*AccountService) Deactivate

func (a *AccountService) Deactivate(ctx context.Context, accountURL string) error

Deactivate Deactivates an account. https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3.6

func (*AccountService) Get

func (a *AccountService) Get(ctx context.Context, accountURL string) (acme.Account, error)

Get Retrieves an account.

func (*AccountService) KeyChange

func (a *AccountService) KeyChange(ctx context.Context, newKey crypto.Signer) error

KeyChange Changes the account key. https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3.5

func (*AccountService) New

New Creates a new account.

func (*AccountService) NewEAB

func (a *AccountService) NewEAB(ctx context.Context, req acme.Account, kid, hmacEncoded string) (acme.ExtendedAccount, error)

NewEAB Creates a new account with an External Account Binding.

type AuthorizationService

type AuthorizationService service

func (*AuthorizationService) Deactivate

func (c *AuthorizationService) Deactivate(ctx context.Context, authzURL string) error

Deactivate Deactivates an authorization.

func (*AuthorizationService) Get

Get Gets an authorization.

type CertificateService

type CertificateService service

func (*CertificateService) Get

func (c *CertificateService) Get(ctx context.Context, certURL string, bundle bool) (*acme.RawCertificate, error)

Get Returns the certificate and the issuer certificate. 'bundle' is only applied if the issuer is provided by the 'up' link.

func (*CertificateService) GetAll

func (c *CertificateService) GetAll(ctx context.Context, certURL string, bundle bool) (map[string]*acme.RawCertificate, error)

GetAll the certificates and the alternate certificates. bundle' is only applied if the issuer is provided by the 'up' link.

func (*CertificateService) GetRenewalInfo

func (c *CertificateService) GetRenewalInfo(ctx context.Context, certID string) (*acme.ExtendedRenewalInfo, error)

GetRenewalInfo GETs renewal information for a certificate from the renewalInfo endpoint. This is used to determine if a certificate needs to be renewed.

Note: this endpoint is part of a draft specification, not all ACME servers will implement it. This method will return api.ErrNoARI if the server does not advertise a renewal info endpoint.

https://www.rfc-editor.org/rfc/rfc9773.html

func (*CertificateService) Revoke

Revoke Revokes a certificate.

type ChallengeService

type ChallengeService service

func (*ChallengeService) Get

Get Gets a challenge.

func (*ChallengeService) New

New Creates a challenge.

type Core

type Core struct {
	HTTPClient *http.Client

	Accounts       *AccountService
	Authorizations *AuthorizationService
	Certificates   *CertificateService
	Challenges     *ChallengeService
	Orders         *OrderService
	// contains filtered or unexported fields
}

Core ACME/LE core API.

func New

func New(httpClient *http.Client, userAgent, caDirURL, kid string, privateKey crypto.Signer) (*Core, error)

New Creates a new Core.

func (*Core) GetDirectory

func (a *Core) GetDirectory() acme.Directory

func (*Core) GetKeyAuthorization

func (a *Core) GetKeyAuthorization(token string) (string, error)

GetKeyAuthorization Gets the key authorization.

type OrderOptions

type OrderOptions struct {
	NotBefore time.Time
	NotAfter  time.Time

	// A string uniquely identifying the profile
	// which will be used to affect issuance of the certificate requested by this Order.
	// - https://www.ietf.org/archive/id/draft-ietf-acme-profiles-01.html#name-extensions-to-the-order-res
	Profile string

	// A string uniquely identifying a previously-issued certificate which this
	// order is intended to replace.
	// - https://www.rfc-editor.org/rfc/rfc9773.html#section-5
	ReplacesCertID string
}

OrderOptions used to create an order (optional).

type OrderService

type OrderService service

func (*OrderService) Get

func (o *OrderService) Get(ctx context.Context, orderURL string) (acme.ExtendedOrder, error)

Get Gets an order.

func (*OrderService) New

func (o *OrderService) New(ctx context.Context, domains []string, opts *OrderOptions) (acme.ExtendedOrder, error)

New Creates a new order.

func (*OrderService) UpdateForCSR

func (o *OrderService) UpdateForCSR(ctx context.Context, orderURL string, csr []byte) (acme.ExtendedOrder, error)

UpdateForCSR Updates an order for a CSR.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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