diff options
Diffstat (limited to 'src/include/gnunet_reclaim_service.h')
-rw-r--r-- | src/include/gnunet_reclaim_service.h | 79 |
1 files changed, 46 insertions, 33 deletions
diff --git a/src/include/gnunet_reclaim_service.h b/src/include/gnunet_reclaim_service.h index 139c44ae7..368058f56 100644 --- a/src/include/gnunet_reclaim_service.h +++ b/src/include/gnunet_reclaim_service.h | |||
@@ -92,7 +92,21 @@ struct GNUNET_RECLAIM_Ticket | |||
92 | * @param ticket the ticket | 92 | * @param ticket the ticket |
93 | */ | 93 | */ |
94 | typedef void (*GNUNET_RECLAIM_TicketCallback) ( | 94 | typedef void (*GNUNET_RECLAIM_TicketCallback) ( |
95 | void *cls, const struct GNUNET_RECLAIM_Ticket *ticket); | 95 | void *cls, |
96 | const struct GNUNET_RECLAIM_Ticket *ticket); | ||
97 | |||
98 | /** | ||
99 | * Method called when a token has been issued. | ||
100 | * On success returns a ticket that can be given to a relying party | ||
101 | * in order for it retrive identity attributes | ||
102 | * | ||
103 | * @param cls closure | ||
104 | * @param ticket the ticket | ||
105 | */ | ||
106 | typedef void (*GNUNET_RECLAIM_IssueTicketCallback) ( | ||
107 | void *cls, | ||
108 | const struct GNUNET_RECLAIM_Ticket *ticket, | ||
109 | const struct GNUNET_RECLAIM_PresentationList *presentations); | ||
96 | 110 | ||
97 | 111 | ||
98 | /** | 112 | /** |
@@ -113,7 +127,6 @@ typedef void (*GNUNET_RECLAIM_ContinuationWithStatus) (void *cls, | |||
113 | * @param cls The callback closure | 127 | * @param cls The callback closure |
114 | * @param identity The identity authoritative over the attributes | 128 | * @param identity The identity authoritative over the attributes |
115 | * @param attr The attribute | 129 | * @param attr The attribute |
116 | * @param attestation The attestation for the attribute (may be NULL) | ||
117 | */ | 130 | */ |
118 | typedef void (*GNUNET_RECLAIM_AttributeResult) ( | 131 | typedef void (*GNUNET_RECLAIM_AttributeResult) ( |
119 | void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, | 132 | void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, |
@@ -125,25 +138,25 @@ typedef void (*GNUNET_RECLAIM_AttributeResult) ( | |||
125 | * @param cls The callback closure | 138 | * @param cls The callback closure |
126 | * @param identity The identity authoritative over the attributes | 139 | * @param identity The identity authoritative over the attributes |
127 | * @param attr The attribute | 140 | * @param attr The attribute |
128 | * @param attestation The attestation for the attribute (may be NULL) | 141 | * @param presentation The presentation for the credential (may be NULL) |
129 | */ | 142 | */ |
130 | typedef void (*GNUNET_RECLAIM_AttributeTicketResult) ( | 143 | typedef void (*GNUNET_RECLAIM_AttributeTicketResult) ( |
131 | void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, | 144 | void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, |
132 | const struct GNUNET_RECLAIM_Attribute *attr, | 145 | const struct GNUNET_RECLAIM_Attribute *attr, |
133 | const struct GNUNET_RECLAIM_Attestation *attestation); | 146 | const struct GNUNET_RECLAIM_Presentation *presentation); |
134 | 147 | ||
135 | 148 | ||
136 | /** | 149 | /** |
137 | * Callback used to notify the client of attestation results. | 150 | * Callback used to notify the client of credential results. |
138 | * | 151 | * |
139 | * @param cls The callback closure | 152 | * @param cls The callback closure |
140 | * @param identity The identity authoritative over the attributes | 153 | * @param identity The identity authoritative over the attributes |
141 | * @param attestation The attestation | 154 | * @param credential The credential |
142 | * @param attributes the parsed attributes | 155 | * @param attributes the parsed attributes |
143 | */ | 156 | */ |
144 | typedef void (*GNUNET_RECLAIM_AttestationResult) ( | 157 | typedef void (*GNUNET_RECLAIM_CredentialResult) ( |
145 | void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, | 158 | void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, |
146 | const struct GNUNET_RECLAIM_Attestation *attestation); | 159 | const struct GNUNET_RECLAIM_Credential *credential); |
147 | 160 | ||
148 | 161 | ||
149 | /** | 162 | /** |
@@ -178,22 +191,22 @@ GNUNET_RECLAIM_attribute_store ( | |||
178 | 191 | ||
179 | 192 | ||
180 | /** | 193 | /** |
181 | * Store an attestation. If the attestation is already present, | 194 | * Store a credential. If the credential is already present, |
182 | * it is replaced with the new attestation. | 195 | * it is replaced with the new credential. |
183 | * | 196 | * |
184 | * @param h handle to the re:claimID service | 197 | * @param h handle to the re:claimID service |
185 | * @param pkey private key of the identity | 198 | * @param pkey private key of the identity |
186 | * @param attr the attestation value | 199 | * @param attr the credential value |
187 | * @param exp_interval the relative expiration interval for the attestation | 200 | * @param exp_interval the relative expiration interval for the credential |
188 | * @param cont continuation to call when done | 201 | * @param cont continuation to call when done |
189 | * @param cont_cls closure for @a cont | 202 | * @param cont_cls closure for @a cont |
190 | * @return handle to abort the request | 203 | * @return handle to abort the request |
191 | */ | 204 | */ |
192 | struct GNUNET_RECLAIM_Operation * | 205 | struct GNUNET_RECLAIM_Operation * |
193 | GNUNET_RECLAIM_attestation_store ( | 206 | GNUNET_RECLAIM_credential_store ( |
194 | struct GNUNET_RECLAIM_Handle *h, | 207 | struct GNUNET_RECLAIM_Handle *h, |
195 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, | 208 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, |
196 | const struct GNUNET_RECLAIM_Attestation *attestation, | 209 | const struct GNUNET_RECLAIM_Credential *credential, |
197 | const struct GNUNET_TIME_Relative *exp_interval, | 210 | const struct GNUNET_TIME_Relative *exp_interval, |
198 | GNUNET_RECLAIM_ContinuationWithStatus cont, | 211 | GNUNET_RECLAIM_ContinuationWithStatus cont, |
199 | void *cont_cls); | 212 | void *cont_cls); |
@@ -218,21 +231,21 @@ GNUNET_RECLAIM_attribute_delete ( | |||
218 | GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls); | 231 | GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls); |
219 | 232 | ||
220 | /** | 233 | /** |
221 | * Delete an attestation. Tickets used to share this attestation are updated | 234 | * Delete a credential. Tickets used to share use a presentation of this |
222 | * accordingly. | 235 | * credential are updated accordingly. |
223 | * | 236 | * |
224 | * @param h handle to the re:claimID service | 237 | * @param h handle to the re:claimID service |
225 | * @param pkey Private key of the identity to add an attribute to | 238 | * @param pkey Private key of the identity to add an attribute to |
226 | * @param attr The attestation | 239 | * @param cred The credential |
227 | * @param cont Continuation to call when done | 240 | * @param cont Continuation to call when done |
228 | * @param cont_cls Closure for @a cont | 241 | * @param cont_cls Closure for @a cont |
229 | * @return handle Used to to abort the request | 242 | * @return handle Used to to abort the request |
230 | */ | 243 | */ |
231 | struct GNUNET_RECLAIM_Operation * | 244 | struct GNUNET_RECLAIM_Operation * |
232 | GNUNET_RECLAIM_attestation_delete ( | 245 | GNUNET_RECLAIM_credential_delete ( |
233 | struct GNUNET_RECLAIM_Handle *h, | 246 | struct GNUNET_RECLAIM_Handle *h, |
234 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, | 247 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, |
235 | const struct GNUNET_RECLAIM_Attestation *attr, | 248 | const struct GNUNET_RECLAIM_Credential *cred, |
236 | GNUNET_RECLAIM_ContinuationWithStatus cont, | 249 | GNUNET_RECLAIM_ContinuationWithStatus cont, |
237 | void *cont_cls); | 250 | void *cont_cls); |
238 | 251 | ||
@@ -293,12 +306,12 @@ GNUNET_RECLAIM_get_attributes_stop ( | |||
293 | 306 | ||
294 | 307 | ||
295 | /** | 308 | /** |
296 | * List all attestations for a local identity. | 309 | * List all credentials for a local identity. |
297 | * This MUST lock the `struct GNUNET_RECLAIM_Handle` | 310 | * This MUST lock the `struct GNUNET_RECLAIM_Handle` |
298 | * for any other calls than #GNUNET_RECLAIM_get_attestations_next() and | 311 | * for any other calls than #GNUNET_RECLAIM_get_credentials_next() and |
299 | * #GNUNET_RECLAIM_get_attestations_stop. @a proc will be called once | 312 | * #GNUNET_RECLAIM_get_credentials_stop. @a proc will be called once |
300 | * immediately, and then again after | 313 | * immediately, and then again after |
301 | * #GNUNET_RECLAIM_get_attestations_next() is invoked. | 314 | * #GNUNET_RECLAIM_get_credentials_next() is invoked. |
302 | * | 315 | * |
303 | * On error (disconnect), @a error_cb will be invoked. | 316 | * On error (disconnect), @a error_cb will be invoked. |
304 | * On normal completion, @a finish_cb proc will be | 317 | * On normal completion, @a finish_cb proc will be |
@@ -309,34 +322,34 @@ GNUNET_RECLAIM_get_attributes_stop ( | |||
309 | * @param error_cb Function to call on error (i.e. disconnect), | 322 | * @param error_cb Function to call on error (i.e. disconnect), |
310 | * the handle is afterwards invalid | 323 | * the handle is afterwards invalid |
311 | * @param error_cb_cls Closure for @a error_cb | 324 | * @param error_cb_cls Closure for @a error_cb |
312 | * @param proc Function to call on each attestation | 325 | * @param proc Function to call on each credential |
313 | * @param proc_cls Closure for @a proc | 326 | * @param proc_cls Closure for @a proc |
314 | * @param finish_cb Function to call on completion | 327 | * @param finish_cb Function to call on completion |
315 | * the handle is afterwards invalid | 328 | * the handle is afterwards invalid |
316 | * @param finish_cb_cls Closure for @a finish_cb | 329 | * @param finish_cb_cls Closure for @a finish_cb |
317 | * @return an iterator Handle to use for iteration | 330 | * @return an iterator Handle to use for iteration |
318 | */ | 331 | */ |
319 | struct GNUNET_RECLAIM_AttestationIterator * | 332 | struct GNUNET_RECLAIM_CredentialIterator * |
320 | GNUNET_RECLAIM_get_attestations_start ( | 333 | GNUNET_RECLAIM_get_credentials_start ( |
321 | struct GNUNET_RECLAIM_Handle *h, | 334 | struct GNUNET_RECLAIM_Handle *h, |
322 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, | 335 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, |
323 | GNUNET_SCHEDULER_TaskCallback error_cb, | 336 | GNUNET_SCHEDULER_TaskCallback error_cb, |
324 | void *error_cb_cls, | 337 | void *error_cb_cls, |
325 | GNUNET_RECLAIM_AttestationResult proc, | 338 | GNUNET_RECLAIM_CredentialResult proc, |
326 | void *proc_cls, | 339 | void *proc_cls, |
327 | GNUNET_SCHEDULER_TaskCallback finish_cb, | 340 | GNUNET_SCHEDULER_TaskCallback finish_cb, |
328 | void *finish_cb_cls); | 341 | void *finish_cb_cls); |
329 | 342 | ||
330 | 343 | ||
331 | /** | 344 | /** |
332 | * Calls the record processor specified in #GNUNET_RECLAIM_get_attestation_start | 345 | * Calls the record processor specified in #GNUNET_RECLAIM_get_credentials_start |
333 | * for the next record. | 346 | * for the next record. |
334 | * | 347 | * |
335 | * @param it the iterator | 348 | * @param it the iterator |
336 | */ | 349 | */ |
337 | void | 350 | void |
338 | GNUNET_RECLAIM_get_attestations_next (struct | 351 | GNUNET_RECLAIM_get_credentials_next ( |
339 | GNUNET_RECLAIM_AttestationIterator *ait); | 352 | struct GNUNET_RECLAIM_CredentialIterator *ait); |
340 | 353 | ||
341 | 354 | ||
342 | /** | 355 | /** |
@@ -347,8 +360,8 @@ GNUNET_RECLAIM_get_attestations_next (struct | |||
347 | * @param it the iterator | 360 | * @param it the iterator |
348 | */ | 361 | */ |
349 | void | 362 | void |
350 | GNUNET_RECLAIM_get_attestations_stop (struct | 363 | GNUNET_RECLAIM_get_credentials_stop ( |
351 | GNUNET_RECLAIM_AttestationIterator *ait); | 364 | struct GNUNET_RECLAIM_CredentialIterator *ait); |
352 | 365 | ||
353 | 366 | ||
354 | /** | 367 | /** |
@@ -370,7 +383,7 @@ GNUNET_RECLAIM_ticket_issue ( | |||
370 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, | 383 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, |
371 | const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, | 384 | const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, |
372 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 385 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
373 | GNUNET_RECLAIM_TicketCallback cb, void *cb_cls); | 386 | GNUNET_RECLAIM_IssueTicketCallback cb, void *cb_cls); |
374 | 387 | ||
375 | 388 | ||
376 | /** | 389 | /** |