diff options
Diffstat (limited to 'src/reclaim/did_core.h')
-rw-r--r-- | src/reclaim/did_core.h | 138 |
1 files changed, 0 insertions, 138 deletions
diff --git a/src/reclaim/did_core.h b/src/reclaim/did_core.h deleted file mode 100644 index 842424e14..000000000 --- a/src/reclaim/did_core.h +++ /dev/null | |||
@@ -1,138 +0,0 @@ | |||
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 | |||
21 | /** | ||
22 | * @file reclaim/did_core.h | ||
23 | * @brief Core functionality for GNUNET Decentralized Identifier | ||
24 | * @author Tristan Schwieren | ||
25 | */ | ||
26 | |||
27 | #include "platform.h" | ||
28 | #include "gnunet_util_lib.h" | ||
29 | #include "gnunet_namestore_service.h" | ||
30 | #include "gnunet_gns_service.h" | ||
31 | #include "gnunet_gnsrecord_lib.h" | ||
32 | #include "gnunet_identity_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 | |||
40 | /** | ||
41 | * @brief Signature of a callback function that is called after a did has been resolved. | ||
42 | * did_document contains an Error message if DID can not be resolved. | ||
43 | * Calls the given callback function with the resolved DID Document and the given closure. | ||
44 | * If the did can not be resolved did_document is NULL. | ||
45 | * @param status Equals GNUNET_OK if DID Docuemnt has been resolved | ||
46 | * @param did_document resolved DID Document | ||
47 | * @param cls previsouly given closure | ||
48 | */ | ||
49 | typedef void | ||
50 | DID_resolve_callback (enum GNUNET_GenericReturnValue status, char *did_document, void *cls); | ||
51 | |||
52 | /** | ||
53 | * @brief Signature of a callback function that is called after a did has been removed | ||
54 | * status = 0 if action was sucessfull | ||
55 | * status = 1 if action failed | ||
56 | * | ||
57 | * @param status status of the perfermormed action. | ||
58 | * @param cls previsouly given closure | ||
59 | */ | ||
60 | typedef void | ||
61 | DID_action_callback (enum GNUNET_GenericReturnValue status, void *cls); | ||
62 | |||
63 | |||
64 | /** | ||
65 | * @brief Resolve a DID. | ||
66 | * Calls the given callback function with the resolved DID Document and the given closure. | ||
67 | * If the did can not be resolved did_document is NULL. | ||
68 | * | ||
69 | * @param did DID that is resolved | ||
70 | * @param gns_handle pointer to gns handle. | ||
71 | * @param cont callback function | ||
72 | * @param cls closure | ||
73 | */ | ||
74 | enum GNUNET_GenericReturnValue | ||
75 | DID_resolve (const char *did, | ||
76 | struct GNUNET_GNS_Handle *gns_handle, | ||
77 | DID_resolve_callback *cont, | ||
78 | void *cls); | ||
79 | |||
80 | |||
81 | /** | ||
82 | * @brief Removes the DID Document from namestore. | ||
83 | * Ego is not removed. | ||
84 | * Calls the callback function with status and the given closure. | ||
85 | * | ||
86 | * @param ego ego which controlls the DID | ||
87 | * @param cfg_handle pointer to configuration handle | ||
88 | * @param namestore_handle pointer to namestore handle | ||
89 | * @param cont callback function | ||
90 | * @param cls closure | ||
91 | */ | ||
92 | enum GNUNET_GenericReturnValue | ||
93 | DID_remove (const struct GNUNET_IDENTITY_Ego *ego, | ||
94 | struct GNUNET_CONFIGURATION_Handle *cfg_handle, | ||
95 | struct GNUNET_NAMESTORE_Handle *namestore_handle, | ||
96 | DID_action_callback *cont, | ||
97 | void *cls); | ||
98 | |||
99 | |||
100 | /** | ||
101 | * @brief Creates a DID and saves DID Document in Namestore. | ||
102 | * | ||
103 | * @param ego ego for which the DID should be created. | ||
104 | * @param did_document did_document that should be saved in namestore. | ||
105 | * If did_document==NULL -> Default DID document is created. | ||
106 | * @param expire_time | ||
107 | * @param namestore_handle | ||
108 | * @param cont callback function | ||
109 | * @param cls closure | ||
110 | */ | ||
111 | enum GNUNET_GenericReturnValue | ||
112 | DID_create (const struct GNUNET_IDENTITY_Ego *ego, | ||
113 | const char *did_document, | ||
114 | const struct GNUNET_TIME_Relative *expire_time, | ||
115 | struct GNUNET_NAMESTORE_Handle *namestore_handle, | ||
116 | DID_action_callback *cont, | ||
117 | void *cls); | ||
118 | |||
119 | |||
120 | /** | ||
121 | * @brief Replace the DID Document of a DID. | ||
122 | * | ||
123 | * @param ego ego for which the DID Document should be replaced | ||
124 | * @param did_document new DID Document | ||
125 | * @param cfg_handle pointer to configuration handle | ||
126 | * @param identity_handle pointer to configuration handle | ||
127 | * @param namestore_handle pointer to namestore handle | ||
128 | * @param cont callback function | ||
129 | * @param cls closure | ||
130 | */ | ||
131 | enum GNUNET_GenericReturnValue | ||
132 | DID_replace (struct GNUNET_IDENTITY_Ego *ego, | ||
133 | char *did_document, | ||
134 | const struct GNUNET_CONFIGURATION_Handle *cfg_handle, | ||
135 | struct GNUNET_IDENTITY_Handle *identity_handle, | ||
136 | struct GNUNET_NAMESTORE_Handle *namestore_handle, | ||
137 | DID_action_callback *cont, | ||
138 | void *cls); | ||