Apache2
md_acme_acct.h File Reference
#include "md_store.h"
Include dependency graph for md_acme_acct.h:

Go to the source code of this file.

Data Structures

struct  md_acme_acct_t
 

Macros

#define MD_FN_ACCOUNT   "account.json"
 
#define MD_FN_ACCT_KEY   "account.pem"
 
#define MD_ACME_ACCT_PKEY_BITS   3072
 
#define MD_ACME_ACCT_STAGED   "staged"
 

Typedefs

typedef struct md_acme_acct_t md_acme_acct_t
 

Enumerations

enum  md_acme_acct_st { MD_ACME_ACCT_ST_UNKNOWN , MD_ACME_ACCT_ST_VALID , MD_ACME_ACCT_ST_DEACTIVATED , MD_ACME_ACCT_ST_REVOKED }
 

Functions

struct md_json_tmd_acme_acct_to_json (md_acme_acct_t *acct, apr_pool_t *p)
 
apr_status_t md_acme_acct_from_json (md_acme_acct_t **pacct, struct md_json_t *json, apr_pool_t *p)
 
apr_status_t md_acme_acct_update (md_acme_t *acme)
 
apr_status_t md_acme_acct_validate (md_acme_t *acme, md_store_t *store, apr_pool_t *p)
 
apr_status_t md_acme_agree (md_acme_t *acme, apr_pool_t *p, const char *tos)
 
apr_status_t md_acme_check_agreement (md_acme_t *acme, apr_pool_t *p, const char *agreement, const char **prequired)
 
const char * md_acme_get_agreement (md_acme_t *acme)
 
apr_status_t md_acme_find_acct_for_md (md_acme_t *acme, md_store_t *store, const md_t *md)
 
apr_status_t md_acme_acct_id_for_md (const char **pid, md_store_t *store, md_store_group_t group, const md_t *md, apr_pool_t *p)
 
apr_status_t md_acme_acct_register (md_acme_t *acme, md_store_t *store, const md_t *md, apr_pool_t *p)
 
apr_status_t md_acme_acct_save (md_store_t *store, apr_pool_t *p, md_acme_t *acme, const char **pid, struct md_acme_acct_t *acct, struct md_pkey_t *acct_key)
 
apr_status_t md_acme_acct_deactivate (md_acme_t *acme, apr_pool_t *p)
 
apr_status_t md_acme_acct_load (struct md_acme_acct_t **pacct, struct md_pkey_t **ppkey, md_store_t *store, md_store_group_t group, const char *name, apr_pool_t *p)
 
int md_acme_acct_matches_url (md_acme_acct_t *acct, const char *url)
 
int md_acme_acct_matches_md (md_acme_acct_t *acct, const md_t *md)
 

Macro Definition Documentation

◆ MD_ACME_ACCT_PKEY_BITS

#define MD_ACME_ACCT_PKEY_BITS   3072

◆ MD_ACME_ACCT_STAGED

#define MD_ACME_ACCT_STAGED   "staged"

◆ MD_FN_ACCOUNT

#define MD_FN_ACCOUNT   "account.json"

◆ MD_FN_ACCT_KEY

#define MD_FN_ACCT_KEY   "account.pem"

Typedef Documentation

◆ md_acme_acct_t

An ACME account at an ACME server.

Enumeration Type Documentation

◆ md_acme_acct_st

Enumerator
MD_ACME_ACCT_ST_UNKNOWN 
MD_ACME_ACCT_ST_VALID 
MD_ACME_ACCT_ST_DEACTIVATED 
MD_ACME_ACCT_ST_REVOKED 

Function Documentation

◆ md_acme_acct_deactivate()

apr_status_t md_acme_acct_deactivate ( md_acme_t acme,
apr_pool_t p 
)

Deactivate the current account at the ACME server.

◆ md_acme_acct_from_json()

apr_status_t md_acme_acct_from_json ( md_acme_acct_t **  pacct,
struct md_json_t json,
apr_pool_t p 
)

◆ md_acme_acct_id_for_md()

apr_status_t md_acme_acct_id_for_md ( const char **  pid,
md_store_t store,
md_store_group_t  group,
const md_t md,
apr_pool_t p 
)

Find the account id for a given md.

◆ md_acme_acct_load()

apr_status_t md_acme_acct_load ( struct md_acme_acct_t **  pacct,
struct md_pkey_t **  ppkey,
md_store_t store,
md_store_group_t  group,
const char *  name,
apr_pool_t p 
)

◆ md_acme_acct_matches_md()

int md_acme_acct_matches_md ( md_acme_acct_t acct,
const md_t md 
)

◆ md_acme_acct_matches_url()

int md_acme_acct_matches_url ( md_acme_acct_t acct,
const char *  url 
)

◆ md_acme_acct_register()

apr_status_t md_acme_acct_register ( md_acme_t acme,
md_store_t store,
const md_t md,
apr_pool_t p 
)

Create a new account at the ACME server for an MD. The new account is the one used by the acme instance afterwards, on success.

◆ md_acme_acct_save()

apr_status_t md_acme_acct_save ( md_store_t store,
apr_pool_t p,
md_acme_t acme,
const char **  pid,
struct md_acme_acct_t acct,
struct md_pkey_t acct_key 
)

◆ md_acme_acct_to_json()

struct md_json_t* md_acme_acct_to_json ( md_acme_acct_t acct,
apr_pool_t p 
)

Convert an ACME account form/to JSON.

◆ md_acme_acct_update()

apr_status_t md_acme_acct_update ( md_acme_t acme)

Update the account from the ACME server.

  • Will update acme->acct structure from server on success
  • Will return error status when request failed or account is not known.

◆ md_acme_acct_validate()

apr_status_t md_acme_acct_validate ( md_acme_t acme,
md_store_t store,
apr_pool_t p 
)

Update the account and persist changes in the store, if given (and not NULL).

◆ md_acme_agree()

apr_status_t md_acme_agree ( md_acme_t acme,
apr_pool_t p,
const char *  tos 
)

Agree to the given Terms-of-Service url for the current account.

◆ md_acme_check_agreement()

apr_status_t md_acme_check_agreement ( md_acme_t acme,
apr_pool_t p,
const char *  agreement,
const char **  prequired 
)

Confirm with the server that the current account agrees to the Terms-of-Service given in the agreement url. If the known agreement is equal to this, nothing is done. If it differs, the account is re-validated in the hope that the server announces the Tos URL it wants. If this is equal to the agreement specified, the server is notified of this. If the server requires a ToS that the account thinks it has already given, it is resend.

If an agreement is required, different from the current one, APR_INCOMPLETE is returned and the agreement url is returned in the parameter.

◆ md_acme_find_acct_for_md()

apr_status_t md_acme_find_acct_for_md ( md_acme_t acme,
md_store_t store,
const md_t md 
)

Find an existing account in the local store. On APR_SUCCESS, the acme instance will have a current, validated account to use.

◆ md_acme_get_agreement()

const char* md_acme_get_agreement ( md_acme_t acme)

Get the ToS agreement for current account.