72 did_document = (
char *)
rd[i].
data;
76 cb (
GNUNET_NO,
"DID Document is not a DID_DOCUMENT record\n",
106 cls_gns_lookup_cb->
cb = cont;
107 cls_gns_lookup_cb->
cls =
cls;
165 const char *did_document
181 printf (
"Ego already has a DID Document. Abort.\n");
192 "DID Document is read from \"DID-document\" argument (EXPERIMENTAL)\n");
210 (
void *) cls_record_store_cb);
245 printf (
"The EGO has to have an EdDSA key pair\n");
251 cls_name_store_lookup_cb->
ret->
cb = cont;
252 cls_name_store_lookup_cb->
ret->
cls = cls;
254 cls_name_store_lookup_cb->
expire_time = (*expire_time);
264 (
void *) cls_name_store_lookup_cb);
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_resolve(const char *did, struct GNUNET_GNS_Handle *gns_handle, DID_resolve_callback *cont, void *cls)
Resolve a DID.
static void DID_create_did_store_cb(void *cls, enum GNUNET_ErrorCode ec)
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.
static void DID_resolve_gns_lookup_cb(void *cls, uint32_t rd_count, const struct GNUNET_GNSRECORD_Data *rd)
GNS lookup callback.
Core functionality for GNUNET Decentralized Identifier.
void DID_action_callback(enum GNUNET_GenericReturnValue status, void *cls)
Signature of a callback function that is called after a did has been removed status = 0 if action was...
void DID_resolve_callback(enum GNUNET_GenericReturnValue status, const char *did_document, void *cls)
Signature of a callback function that is called after a did has been resolved.
#define DID_DOCUMENT_LABEL
enum GNUNET_GenericReturnValue DID_did_to_pkey(const char *did, struct GNUNET_CRYPTO_PublicKey *pkey)
Return the public key of a DID.
char * DID_pkey_to_did_document(struct GNUNET_CRYPTO_PublicKey *pkey)
Create a did generate did object.
#define GNUNET_GNSRECORD_TYPE_DID_DOCUMENT
Record type to store DID Documents.
#define GNUNET_GNSRECORD_TYPE_EDKEY
GNS zone delegation (EDKEY)
static char * data
The data to insert into the dht.
static struct GNUNET_GNS_Handle * gns_handle
static struct GNUNET_NAMESTORE_Handle * namestore_handle
static char * did
DID Attribute String.
static char * pkey
Public key of the zone to look in, in ASCII.
static unsigned int rd_count
Number of records for currently parsed set.
static struct GNUNET_GNSRECORD_Data rd[50]
The record data under a single label.
const char * GNUNET_ErrorCode_get_hint(enum GNUNET_ErrorCode ec)
Returns a hint for a given error code.
GNUNET_ErrorCode
Taler error codes.
@ GNUNET_EC_NONE
No error (success).
struct GNUNET_GNS_LookupRequest * GNUNET_GNS_lookup(struct GNUNET_GNS_Handle *handle, const char *name, const struct GNUNET_CRYPTO_PublicKey *zone, uint32_t type, enum GNUNET_GNS_LocalOptions options, GNUNET_GNS_LookupResultProcessor proc, void *proc_cls)
Perform an asynchronous lookup operation on the GNS.
@ GNUNET_GNS_LO_DEFAULT
Defaults, look in cache, then in DHT.
uint32_t GNUNET_GNSRECORD_typename_to_number(const char *dns_typename)
Convert a type name (e.g.
@ GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION
This expiration time of the record is a relative time (not an absolute time).
const struct GNUNET_CRYPTO_PrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
void GNUNET_IDENTITY_ego_get_public_key(struct GNUNET_IDENTITY_Ego *ego, struct GNUNET_CRYPTO_PublicKey *pk)
Get the identifier (public key) of an ego.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_key_get_public(const struct GNUNET_CRYPTO_PrivateKey *privkey, struct GNUNET_CRYPTO_PublicKey *key)
Retrieves the public key representation of a private key.
GNUNET_GenericReturnValue
Named constants for return values.
#define GNUNET_malloc(size)
Wrapper around malloc.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor rm, void *rm_cls)
Lookup an item in the namestore.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_record_set_store(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
Store an item in the namestore.
struct GNUNET_NAMESTORE_Handle * namestore_handle
struct GNUNET_TIME_Relative expire_time
struct DID_action_return * ret
const char * did_document
DID_resolve_callback * cb
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
uint32_t record_type
Type of the GNS/DNS record.
const void * data
Binary value stored in the DNS record.
size_t data_size
Number of bytes in data.
enum GNUNET_GNSRECORD_Flags flags
Flags for the record.
uint64_t expiration_time
Expiration time for the DNS record.
Connection to the GNS service.
Connection to the NAMESTORE service.
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.