Skip to content

Latest commit

 

History

History
245 lines (168 loc) · 10.1 KB

client.md

File metadata and controls

245 lines (168 loc) · 10.1 KB

AcmeClient

AcmeClient

Kind: global class

new AcmeClient(opts)

Param Type Description
opts object
opts.directoryUrl string ACME directory URL
opts.accountKey buffer | string PEM encoded account private key
[opts.backoffAttempts] number Maximum number of backoff attempts, default: 5
[opts.backoffMin] number Minimum backoff attempt delay in milliseconds, default: 5000
[opts.backoffMax] number Maximum backoff attempt delay in milliseconds, default: 30000

acmeClient.getTermsOfServiceUrl() ⇒ Promise.<string>

Get Terms of Service URL

Kind: instance method of AcmeClient
Returns: Promise.<string> - ToS URL

acmeClient.createAccount([data]) ⇒ Promise.<object>

Create a new account

https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#account-creation

Kind: instance method of AcmeClient
Returns: Promise.<object> - Account

Param Type Description
[data] object Request data

acmeClient.updateAccount([data]) ⇒ Promise.<object>

Update existing account

https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#account-update

Kind: instance method of AcmeClient
Returns: Promise.<object> - Account

Param Type Description
[data] object Request data

acmeClient.updateAccountKey(newAccountKey, [data]) ⇒ Promise.<object>

Update account private key

https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#account-key-roll-over

Kind: instance method of AcmeClient
Returns: Promise.<object> - Account

Param Type Description
newAccountKey buffer | string New PEM encoded private key
[data] object Additional request data

acmeClient.createOrder(data) ⇒ Promise.<object>

Create a new order

https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#applying-for-certificate-issuance

Kind: instance method of AcmeClient
Returns: Promise.<object> - Order

Param Type Description
data object Request data

acmeClient.finalizeOrder(order, csr) ⇒ Promise.<object>

Finalize order

https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#applying-for-certificate-issuance

Kind: instance method of AcmeClient
Returns: Promise.<object> - Order

Param Type Description
order object Order object
csr buffer | string PEM encoded Certificate Signing Request

acmeClient.getAuthorizations(order) ⇒ Promise.<Array.<object>>

Get identifier authorizations from order

https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#identifier-authorization

Kind: instance method of AcmeClient
Returns: Promise.<Array.<object>> - Authorizations

Param Type Description
order object Order

acmeClient.deactivateAuthorization(authz) ⇒ Promise.<object>

Deactivate identifier authorization

https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#deactivating-an-authorization

Kind: instance method of AcmeClient
Returns: Promise.<object> - Authorization

Param Type Description
authz object Identifier authorization

acmeClient.getChallengeKeyAuthorization(challenge) ⇒ Promise.<string>

Get key authorization for ACME challenge

https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#key-authorizations

Kind: instance method of AcmeClient
Returns: Promise.<string> - Key authorization

Param Type Description
challenge object Challenge object returned by API

acmeClient.verifyChallenge(authz, challenge) ⇒ Promise

Verify that ACME challenge is satisfied

Kind: instance method of AcmeClient

Param Type Description
authz object Identifier authorization
challenge object Authorization challenge

acmeClient.completeChallenge(challenge) ⇒ Promise.<object>

Notify provider that challenge has been completed

https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#responding-to-challenges

Kind: instance method of AcmeClient
Returns: Promise.<object> - Challenge

Param Type Description
challenge object Challenge object returned by API

acmeClient.waitForValidStatus(item) ⇒ Promise.<object>

Wait for ACME provider to verify status on a order, authorization or challenge

https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#responding-to-challenges

Kind: instance method of AcmeClient
Returns: Promise.<object> - Valid order, authorization or challenge

Param Type Description
item object An order, authorization or challenge object

acmeClient.getCertificate(order) ⇒ Promise.<buffer>

Get certificate from ACME order

https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#downloading-the-certificate

Kind: instance method of AcmeClient
Returns: Promise.<buffer> - Certificate

Param Type Description
order object Order object

acmeClient.revokeCertificate(cert, [data]) ⇒ Promise

Revoke certificate

https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#certificate-revocation

Kind: instance method of AcmeClient

Param Type Description
cert buffer | string PEM encoded certificate
[data] object Additional request data

acmeClient.auto(opts) ⇒ Promise.<buffer>

Auto mode

Kind: instance method of AcmeClient
Returns: Promise.<buffer> - Certificate

Param Type Description
opts object
opts.csr buffer | string Certificate Signing Request
opts.challengeCreateFn function Function returning Promise triggered before completing ACME challenge
opts.challengeRemoveFn function Function returning Promise triggered after completing ACME challenge
[opts.email] string Account email address
[opts.termsOfServiceAgreed] boolean Agree to Terms of Service, default: false
[opts.challengePriority] Array.<string> Array defining challenge type priority, default: ['http-01', 'dns-01']