GNUnet 0.22.2
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"
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
49typedef void
51 did_document, void *cls);
52
61typedef void
63
64
76DID_resolve (const char *did,
79 void *cls);
80
81
95 struct GNUNET_CONFIGURATION_Handle *cfg_handle,
98 void *cls);
99
100
113DID_create (const struct GNUNET_IDENTITY_Ego *ego,
114 const char *did_document,
115 const struct GNUNET_TIME_Relative *expire_time,
118 void *cls);
119
120
134 char *did_document,
135 const struct GNUNET_CONFIGURATION_Handle *cfg_handle,
139 void *cls);
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:62
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.
Definition: did_core.h:50
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:89
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:226
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_GNS_Handle * gns_handle
Definition: gnunet-did.c:102
static struct GNUNET_NAMESTORE_Handle * namestore_handle
Definition: gnunet-did.c:107
static struct GNUNET_IDENTITY_Handle * identity_handle
Definition: gnunet-did.c:112
static char * did
DID Attribute String.
Definition: gnunet-did.c:82
static int status
The program status; 0 for success.
Definition: gnunet-nse.c:39
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.
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.