diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-04 21:15:59 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-09 20:38:10 +0100 |
commit | ad342b7e0870185522c7dcb846e71029fcfda335 (patch) | |
tree | 22dfa48bc4334d6b381bdb76458eb4c078ff9ac6 /src/include/gnunet_reclaim_service.h | |
parent | 55f6d26b7424d660c99bc89f3677b20294e87a27 (diff) | |
download | gnunet-ad342b7e0870185522c7dcb846e71029fcfda335.tar.gz gnunet-ad342b7e0870185522c7dcb846e71029fcfda335.zip |
add attestation API
Diffstat (limited to 'src/include/gnunet_reclaim_service.h')
-rw-r--r-- | src/include/gnunet_reclaim_service.h | 72 |
1 files changed, 70 insertions, 2 deletions
diff --git a/src/include/gnunet_reclaim_service.h b/src/include/gnunet_reclaim_service.h index 4ead87003..c9c4fa5d1 100644 --- a/src/include/gnunet_reclaim_service.h +++ b/src/include/gnunet_reclaim_service.h | |||
@@ -107,7 +107,6 @@ typedef void (*GNUNET_RECLAIM_ContinuationWithStatus) (void *cls, | |||
107 | int32_t success, | 107 | int32_t success, |
108 | const char *emsg); | 108 | const char *emsg); |
109 | 109 | ||
110 | |||
111 | /** | 110 | /** |
112 | * Callback used to notify the client of attribute results. | 111 | * Callback used to notify the client of attribute results. |
113 | * | 112 | * |
@@ -118,6 +117,18 @@ typedef void (*GNUNET_RECLAIM_ContinuationWithStatus) (void *cls, | |||
118 | */ | 117 | */ |
119 | typedef void (*GNUNET_RECLAIM_AttributeResult) ( | 118 | typedef void (*GNUNET_RECLAIM_AttributeResult) ( |
120 | void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, | 119 | void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, |
120 | const struct GNUNET_RECLAIM_Attribute *attr); | ||
121 | |||
122 | /** | ||
123 | * Callback used to notify the client of attribute results. | ||
124 | * | ||
125 | * @param cls The callback closure | ||
126 | * @param identity The identity authoritative over the attributes | ||
127 | * @param attr The attribute | ||
128 | * @param attestation The attestation for the attribute (may be NULL) | ||
129 | */ | ||
130 | typedef void (*GNUNET_RECLAIM_AttributeTicketResult) ( | ||
131 | void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, | ||
121 | const struct GNUNET_RECLAIM_Attribute *attr, | 132 | const struct GNUNET_RECLAIM_Attribute *attr, |
122 | const struct GNUNET_RECLAIM_Attestation *attestation); | 133 | const struct GNUNET_RECLAIM_Attestation *attestation); |
123 | 134 | ||
@@ -281,6 +292,63 @@ GNUNET_RECLAIM_get_attributes_stop ( | |||
281 | 292 | ||
282 | 293 | ||
283 | /** | 294 | /** |
295 | * List all attestations for a local identity. | ||
296 | * This MUST lock the `struct GNUNET_RECLAIM_Handle` | ||
297 | * for any other calls than #GNUNET_RECLAIM_get_attestations_next() and | ||
298 | * #GNUNET_RECLAIM_get_attestations_stop. @a proc will be called once | ||
299 | * immediately, and then again after | ||
300 | * #GNUNET_RECLAIM_get_attestations_next() is invoked. | ||
301 | * | ||
302 | * On error (disconnect), @a error_cb will be invoked. | ||
303 | * On normal completion, @a finish_cb proc will be | ||
304 | * invoked. | ||
305 | * | ||
306 | * @param h Handle to the re:claimID service | ||
307 | * @param identity Identity to iterate over | ||
308 | * @param error_cb Function to call on error (i.e. disconnect), | ||
309 | * the handle is afterwards invalid | ||
310 | * @param error_cb_cls Closure for @a error_cb | ||
311 | * @param proc Function to call on each attestation | ||
312 | * @param proc_cls Closure for @a proc | ||
313 | * @param finish_cb Function to call on completion | ||
314 | * the handle is afterwards invalid | ||
315 | * @param finish_cb_cls Closure for @a finish_cb | ||
316 | * @return an iterator Handle to use for iteration | ||
317 | */ | ||
318 | struct GNUNET_RECLAIM_AttestationIterator * | ||
319 | GNUNET_RECLAIM_get_attestations_start ( | ||
320 | struct GNUNET_RECLAIM_Handle *h, | ||
321 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, | ||
322 | GNUNET_SCHEDULER_TaskCallback error_cb, | ||
323 | void *error_cb_cls, | ||
324 | GNUNET_RECLAIM_AttestationResult proc, | ||
325 | void *proc_cls, | ||
326 | GNUNET_SCHEDULER_TaskCallback finish_cb, | ||
327 | void *finish_cb_cls); | ||
328 | |||
329 | |||
330 | /** | ||
331 | * Calls the record processor specified in #GNUNET_RECLAIM_get_attestation_start | ||
332 | * for the next record. | ||
333 | * | ||
334 | * @param it the iterator | ||
335 | */ | ||
336 | void | ||
337 | GNUNET_RECLAIM_get_attestations_next (struct GNUNET_RECLAIM_AttestationIterator *ait); | ||
338 | |||
339 | |||
340 | /** | ||
341 | * Stops iteration and releases the handle for further calls. Must | ||
342 | * be called on any iteration that has not yet completed prior to calling | ||
343 | * #GNUNET_RECLAIM_disconnect. | ||
344 | * | ||
345 | * @param it the iterator | ||
346 | */ | ||
347 | void | ||
348 | GNUNET_RECLAIM_get_attestations_stop (struct GNUNET_RECLAIM_AttestationIterator *ait); | ||
349 | |||
350 | |||
351 | /** | ||
284 | * Issues a ticket to a relying party. The identity may use | 352 | * Issues a ticket to a relying party. The identity may use |
285 | * GNUNET_RECLAIM_ticket_consume to consume the ticket | 353 | * GNUNET_RECLAIM_ticket_consume to consume the ticket |
286 | * and retrieve the attributes specified in the attribute list. | 354 | * and retrieve the attributes specified in the attribute list. |
@@ -340,7 +408,7 @@ GNUNET_RECLAIM_ticket_consume ( | |||
340 | struct GNUNET_RECLAIM_Handle *h, | 408 | struct GNUNET_RECLAIM_Handle *h, |
341 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, | 409 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, |
342 | const struct GNUNET_RECLAIM_Ticket *ticket, | 410 | const struct GNUNET_RECLAIM_Ticket *ticket, |
343 | GNUNET_RECLAIM_AttributeResult cb, void *cb_cls); | 411 | GNUNET_RECLAIM_AttributeTicketResult cb, void *cb_cls); |
344 | 412 | ||
345 | 413 | ||
346 | /** | 414 | /** |