GNUnet  0.11.x
gnunet_reclaim_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2016 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 
31 #ifndef GNUNET_RECLAIM_SERVICE_H
32 #define GNUNET_RECLAIM_SERVICE_H
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #if 0 /* keep Emacsens' auto-indent happy */
37 }
38 #endif
39 #endif
40 
41 #include "gnunet_reclaim_lib.h"
42 #include "gnunet_util_lib.h"
43 
47 #define GNUNET_RECLAIM_VERSION 0x00000001
48 
53 
54 
59 
60 
68 {
73 
78 
83 };
84 
85 
95  void *cls, const struct GNUNET_RECLAIM_Ticket *ticket);
96 
97 
106 typedef void (*GNUNET_RECLAIM_ContinuationWithStatus) (void *cls,
107  int32_t success,
108  const char *emsg);
109 
119  void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
120  const struct GNUNET_RECLAIM_Attribute *attr);
121 
131  void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
132  const struct GNUNET_RECLAIM_Attribute *attr,
134 
135 
145  void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
147 
148 
155 struct GNUNET_RECLAIM_Handle *
157 
158 
173  struct GNUNET_RECLAIM_Handle *h,
174  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
175  const struct GNUNET_RECLAIM_Attribute *attr,
176  const struct GNUNET_TIME_Relative *exp_interval,
177  GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls);
178 
179 
194  struct GNUNET_RECLAIM_Handle *h,
195  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
197  const struct GNUNET_TIME_Relative *exp_interval,
199  void *cont_cls);
200 
201 
215  struct GNUNET_RECLAIM_Handle *h,
216  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
217  const struct GNUNET_RECLAIM_Attribute *attr,
218  GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls);
219 
233  struct GNUNET_RECLAIM_Handle *h,
234  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
235  const struct GNUNET_RECLAIM_Attestation *attr,
237  void *cont_cls);
238 
265  struct GNUNET_RECLAIM_Handle *h,
266  const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
270 
271 
278 void
281 
282 
290 void
293 
294 
321  struct GNUNET_RECLAIM_Handle *h,
322  const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
324  void *error_cb_cls,
326  void *proc_cls,
328  void *finish_cb_cls);
329 
330 
337 void
339 
340 
348 void
350 
351 
367  struct GNUNET_RECLAIM_Handle *h,
368  const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss,
369  const struct GNUNET_CRYPTO_EcdsaPublicKey *rp,
370  const struct GNUNET_RECLAIM_AttributeList *attrs,
371  GNUNET_RECLAIM_TicketCallback cb, void *cb_cls);
372 
373 
389  struct GNUNET_RECLAIM_Handle *h,
390  const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
391  const struct GNUNET_RECLAIM_Ticket *ticket,
392  GNUNET_RECLAIM_ContinuationWithStatus cb, void *cb_cls);
393 
394 
409  struct GNUNET_RECLAIM_Handle *h,
410  const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
411  const struct GNUNET_RECLAIM_Ticket *ticket,
412  GNUNET_RECLAIM_AttributeTicketResult cb, void *cb_cls);
413 
414 
434  struct GNUNET_RECLAIM_Handle *h,
435  const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
437  GNUNET_RECLAIM_TicketCallback proc, void *proc_cls,
439 
440 
447 void
449 
450 
458 void
460 
461 
467 void
469 
470 
479 void
481 
482 
483 #if 0 /* keep Emacsens' auto-indent happy */
484 {
485 #endif
486 #ifdef __cplusplus
487 }
488 #endif
489 
490 
491 /* ifndef GNUNET_RECLAIM_SERVICE_H */
492 #endif
493  /* end of group reclaim */
495 
496 /* end of gnunet_reclaim_service.h */
Handle to the service.
Definition: reclaim_api.c:312
The authorization ticket.
struct GNUNET_RECLAIM_AttributeIterator * GNUNET_RECLAIM_get_attributes_start(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_RECLAIM_AttributeResult proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
List all attributes for a local identity.
Definition: reclaim_api.c:1293
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static char * pkey
Public key of the zone to look in, in ASCII.
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_consume(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, const struct GNUNET_RECLAIM_Ticket *ticket, GNUNET_RECLAIM_AttributeTicketResult cb, void *cb_cls)
Consumes an issued ticket.
Definition: reclaim_api.c:1553
struct GNUNET_RECLAIM_AttestationIterator * GNUNET_RECLAIM_get_attestations_start(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_RECLAIM_AttestationResult proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
List all attestations for a local identity.
Definition: reclaim_api.c:1402
struct GNUNET_RECLAIM_TicketIterator * GNUNET_RECLAIM_ticket_iteration_start(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_RECLAIM_TicketCallback proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
Lists all tickets that have been issued to remote identites (relying parties)
Definition: reclaim_api.c:1597
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:264
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attribute_delete(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_Attribute *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Delete an attribute.
Definition: reclaim_api.c:1144
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:485
void GNUNET_RECLAIM_disconnect(struct GNUNET_RECLAIM_Handle *h)
Disconnect from identity provider service.
Definition: reclaim_api.c:1066
void GNUNET_RECLAIM_cancel(struct GNUNET_RECLAIM_Operation *op)
Cancel an identity provider operation.
Definition: reclaim_api.c:1051
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:139
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attestation_delete(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_Attestation *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Delete an attestation.
Definition: reclaim_api.c:1236
void GNUNET_RECLAIM_ticket_iteration_next(struct GNUNET_RECLAIM_TicketIterator *it)
Calls the ticket processor specified in GNUNET_RECLAIM_ticket_iteration_start for the next record...
Definition: reclaim_api.c:1641
A list of GNUNET_RECLAIM_Attribute structures.
void GNUNET_RECLAIM_ticket_iteration_stop(struct GNUNET_RECLAIM_TicketIterator *it)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1661
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:202
Private ECC key encoded for transmission.
void GNUNET_RECLAIM_get_attributes_next(struct GNUNET_RECLAIM_AttributeIterator *it)
Calls the record processor specified in GNUNET_RECLAIM_get_attributes_start for the next record...
Definition: reclaim_api.c:1339
static struct GNUNET_TIME_Relative exp_interval
Attribute expiration interval.
Handle for an operation with the service.
Definition: reclaim_api.c:41
GNUNET_RECLAIM_AttributeResult proc
The continuation to call with the results.
Definition: reclaim_api.c:207
void GNUNET_RECLAIM_get_attestations_next(struct GNUNET_RECLAIM_AttestationIterator *ait)
Calls the record processor specified in #GNUNET_RECLAIM_get_attestation_start for the next record...
Definition: reclaim_api.c:1449
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:212
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:269
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_revoke(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, const struct GNUNET_RECLAIM_Ticket *ticket, GNUNET_RECLAIM_ContinuationWithStatus cb, void *cb_cls)
Revoked an issued ticket.
Definition: reclaim_api.c:1692
Handle for a attribute iterator operation.
Definition: reclaim_api.c:177
void(* GNUNET_RECLAIM_ContinuationWithStatus)(void *cls, int32_t success, const char *emsg)
Continuation called to notify client about result of the operation.
void(* GNUNET_RECLAIM_TicketCallback)(void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
Method called when a token has been issued.
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:159
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attribute_store(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_Attribute *attr, const struct GNUNET_TIME_Relative *exp_interval, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Store an attribute.
Definition: reclaim_api.c:1097
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attestation_store(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_Attestation *attestation, const struct GNUNET_TIME_Relative *exp_interval, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Store an attestation.
Definition: reclaim_api.c:1189
struct GNUNET_CRYPTO_EcdsaPublicKey identity
The ticket issuer (= the user)
A reclaim identifier FIXME maybe put this in a different namespace.
static struct GNUNET_RECLAIM_Identifier attestation
Attestation ID.
configuration data
Definition: configuration.c:84
void GNUNET_RECLAIM_get_attributes_stop(struct GNUNET_RECLAIM_AttributeIterator *it)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1360
Handle for a attestation iterator operation.
Definition: reclaim_api.c:244
struct GNUNET_RECLAIM_Identifier rnd
The ticket random identifier.
struct GNUNET_CRYPTO_EcdsaPublicKey audience
The ticket audience (= relying party)
void(* GNUNET_RECLAIM_AttributeResult)(void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr)
Callback used to notify the client of attribute results.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:222
Handle for a ticket iterator operation.
Definition: reclaim_api.c:114
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:289
static char * rp
Relying party.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
struct GNUNET_RECLAIM_Handle * GNUNET_RECLAIM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the re:claimID service.
Definition: reclaim_api.c:1026
GNUNET_RECLAIM_AttestationResult proc
The continuation to call with the results.
Definition: reclaim_api.c:274
void(* GNUNET_RECLAIM_AttestationResult)(void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, const struct GNUNET_RECLAIM_Attestation *attestation)
Callback used to notify the client of attestation results.
void(* GNUNET_RECLAIM_AttributeTicketResult)(void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr, const struct GNUNET_RECLAIM_Attestation *attestation)
Callback used to notify the client of attribute results.
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:134
void GNUNET_RECLAIM_get_attestations_stop(struct GNUNET_RECLAIM_AttestationIterator *ait)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1471
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_issue(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, const struct GNUNET_RECLAIM_AttributeList *attrs, GNUNET_RECLAIM_TicketCallback cb, void *cb_cls)
Issues a ticket to a relying party.
Definition: reclaim_api.c:1504
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:197
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:279
Time for relative time used by GNUnet, in microseconds.