api

package
v0.0.0-...-52ba2a2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2025 License: Apache-2.0 Imports: 19 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

This section is empty.

Types

type AccountService

type AccountService service

func (*AccountService) Deactivate

func (a *AccountService) Deactivate(accountURL string) error

Deactivate Deactivates an account.

func (*AccountService) Get

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

Get Retrieves an account.

func (*AccountService) New

New Creates a new account.

func (*AccountService) NewEAB

func (a *AccountService) NewEAB(accMsg acme.Account, kid, hmacEncoded string) (acme.ExtendedAccount, error)

NewEAB Creates a new account with an External Account Binding.

func (*AccountService) Update

func (a *AccountService) Update(accountURL string, req acme.Account) (acme.Account, error)

Update Updates an account.

type AuthorizationService

type AuthorizationService service

func (*AuthorizationService) Deactivate

func (c *AuthorizationService) Deactivate(authzURL string) error

Deactivate Deactivates an authorization.

func (*AuthorizationService) Get

func (c *AuthorizationService) Get(authzURL string) (*model.Authorization, error)

Get Gets an authorization.

type CertificateService

type CertificateService service

func (*CertificateService) Get

func (c *CertificateService) Get(certURL string, bundle bool) ([]byte, []byte, 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(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(certID string) (*http.Response, 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://datatracker.ietf.org/doc/draft-ietf-acme-ari

func (*CertificateService) Revoke

Revoke Revokes a certificate.

func (*CertificateService) UpdateRenewalInfo

func (c *CertificateService) UpdateRenewalInfo(req acme.RenewalInfoUpdateRequest) (*http.Response, error)

UpdateRenewalInfo POSTs updated renewal information for a certificate to the renewalInfo endpoint. This is used to indicate that a certificate has been replaced.

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://datatracker.ietf.org/doc/draft-ietf-acme-ari

type ChallengeService

type ChallengeService service

func (*ChallengeService) Get

func (c *ChallengeService) Get(chlgURL string) (acme.ExtendedChallenge, error)

Get Gets a challenge.

func (*ChallengeService) New

func (c *ChallengeService) New(chlgURL string) (acme.ExtendedChallenge, error)

New Creates a challenge.

type Core

type Core struct {
	Jws *secure.JWS

	HTTPClient *http.Client

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

func New

func New(httpClient *http.Client, userAgent, caDirURL, kid string, privateKey crypto.PrivateKey) (*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.

func (*Core) Post

func (a *Core) Post(uri string, reqBody, response interface{}) (*http.Response, error)

post performs an HTTP POST request and parses the response body as JSON, into the provided respBody object.

type OrderOptions

type OrderOptions struct {
	NotBefore time.Time
	NotAfter  time.Time
	// A string uniquely identifying a previously-issued certificate which this
	// order is intended to replace.
	// - https://datatracker.ietf.org/doc/html/draft-ietf-model-ari-03#section-5
	ReplacesCertID string
}

OrderOptions used to create an order (optional).

type OrderService

type OrderService service

func (*OrderService) Get

func (o *OrderService) Get(orderURL string) (model.ExtendedOrder, error)

Get Gets an order.

func (*OrderService) New

func (o *OrderService) New(domains []string) (model.ExtendedOrder, error)

New Creates a new order.

func (*OrderService) NewWithOptions

func (o *OrderService) NewWithOptions(domains []string, opts *OrderOptions) (model.ExtendedOrder, error)

NewWithOptions Creates a new order.

func (*OrderService) UpdateForCSR

func (o *OrderService) UpdateForCSR(orderURL string, csr []byte) (model.ExtendedOrder, error)

UpdateForCSR Updates an order for a CSR.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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