diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-01-19 14:38:57 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-01-19 14:38:57 +0100 |
commit | 21e28d6d049a948fe71817da7cb3e3b0f1639eb6 (patch) | |
tree | 40dc5e591676cf64d67d4986ab580402d5db498b /src/include/anastasis.h | |
parent | 18c53ce9ac45efbf6bcb53995eb5d10a357c5846 (diff) | |
download | anastasis-21e28d6d049a948fe71817da7cb3e3b0f1639eb6.tar.gz anastasis-21e28d6d049a948fe71817da7cb3e3b0f1639eb6.tar.bz2 anastasis-21e28d6d049a948fe71817da7cb3e3b0f1639eb6.zip |
implement routine to download meta data and decrypt to libanastasis; improve API to include timestamp
Diffstat (limited to 'src/include/anastasis.h')
-rw-r--r-- | src/include/anastasis.h | 67 |
1 files changed, 64 insertions, 3 deletions
diff --git a/src/include/anastasis.h b/src/include/anastasis.h index b957f18..92c0745 100644 --- a/src/include/anastasis.h +++ b/src/include/anastasis.h @@ -374,6 +374,67 @@ ANASTASIS_challenge_abort (struct ANASTASIS_Challenge *c); /** + * Handle for an operation to get available recovery + * document versions. + */ +struct ANASTASIS_VersionCheck; + + +/** + * Callback which passes back meta data about one of the + * recovery documents available at the provider. + * + * @param cls closure for the callback + * @param version version number of the policy document, + * 0 for the end of the list + * @param server_time time of the backup at the provider + * @param recdoc_id hash of the compressed recovery document, uniquely + * identifies the document; NULL for the end of the list + * @param secret_name name of the secret as chosen by the user, + * or NULL if the user did not provide a name + */ +typedef void +(*ANASTASIS_MetaPolicyCallback)(void *cls, + uint32_t version, + struct GNUNET_TIME_Timestamp server_time, + const struct GNUNET_HashCode *recdoc_id, + const char *secret_name); + + +/** + * Obtain an overview of available recovery policies from the + * specified provider. + * + * @param ctx context for making HTTP requests + * @param id_data contains the users identity, (user account on providers) + * @param version defines the version which will be downloaded, 0 for latest version + * @param anastasis_provider_url provider url + * @param provider_salt the server salt + * @param mpc function called with the available versions + * @param mpc_cls closure for @a mpc callback + * @return recovery operation handle + */ +struct ANASTASIS_VersionCheck * +ANASTASIS_recovery_get_versions ( + struct GNUNET_CURL_Context *ctx, + const json_t *id_data, + unsigned int max_version, + const char *anastasis_provider_url, + const struct ANASTASIS_CRYPTO_ProviderSaltP *provider_salt, + ANASTASIS_MetaPolicyCallback mpc, + void *mpc_cls); + + +/** + * Cancel version check operation. + * + * @param vc operation to cancel + */ +void +ANASTASIS_recovery_get_versions_cancel (struct ANASTASIS_VersionCheck *vc); + + +/** * Defines a Decryption Policy with multiple escrow methods */ struct ANASTASIS_DecryptionPolicy @@ -528,9 +589,9 @@ struct ANASTASIS_Recovery; * * @param ctx context for making HTTP requests * @param id_data contains the users identity, (user account on providers) - * @param version defines the version which will be downloaded NULL for latest version - * @param anastasis_provider_url NULL terminated list of possible provider urls - * @param provider_salt the server salt + * @param version defines the version which will be downloaded, 0 for latest version + * @param anastasis_provider_url provider REST API endpoint url + * @param provider_salt the provider's salt * @param pc opens the policy call back which holds the downloaded version and the policies * @param pc_cls closure for callback * @param csc core secret callback is opened, with this the core secert is passed to the client after the authentication |