GNUnet  0.18.1
did_core.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2010-2015 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
27 #include "platform.h"
28 #include "gnunet_util_lib.h"
30 #include "gnunet_gns_service.h"
31 #include "gnunet_gnsrecord_lib.h"
33 #include "did_helper.h"
34 #include "jansson.h"
35 
36 // #define DID_DOCUMENT_LABEL GNUNET_GNS_EMPTY_LABEL_AT
37 #define DID_DOCUMENT_LABEL "didd"
38 #define DID_DOCUMENT_DEFAULT_EXPIRATION_TIME "365d"
39 
49 typedef void
50  DID_resolve_callback (enum GNUNET_GenericReturnValue status, char *did_document, void *cls);
51 
60 typedef void
62 
63 
75 DID_resolve (const char *did,
78  void *cls);
79 
80 
93 DID_remove (const struct GNUNET_IDENTITY_Ego *ego,
94  struct GNUNET_CONFIGURATION_Handle *cfg_handle,
96  DID_action_callback *cont,
97  void *cls);
98 
99 
112 DID_create (const struct GNUNET_IDENTITY_Ego *ego,
113  const char *did_document,
114  const struct GNUNET_TIME_Relative *expire_time,
116  DID_action_callback *cont,
117  void *cls);
118 
119 
132 DID_replace (struct GNUNET_IDENTITY_Ego *ego,
133  char *did_document,
134  const struct GNUNET_CONFIGURATION_Handle *cfg_handle,
137  DID_action_callback *cont,
138  void *cls);
void DID_resolve_callback(enum GNUNET_GenericReturnValue status, char *did_document, void *cls)
Signature of a callback function that is called after a did has been resolved.
Definition: did_core.h:50
enum GNUNET_GenericReturnValue DID_remove(const struct GNUNET_IDENTITY_Ego *ego, struct GNUNET_CONFIGURATION_Handle *cfg_handle, struct GNUNET_NAMESTORE_Handle *namestore_handle, DID_action_callback *cont, void *cls)
Removes the DID Document from namestore.
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...
Definition: did_core.h:61
enum GNUNET_GenericReturnValue DID_resolve(const char *did, struct GNUNET_GNS_Handle *gns_handle, DID_resolve_callback *cont, void *cls)
Resolve a DID.
Definition: did_core.c:87
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.
Definition: did_core.c:220
enum GNUNET_GenericReturnValue DID_replace(struct GNUNET_IDENTITY_Ego *ego, char *did_document, const struct GNUNET_CONFIGURATION_Handle *cfg_handle, struct GNUNET_IDENTITY_Handle *identity_handle, struct GNUNET_NAMESTORE_Handle *namestore_handle, DID_action_callback *cont, void *cls)
Replace the DID Document of a DID.
helper library for DID related functions
static struct GNUNET_NAMESTORE_Handle * namestore_handle
Definition: gnunet-did.c:111
static struct GNUNET_GNS_Handle * gns_handle
Handle to the GNS service.
uint16_t status
See PRISM_STATUS_*-constants.
uint32_t did
This has a different ID for each parameter, see PRISM_DID_* constants.
API to the GNS service.
API that can be used to manipulate GNS record data.
Identity service; implements identity management for GNUnet.
API that can be used to store naming information on a GNUnet node;.
GNUNET_GenericReturnValue
Named constants for return values.
Definition: gnunet_common.h:97
static struct GNUNET_IDENTITY_Handle * identity_handle
Handle to Identity service.
Connection to the GNS service.
Definition: gns_api.h:36
Handle for an ego.
Definition: identity.h:37
Handle for the service.
Definition: identity_api.c:97
Connection to the NAMESTORE service.
Time for relative time used by GNUnet, in microseconds.