Module leec_api

This module centralises the main functions regarding the API used to interact with ACME servers.

Description

This module centralises the main functions regarding the API used to interact with ACME servers.

Data Types

bin_certificate()

bin_certificate() = leec:bin_certificate()

bin_csr_key()

bin_csr_key() = leec:bin_csr_key()

bin_domain()

bin_domain() = leec:bin_domain()

bin_string()

bin_string() = text_utils:bin_string()

bin_uri()

bin_uri() = web_utils:bin_uri()

cert_req_option_map()

cert_req_option_map() = leec:cert_req_option_map()

challenge()

challenge() = leec:challenge()

directory_map()

directory_map() = leec:directory_map()

environment()

environment() = leec:environment()

json_map_decoded()

json_map_decoded() = leec:json_map_decoded()

jws()

jws() = leec:jws()

leec_http_state()

leec_http_state() = leec:leec_http_state()

maybe()

maybe(T) = basic_utils:maybe(T)

nonce()

nonce() = web_utils:nonce()

order_map()

order_map() = leec:order_map()

table()

table(K, V) = map_hashtable:map_hashtable(K, V)

tcp_connection_cache()

tcp_connection_cache() = leec:tcp_connection_cache()

tls_private_key()

tls_private_key() = leec:tls_private_key()

void()

void() = basic_utils:void()

Function Index

binary_to_status/1Returns the status corresponding to specified binary string.
close_tcp_connections/1Closes all pending (cached) TCP connections.
finalize_order/6Finalizes the order once a challenge has been validated.
get_acme_account/5Requests an account obtained (indirectly) for specified private key.
get_certificate/5Downloads certificate for finalized order and returns itself.
get_directory_map/3Returns a directory map listing all ACME protocol URLs.
get_nonce/3Gets and returns a fresh nonce by using the corresponding URI.
get_order/5Orders a new certificate from the ACME server.
get_tcp_connection/4Returns a suitable TCP connection.
notify_ready_for_challenge/5Notifies the ACME server that we are ready for challenge validation.
request_authorization/5Requests authorization for given identifier.
request_new_certificate/6Requests (orders from ACME) a new certificate (of DNS type).

Function Details

binary_to_status/1

binary_to_status(InvalidBinStatus::bin_string()) -> leec:status()

Returns the status corresponding to specified binary string.

close_tcp_connections/1

close_tcp_connections(TCPCache::tcp_connection_cache()) -> void()

Closes all pending (cached) TCP connections.

finalize_order/6

finalize_order(OrderDirMap::order_map(), Csr::bin_csr_key(), PrivKey::tls_private_key(), Jws::jws(), CertReqOptionMap::cert_req_option_map(), LHState::leec_http_state()) -> {{json_map_decoded(), bin_uri(), nonce()}, leec_http_state()}

Finalizes the order once a challenge has been validated.

Refer to https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.

get_acme_account/5

get_acme_account(DirMap::directory_map(), PrivKey::tls_private_key(), Jws::jws(), CertReqOptionMap::cert_req_option_map(), LHState::leec_http_state()) -> {{json_map_decoded(), bin_uri(), nonce()}, leec_http_state()}

Requests an account obtained (indirectly) for specified private key.

Refer to https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3.1.

This is either a new account or one that was already created by this FSM.

Returns {Response, Location, Nonce}, where:

- Response is json (decoded as map)

- Location is the URL corresponding to the created ACME account

- Nonce is a new valid replay-nonce

get_certificate/5

get_certificate(X1::order_map(), Key::tls_private_key(), Jws::jws(), CertReqOptionMap::cert_req_option_map(), LHState::leec_http_state()) -> {{bin_certificate(), nonce()}, leec_http_state()}

Downloads certificate for finalized order and returns itself.

Refer to https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.2.

get_directory_map/3

get_directory_map(Env::environment(), CertReqOptionMap::cert_req_option_map(), LHState::leec_http_state()) -> {leec:directory_map(), leec_http_state()}

Returns a directory map listing all ACME protocol URLs.

Refer to https://www.rfc-editor.org/rfc/rfc8555.html#section-7.1.1.

get_nonce/3

get_nonce(DirMap::directory_map(), CertReqOptionMap::cert_req_option_map(), LHState::leec_http_state()) -> {nonce(), leec_http_state()}

Gets and returns a fresh nonce by using the corresponding URI.

Refer to https://www.rfc-editor.org/rfc/rfc8555.html#section-7.2.

get_order/5

get_order(BinUri::bin_uri(), PrivKey::tls_private_key(), Jws::jws(), CertReqOptionMap::cert_req_option_map(), LHState::leec_http_state()) -> {{json_map_decoded(), bin_uri(), nonce()}, leec_http_state()}

Orders a new certificate from the ACME server.

get_tcp_connection/4

get_tcp_connection(Proto::web_utils:protocol_type(), Host::net_utils:string_host_name(), Port::net_utils:tcp_port(), TCPCache::tcp_connection_cache()) -> {shotgun:connection(), tcp_connection_cache()}

Returns a suitable TCP connection.

If a connection to the given Proto://Host:Port is already opened, returns it, otherwise returns a newly opened connection.

notify_ready_for_challenge/5

notify_ready_for_challenge(Challenge::challenge(), PrivKey::tls_private_key(), Jws::jws(), CertReqOptionMap::cert_req_option_map(), LHState::leec_http_state()) -> {{json_map_decoded(), bin_uri(), nonce()}, leec_http_state()}

Notifies the ACME server that we are ready for challenge validation.

Refer to https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1.

Returns {Response, Location, Nonce}, where:

- Response is json (decoded as map)

- Location is create account url

- Nonce is a new valid replay-nonce

request_authorization/5

request_authorization(AuthUri::bin_uri(), PrivKey::tls_private_key(), Jws::jws(), CertReqOptionMap::cert_req_option_map(), LHState::leec_http_state()) -> {{json_map_decoded(), bin_uri(), nonce()}, leec_http_state()}

Requests authorization for given identifier.

Refer to https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.1.

Returns {Response, Location, Nonce}, where: - Response is json (decoded as map) - Location is create account url - Nonce is a new valid replay-nonce

request_new_certificate/6

request_new_certificate(DirMap::directory_map(), BinDomains::[bin_domain()], PrivKey::tls_private_key(), AccountJws::jws(), CertReqOptionMap::cert_req_option_map(), LHState::leec_http_state()) -> {{json_map_decoded(), bin_uri(), nonce()}, leec_http_state()}

Requests (orders from ACME) a new certificate (of DNS type).

Refer to https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.

Returns {Response, Location, Nonce}, where:

- Response is json (decoded as map)

- Location is the URL corresponding to the created ACME account

- Nonce is a new valid replay-nonce


Generated by EDoc