Core functionality for DID. More...
Go to the source code of this file.
Data Structures | |
struct | DID_resolve_return |
struct | DID_action_return |
struct | DID_create_namestore_lookup_closure |
Functions | |
static void | DID_resolve_gns_lookup_cb (void *cls, uint32_t rd_count, const struct GNUNET_GNSRECORD_Data *rd) |
GNS lookup callback. More... | |
enum GNUNET_GenericReturnValue | DID_resolve (const char *did, struct GNUNET_GNS_Handle *gns_handle, DID_resolve_callback *cont, void *cls) |
Resolve a DID. More... | |
static void | DID_create_did_store_cb (void *cls, enum GNUNET_ErrorCode ec) |
static void | DID_create_namestore_lookup_cb (void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd) |
enum GNUNET_GenericReturnValue | DID_create (const struct GNUNET_IDENTITY_Ego *ego, const char *did_document, const struct GNUNET_TIME_Relative *expire_time, struct GNUNET_NAMESTORE_Handle *namestore_handle, DID_action_callback *cont, void *cls) |
Creates a DID and saves DID Document in Namestore. More... | |
Core functionality for DID.
Definition in file did_core.c.
|
static |
GNS lookup callback.
Calls the given callback function and gives it the DID Document. 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 59 of file did_core.c.
enum GNUNET_GenericReturnValue DID_resolve | ( | const char * | did, |
struct GNUNET_GNS_Handle * | gns_handle, | ||
DID_resolve_callback * | cont, | ||
void * | cls | ||
) |
Resolve a DID.
Calls the given callback function with the resolved DID Document and the given closure. If the did can not be resolved did_document is NULL.
did | DID that is resolve |
Definition at line 59 of file did_core.c.
References DID_resolve_return::cb, DID_resolve_return::cls, data, GNUNET_GNSRECORD_TYPE_DID_DOCUMENT, GNUNET_NO, GNUNET_OK, rd, and rd_count.
Referenced by resolve_did().
|
static |
Definition at line 124 of file did_core.c.
References DID_resolve_return::cb, DID_action_return::cb, DID_action_return::cls, GNUNET_EC_NONE, GNUNET_ErrorCode_get_hint(), GNUNET_NO, and GNUNET_OK.
Referenced by DID_create().
|
static |
Definition at line 152 of file did_core.c.
enum GNUNET_GenericReturnValue DID_create | ( | const struct GNUNET_IDENTITY_Ego * | ego, |
const char * | did_document, | ||
const struct GNUNET_TIME_Relative * | expire_time, | ||
struct GNUNET_NAMESTORE_Handle * | namestore_handle, | ||
DID_action_callback * | cont, | ||
void * | cls | ||
) |
Creates a DID and saves DID Document in Namestore.
ego | ego for which the DID should be created. |
did_document | did_document that should be saved in namestore. If did_document==NULL -> Default DID document is created. |
namestore_handle | |
cont | callback function |
cls | closure |
Definition at line 152 of file did_core.c.
References DID_action_return::cb, DID_action_return::cls, GNUNET_GNSRECORD_Data::data, GNUNET_GNSRECORD_Data::data_size, DID_create_did_store_cb(), DID_create_namestore_lookup_closure::did_document, DID_DOCUMENT_LABEL, DID_pkey_to_did_document(), GNUNET_GNSRECORD_Data::expiration_time, DID_create_namestore_lookup_closure::expire_time, GNUNET_GNSRECORD_Data::flags, GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_GNSRECORD_typename_to_number(), GNUNET_IDENTITY_key_get_public(), GNUNET_NAMESTORE_records_store(), GNUNET_NO, namestore_handle, pkey, rd_count, GNUNET_GNSRECORD_Data::record_type, GNUNET_TIME_Relative::rel_value_us, and zone.
Referenced by create_did_ego_lockup_cb().