diff options
author | jospaeth <spaethj@in.tum.de> | 2020-07-15 16:28:26 +0200 |
---|---|---|
committer | jospaeth <spaethj@in.tum.de> | 2020-07-15 16:28:26 +0200 |
commit | 3192c1c84a8cf6aa81e55ac647adf125cbd88904 (patch) | |
tree | cf8c0505b36ac3a5c7d86d6a683b6651c1917dce /src/include/gnunet_escrow_lib.h | |
parent | 122f2979146c6068cbaf189560f196e4a3323801 (diff) | |
download | gnunet-3192c1c84a8cf6aa81e55ac647adf125cbd88904.tar.gz gnunet-3192c1c84a8cf6aa81e55ac647adf125cbd88904.zip |
changes to the escrow api [not compiling]
Diffstat (limited to 'src/include/gnunet_escrow_lib.h')
-rw-r--r-- | src/include/gnunet_escrow_lib.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/include/gnunet_escrow_lib.h b/src/include/gnunet_escrow_lib.h index 2ac3c7761..297926581 100644 --- a/src/include/gnunet_escrow_lib.h +++ b/src/include/gnunet_escrow_lib.h | |||
@@ -38,6 +38,7 @@ extern "C" { | |||
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #include "gnunet_util_lib.h" | 40 | #include "gnunet_util_lib.h" |
41 | #include "gnunet_identity_service.h" | ||
41 | 42 | ||
42 | 43 | ||
43 | /** | 44 | /** |
@@ -61,8 +62,40 @@ enum GNUNET_ESCROW_Verification_Result { | |||
61 | 62 | ||
62 | 63 | ||
63 | /** | 64 | /** |
65 | * Struct for the escrow anchor | ||
66 | */ | ||
67 | struct GNUNET_ESCROW_Anchor { | ||
68 | enum GNUNET_ESCROW_Key_Escrow_Method method; | ||
69 | uint32_t size; | ||
70 | }; | ||
71 | |||
72 | |||
73 | /** | ||
74 | * Initialize the escrow component. | ||
75 | * | ||
76 | * @param cfg the configuration to use | ||
77 | * | ||
78 | * @return handle to use | ||
79 | */ | ||
80 | struct GNUNET_ESCROW_Handle * | ||
81 | GNUNET_ESCROW_init ( | ||
82 | const struct GNUNET_CONFIGURATION_Handle *cfg); | ||
83 | |||
84 | |||
85 | /** | ||
86 | * Unload all loaded plugins on destruction. | ||
87 | * | ||
88 | * @param h the escrow handle | ||
89 | */ | ||
90 | void | ||
91 | GNUNET_ESCROW_fini ( | ||
92 | struct GNUNET_ESCROW_Handle *h); | ||
93 | |||
94 | |||
95 | /** | ||
64 | * Put some data in escrow using the specified escrow method | 96 | * Put some data in escrow using the specified escrow method |
65 | * | 97 | * |
98 | * @param h the handle for the escrow component | ||
66 | * @param ego the identity ego to put in escrow | 99 | * @param ego the identity ego to put in escrow |
67 | * @param method the escrow method to use | 100 | * @param method the escrow method to use |
68 | * | 101 | * |
@@ -70,6 +103,7 @@ enum GNUNET_ESCROW_Verification_Result { | |||
70 | */ | 103 | */ |
71 | void * | 104 | void * |
72 | GNUNET_ESCROW_put ( | 105 | GNUNET_ESCROW_put ( |
106 | struct GNUNET_ESCROW_Handle *h, | ||
73 | const struct GNUNET_IDENTITY_Ego *ego, | 107 | const struct GNUNET_IDENTITY_Ego *ego, |
74 | enum GNUNET_ESCROW_Key_Escrow_Method method); | 108 | enum GNUNET_ESCROW_Key_Escrow_Method method); |
75 | 109 | ||
@@ -77,6 +111,7 @@ GNUNET_ESCROW_put ( | |||
77 | /** | 111 | /** |
78 | * Renew the escrow of the data related to the given escrow anchor | 112 | * Renew the escrow of the data related to the given escrow anchor |
79 | * | 113 | * |
114 | * @param h the handle for the escrow component | ||
80 | * @param escrowAnchor the escrow anchor returned by the GNUNET_ESCROW_put method | 115 | * @param escrowAnchor the escrow anchor returned by the GNUNET_ESCROW_put method |
81 | * @param method the escrow method to use | 116 | * @param method the escrow method to use |
82 | * | 117 | * |
@@ -84,6 +119,7 @@ GNUNET_ESCROW_put ( | |||
84 | */ | 119 | */ |
85 | void * | 120 | void * |
86 | GNUNET_ESCROW_renew ( | 121 | GNUNET_ESCROW_renew ( |
122 | struct GNUNET_ESCROW_Handle *h, | ||
87 | void *escrowAnchor, | 123 | void *escrowAnchor, |
88 | enum GNUNET_ESCROW_Key_Escrow_Method method); | 124 | enum GNUNET_ESCROW_Key_Escrow_Method method); |
89 | 125 | ||
@@ -91,6 +127,7 @@ GNUNET_ESCROW_renew ( | |||
91 | /** | 127 | /** |
92 | * Get the escrowed data back | 128 | * Get the escrowed data back |
93 | * | 129 | * |
130 | * @param h the handle for the escrow component | ||
94 | * @param escrowAnchor the escrow anchor returned by the GNUNET_ESCROW_put method | 131 | * @param escrowAnchor the escrow anchor returned by the GNUNET_ESCROW_put method |
95 | * @param egoName the name of the ego to get back | 132 | * @param egoName the name of the ego to get back |
96 | * @param method the escrow method to use | 133 | * @param method the escrow method to use |
@@ -99,6 +136,7 @@ GNUNET_ESCROW_renew ( | |||
99 | */ | 136 | */ |
100 | const struct GNUNET_IDENTITY_Ego * | 137 | const struct GNUNET_IDENTITY_Ego * |
101 | GNUNET_ESCROW_get ( | 138 | GNUNET_ESCROW_get ( |
139 | struct GNUNET_ESCROW_Handle *h, | ||
102 | void *escrowAnchor, | 140 | void *escrowAnchor, |
103 | char *egoName, | 141 | char *egoName, |
104 | enum GNUNET_ESCROW_Key_Escrow_Method method); | 142 | enum GNUNET_ESCROW_Key_Escrow_Method method); |
@@ -107,6 +145,7 @@ GNUNET_ESCROW_get ( | |||
107 | /** | 145 | /** |
108 | * Verify the escrowed data | 146 | * Verify the escrowed data |
109 | * | 147 | * |
148 | * @param h the handle for the escrow component | ||
110 | * @param ego the identity ego that was put into escrow | 149 | * @param ego the identity ego that was put into escrow |
111 | * @param escrowAnchor the escrow anchor returned by the GNUNET_ESCROW_put method | 150 | * @param escrowAnchor the escrow anchor returned by the GNUNET_ESCROW_put method |
112 | * @param method the escrow method to use | 151 | * @param method the escrow method to use |
@@ -117,11 +156,29 @@ GNUNET_ESCROW_get ( | |||
117 | */ | 156 | */ |
118 | int | 157 | int |
119 | GNUNET_ESCROW_verify ( | 158 | GNUNET_ESCROW_verify ( |
159 | struct GNUNET_ESCROW_Handle *h, | ||
120 | const struct GNUNET_IDENTITY_Ego *ego, | 160 | const struct GNUNET_IDENTITY_Ego *ego, |
121 | void *escrowAnchor, | 161 | void *escrowAnchor, |
122 | enum GNUNET_ESCROW_Key_Escrow_Method method); | 162 | enum GNUNET_ESCROW_Key_Escrow_Method method); |
123 | 163 | ||
124 | 164 | ||
165 | /** | ||
166 | * Deserialize an escrow anchor string (e.g. from command line) into a | ||
167 | * GNUNET_ESCROW_Anchor struct | ||
168 | * | ||
169 | * @param h the handle for the escrow component | ||
170 | * @param anchorString the encoded escrow anchor string | ||
171 | * @param method the escrow method to use | ||
172 | * | ||
173 | * @return the deserialized data packed into a GNUNET_ESCROW_Anchor struct | ||
174 | */ | ||
175 | const struct GNUNET_ESCROW_Anchor * | ||
176 | GNUNET_ESCROW_anchor_string_to_data ( | ||
177 | struct GNUNET_ESCROW_Handle *h, | ||
178 | char *anchorString, | ||
179 | enum GNUNET_ESCROW_Key_Escrow_Method method); | ||
180 | |||
181 | |||
125 | #if 0 /* keep Emacsens' auto-indent happy */ | 182 | #if 0 /* keep Emacsens' auto-indent happy */ |
126 | { | 183 | { |
127 | #endif | 184 | #endif |