Core functionality for DID. More...
#include "did_core.h"
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_CRYPTO_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 58 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 DID_resolve().
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 89 of file did_core.c.
References DID_resolve_return::cb, DID_resolve_return::cls, did, DID_did_to_pkey(), DID_DOCUMENT_LABEL, DID_resolve_gns_lookup_cb(), gns_handle, GNUNET_GNS_LO_DEFAULT, GNUNET_GNS_lookup(), GNUNET_GNSRECORD_TYPE_DID_DOCUMENT, GNUNET_malloc, GNUNET_NO, GNUNET_OK, and pkey.
Referenced by resolve_did().
|
static |
Definition at line 126 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_namestore_lookup_cb().
|
static |
Definition at line 155 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_CRYPTO_key_get_public(), GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_GNSRECORD_typename_to_number(), GNUNET_NAMESTORE_record_set_store(), GNUNET_NO, namestore_handle, pkey, rd_count, GNUNET_GNSRECORD_Data::record_type, and GNUNET_TIME_Relative::rel_value_us.
Referenced by DID_create().
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 226 of file did_core.c.
References DID_action_return::cb, DID_action_return::cls, DID_create_namestore_lookup_cb(), DID_create_namestore_lookup_closure::did_document, DID_DOCUMENT_LABEL, DID_create_namestore_lookup_closure::expire_time, GNUNET_GNSRECORD_TYPE_EDKEY, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_IDENTITY_ego_get_public_key(), GNUNET_malloc, GNUNET_NAMESTORE_records_lookup(), GNUNET_NO, GNUNET_OK, namestore_handle, DID_create_namestore_lookup_closure::namestore_handle, pkey, and DID_create_namestore_lookup_closure::ret.
Referenced by create_did_ego_lockup_cb().