#include "did_core.h"
#include "gnunet_util_lib.h"
#include "gnunet_namestore_service.h"
#include "gnunet_identity_service.h"
#include "gnunet_gns_service.h"
#include "gnunet_gnsrecord_lib.h"
Go to the source code of this file.
Data Structures | |
struct | Event |
A Structure containing a cont and cls. More... | |
Macros | |
#define | GNUNET_DID_DEFAULT_DID_DOCUMENT_EXPIRATION_TIME "1d" |
Typedefs | |
typedef void(* | remove_did_document_callback) (void *cls) |
Signature of a callback function that is called after a did has been removed. More... | |
Functions | |
static void | cleanup (void *cls) |
Disconnect and shutdown. More... | |
static void | print_did_document (enum GNUNET_GenericReturnValue status, const char *did_document, void *cls) |
GNS lookup callback. More... | |
static void | resolve_did () |
Resolve a DID given by the user. More... | |
static void | remove_did_document_namestore_cb (void *cls, enum GNUNET_ErrorCode ec) |
Implements the GNUNET_NAMESTORE_ContinuationWithStatus Calls the callback function and cls in the event struct. More... | |
static void | remove_did_document_ego_lookup_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) |
Callback called after the ego has been locked up. More... | |
static void | remove_did_document (remove_did_document_callback cont, void *cls) |
Remove a DID Document. More... | |
static void | create_did_ego_lockup_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) |
Create a DID(-Document). More... | |
static void | create_did_cb (enum GNUNET_GenericReturnValue status, void *cls) |
Create a DID(-Document). More... | |
static void | create_did_ego_create_cb (void *cls, const struct GNUNET_CRYPTO_PrivateKey *pk, enum GNUNET_ErrorCode ec) |
Create a DID(-Document) - Called after a new Identity has been created. More... | |
static void | create_did () |
Create a DID(-Document). More... | |
static void | replace_did_document_ego_lookup_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) |
Replace a DID Document. More... | |
static void | replace_did_document_remove_cb (void *cls) |
Replace a DID Document. More... | |
static void | replace_did_document () |
Replace a DID Document. More... | |
static void | post_ego_iteration (void *cls) |
static void | process_dids (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *name) |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) |
int | main (int argc, char *const argv[]) |
Variables | |
static int | ret |
return value More... | |
static int | replace |
Replace DID Document Flag. More... | |
static int | remove_did |
Remove DID Document Flag. More... | |
static int | get |
Get DID Documement for DID Flag. More... | |
static int | create |
Create DID Document Flag. More... | |
static int | show |
Show DID for Ego Flag. More... | |
static int | show_all |
Show DID for Ego Flag. More... | |
static char * | did |
DID Attribute String. More... | |
static char * | didd |
DID Document Attribute String. More... | |
static char * | egoname |
Ego Attribute String. More... | |
static char * | expire |
DID Document expiration Date Attribute String. More... | |
static struct GNUNET_GNS_Handle * | gns_handle |
static struct GNUNET_NAMESTORE_Handle * | namestore_handle |
static struct GNUNET_IDENTITY_Handle * | identity_handle |
static const struct GNUNET_CONFIGURATION_Handle * | my_cfg |
static int | ego_exists = 0 |
Give ego exists. More... | |
#define GNUNET_DID_DEFAULT_DID_DOCUMENT_EXPIRATION_TIME "1d" |
Definition at line 43 of file gnunet-did.c.
typedef void(* remove_did_document_callback) (void *cls) |
Signature of a callback function that is called after a did has been removed.
Definition at line 203 of file gnunet-did.c.
|
static |
Disconnect and shutdown.
cls | closure |
Definition at line 131 of file gnunet-did.c.
References did, didd, egoname, expire, gns_handle, GNUNET_free, GNUNET_GNS_disconnect(), GNUNET_IDENTITY_disconnect(), GNUNET_NAMESTORE_disconnect(), GNUNET_SCHEDULER_shutdown(), identity_handle, and namestore_handle.
Referenced by cleanup_store_discourse_messages_before(), create_did(), create_did_cb(), create_did_ego_create_cb(), create_did_ego_lockup_cb(), curl_check_hdr(), decrypt_message(), decrypt_new_element(), deserialize_download(), deserialize_fi_node(), deserialize_publish_file(), deserialize_search(), deserialize_search_result(), deserialize_unindex_file(), encrypt_message(), GNUNET_CONFIGURATION_load_from(), GNUNET_FS_download_sync_(), GNUNET_FS_file_information_sync_(), GNUNET_FS_publish_sync_(), GNUNET_FS_search_result_sync_(), GNUNET_FS_search_sync_(), GNUNET_FS_unindex_sync_(), GNUNET_PQ_extract_result(), GNUNET_PROGRAM_run2(), GNUNET_TESTING_command_new_ac(), handle_inline(), iterate_flag_for_cleanup_discourse_message(), main(), post_ego_iteration(), print_did_document(), process_dids(), read_download_request(), remove_did_document(), remove_did_document_namestore_cb(), replace_did_document(), resolve_did(), run(), and verify_fair().
|
static |
GNS lookup callback.
Prints the DID Document to standard out. Fails if there is more than one DID record.
cls | closure |
rd_count | number of records in rd |
rd | the records in the reply |
Definition at line 158 of file gnunet-did.c.
References cleanup(), GNUNET_OK, GNUNET_SCHEDULER_add_now(), ret, and status.
Referenced by resolve_did().
|
static |
Resolve a DID given by the user.
Definition at line 179 of file gnunet-did.c.
References cleanup(), did, DID_resolve(), gns_handle, GNUNET_OK, GNUNET_SCHEDULER_add_now(), print_did_document(), and ret.
Referenced by post_ego_iteration().
|
static |
Implements the GNUNET_NAMESTORE_ContinuationWithStatus Calls the callback function and cls in the event struct.
cls | closure containing the event struct |
success | |
emgs |
Definition at line 225 of file gnunet-did.c.
References cleanup(), Event::cls, Event::cont, GNUNET_EC_NONE, GNUNET_ErrorCode_get_hint(), GNUNET_SCHEDULER_add_now(), and ret.
Referenced by remove_did_document_ego_lookup_cb().
|
static |
Callback called after the ego has been locked up.
cls | closure |
ego | the ego returned by the identity service |
Definition at line 266 of file gnunet-did.c.
References GNUNET_GNS_EMPTY_LABEL_AT, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_NAMESTORE_record_set_store(), namestore_handle, and remove_did_document_namestore_cb().
Referenced by remove_did_document().
|
static |
Remove a DID Document.
Definition at line 285 of file gnunet-did.c.
References cleanup(), Event::cls, Event::cont, egoname, GNUNET_IDENTITY_ego_lookup(), GNUNET_SCHEDULER_add_now(), my_cfg, remove_did_document_ego_lookup_cb(), and ret.
Referenced by post_ego_iteration(), and replace_did_document().
|
static |
Create a DID(-Document).
Called after ego lookup
Definition at line 368 of file gnunet-did.c.
References cleanup(), create_did_cb(), create_did_ego_create_cb(), DID_create(), DID_DOCUMENT_DEFAULT_EXPIRATION_TIME, DID_identity_to_did(), egoname, expire, GNUNET_assert, GNUNET_free, GNUNET_IDENTITY_create(), GNUNET_malloc, GNUNET_OK, GNUNET_PUBLIC_KEY_TYPE_EDDSA, GNUNET_SCHEDULER_add_now(), GNUNET_STRINGS_fancy_time_to_relative(), identity_handle, namestore_handle, and ret.
Referenced by create_did(), and create_did_ego_create_cb().
|
static |
Create a DID(-Document).
Called after DID has been created Prints status and the DID.
Definition at line 321 of file gnunet-did.c.
References cleanup(), Event::cls, GNUNET_OK, GNUNET_SCHEDULER_add_now(), ret, and status.
Referenced by create_did_ego_lockup_cb().
|
static |
Create a DID(-Document) - Called after a new Identity has been created.
Definition at line 344 of file gnunet-did.c.
References cleanup(), create_did_ego_lockup_cb(), egoname, GNUNET_EC_NONE, GNUNET_ErrorCode_get_hint(), GNUNET_IDENTITY_ego_lookup(), GNUNET_SCHEDULER_add_now(), my_cfg, and ret.
Referenced by create_did_ego_lockup_cb().
|
static |
Create a DID(-Document).
Definition at line 430 of file gnunet-did.c.
References cleanup(), create_did_ego_lockup_cb(), egoname, GNUNET_IDENTITY_ego_lookup(), GNUNET_SCHEDULER_add_now(), my_cfg, and ret.
Referenced by post_ego_iteration().
|
static |
Replace a DID Document.
Callback function after ego lockup
cls | |
ego |
Definition at line 455 of file gnunet-did.c.
Referenced by replace_did_document_remove_cb().
|
static |
Replace a DID Document.
Callback functiona after remove
cls |
Definition at line 467 of file gnunet-did.c.
References egoname, GNUNET_IDENTITY_ego_lookup(), my_cfg, and replace_did_document_ego_lookup_cb().
Referenced by replace_did_document().
|
static |
Replace a DID Document.
Definition at line 481 of file gnunet-did.c.
References cleanup(), didd, expire, GNUNET_SCHEDULER_add_now(), remove_did_document(), replace_did_document_remove_cb(), and ret.
Referenced by post_ego_iteration().
|
static |
Definition at line 499 of file gnunet-did.c.
References cleanup(), create, create_did(), get, GNUNET_SCHEDULER_add_now(), remove_did, remove_did_document(), replace, replace_did_document(), and resolve_did().
Referenced by process_dids().
|
static |
Definition at line 529 of file gnunet-did.c.
References cleanup(), DID_identity_to_did(), ego_exists, egoname, GNUNET_free, GNUNET_SCHEDULER_add_now(), name, post_ego_iteration(), show, and show_all.
Referenced by run().
|
static |
Definition at line 566 of file gnunet-did.c.
References cleanup(), gns_handle, GNUNET_GNS_connect(), GNUNET_IDENTITY_connect(), GNUNET_NAMESTORE_connect(), GNUNET_SCHEDULER_add_now(), identity_handle, my_cfg, namestore_handle, process_dids(), and ret.
Referenced by main().
int main | ( | int | argc, |
char *const | argv[] | ||
) |
Definition at line 601 of file gnunet-did.c.
References create, did, didd, egoname, expire, get, gettext_noop, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_string(), GNUNET_OK, GNUNET_OS_project_data_gnunet(), GNUNET_PROGRAM_run(), options, remove_did, replace, ret, run(), show, and show_all.
|
static |
return value
Definition at line 48 of file gnunet-did.c.
Referenced by create_did(), create_did_cb(), create_did_ego_create_cb(), create_did_ego_lockup_cb(), main(), print_did_document(), remove_did_document(), remove_did_document_namestore_cb(), replace_did_document(), resolve_did(), and run().
|
static |
Replace DID Document Flag.
Definition at line 53 of file gnunet-did.c.
Referenced by main(), post_ego_iteration(), replace_char(), try_ifconfig(), and try_ip().
|
static |
Remove DID Document Flag.
Definition at line 58 of file gnunet-did.c.
Referenced by main(), and post_ego_iteration().
|
static |
Get DID Documement for DID Flag.
Definition at line 63 of file gnunet-did.c.
Referenced by check_dht_local_get(), check_dht_p2p_get(), check_get(), handle_dht_local_get(), handle_dht_p2p_get(), main(), and post_ego_iteration().
|
static |
Create DID Document Flag.
Definition at line 68 of file gnunet-did.c.
Referenced by GCP_get(), GCP_get_tunnel(), main(), and post_ego_iteration().
|
static |
Show DID for Ego Flag.
Definition at line 73 of file gnunet-did.c.
Referenced by main(), and process_dids().
|
static |
Show DID for Ego Flag.
Definition at line 78 of file gnunet-did.c.
Referenced by main(), and process_dids().
|
static |
DID Attribute String.
Definition at line 83 of file gnunet-did.c.
Referenced by cleanup(), DID_did_to_pkey(), DID_public_key_from_did(), DID_resolve(), main(), and resolve_did().
|
static |
DID Document Attribute String.
Definition at line 88 of file gnunet-did.c.
Referenced by cleanup(), main(), and replace_did_document().
|
static |
Definition at line 93 of file gnunet-did.c.
Referenced by cleanup(), create_did(), create_did_ego_create_cb(), create_did_ego_lockup_cb(), ego_create(), ego_get_name(), main(), namestore_add_or_update(), namestore_delete(), namestore_get(), namestore_import(), process_dids(), remove_did_document(), and replace_did_document_remove_cb().
|
static |
DID Document expiration Date Attribute String.
Definition at line 98 of file gnunet-did.c.
Referenced by block_create2(), block_create_ecdsa(), block_create_eddsa(), cleanup(), create_did_ego_lockup_cb(), dispatch_job(), dispatch_job_monitor(), GNUNET_GNSRECORD_block_create(), GNUNET_GNSRECORD_block_create2(), GNUNET_GNSRECORD_block_create_unsigned(), GNUNET_GNSRECORD_record_get_expiration_time(), handle_monitor_event(), handle_record(), main(), replace_did_document(), run_edkey(), and run_pkey().
|
static |
Definition at line 103 of file gnunet-did.c.
Referenced by cleanup(), DID_resolve(), resolve_did(), and run().
|
static |
Definition at line 108 of file gnunet-did.c.
Referenced by cleanup(), create_did_ego_lockup_cb(), DID_create(), DID_create_namestore_lookup_cb(), remove_did_document_ego_lookup_cb(), and run().
|
static |
Definition at line 113 of file gnunet-did.c.
Referenced by cleanup(), create_did_ego_lockup_cb(), and run().
|
static |
Definition at line 119 of file gnunet-did.c.
Referenced by create_did(), create_did_ego_create_cb(), remove_did_document(), replace_did_document_remove_cb(), and run().
|
static |