api

package
v4.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 20 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) (acme.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 {
	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.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.

type OrderOptions

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

OrderOptions used to create an order (optional).

type OrderService

type OrderService service

func (*OrderService) Get

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

Get Gets an order.

func (*OrderService) New

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

New Creates a new order.

func (*OrderService) NewWithOptions

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

NewWithOptions Creates a new order.

func (*OrderService) UpdateForCSR

func (o *OrderService) UpdateForCSR(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