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 
42 #include "gnunet_util_lib.h"
43 
47 #define GNUNET_RECLAIM_VERSION 0x00000001
48 
53 
54 
59 
60 
68 {
73 
78 
82  uint64_t rnd;
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 
110 
119  void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
120  const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr,
121  const struct GNUNET_RECLAIM_ATTESTATION_Claim *attest,
122  const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *reference);
123 
124 
131 struct GNUNET_RECLAIM_Handle *
133 
134 
149  struct GNUNET_RECLAIM_Handle *h,
150  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
151  const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr,
152  const struct GNUNET_TIME_Relative *exp_interval,
153  GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls);
154 
155 
170  struct GNUNET_RECLAIM_Handle *h,
171  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
172  const struct GNUNET_RECLAIM_ATTESTATION_Claim *attr,
173  const struct GNUNET_TIME_Relative *exp_interval,
175  void *cont_cls);
176 
177 
191  struct GNUNET_RECLAIM_Handle *h,
192  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
193  const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr,
194  GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls);
195 
209  struct GNUNET_RECLAIM_Handle *h,
210  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
211  const struct GNUNET_RECLAIM_ATTESTATION_Claim *attr,
213  void *cont_cls);
214 
228  struct GNUNET_RECLAIM_Handle *h,
229  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
230  const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr,
232  void *cont_cls);
259  struct GNUNET_RECLAIM_Handle *h,
260  const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
264 
279  struct GNUNET_RECLAIM_Handle *h,
280  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
281  const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr,
282  const struct GNUNET_TIME_Relative *exp_interval,
284  void *cont_cls);
285 
292 void
295 
296 
304 void
307 
308 
324  struct GNUNET_RECLAIM_Handle *h,
325  const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss,
326  const struct GNUNET_CRYPTO_EcdsaPublicKey *rp,
327  const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
328  GNUNET_RECLAIM_TicketCallback cb, void *cb_cls);
329 
330 
346  struct GNUNET_RECLAIM_Handle *h,
347  const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
348  const struct GNUNET_RECLAIM_Ticket *ticket,
349  GNUNET_RECLAIM_ContinuationWithStatus cb, void *cb_cls);
350 
351 
366  struct GNUNET_RECLAIM_Handle *h,
367  const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
368  const struct GNUNET_RECLAIM_Ticket *ticket,
369  GNUNET_RECLAIM_AttributeResult cb, void *cb_cls);
370 
371 
391  struct GNUNET_RECLAIM_Handle *h,
392  const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
394  GNUNET_RECLAIM_TicketCallback proc, void *proc_cls,
396 
397 
404 void
406 
407 
415 void
417 
418 
424 void
426 
427 
436 void
438 
439 
440 #if 0 /* keep Emacsens' auto-indent happy */
441 {
442 #endif
443 #ifdef __cplusplus
444 }
445 #endif
446 
447 
448 /* ifndef GNUNET_RECLAIM_SERVICE_H */
449 #endif
450  /* end of group reclaim */
452 
453 /* end of gnunet_reclaim_service.h */
Handle to the service.
Definition: reclaim_api.c:235
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:1358
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_attribute_store(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, const struct GNUNET_TIME_Relative *exp_interval, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Store an attribute.
Definition: reclaim_api.c:1075
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:1549
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attestation_reference_delete(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Delete an attestation reference.
Definition: reclaim_api.c:1301
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:485
void(* GNUNET_RECLAIM_AttributeResult)(void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, const struct GNUNET_RECLAIM_ATTESTATION_Claim *attest, const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *reference)
Callback used to notify the client of attribute results.
void GNUNET_RECLAIM_disconnect(struct GNUNET_RECLAIM_Handle *h)
Disconnect from identity provider service.
Definition: reclaim_api.c:1044
void GNUNET_RECLAIM_cancel(struct GNUNET_RECLAIM_Operation *op)
Cancel an identity provider operation.
Definition: reclaim_api.c:1029
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:129
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:1593
void GNUNET_RECLAIM_ticket_iteration_stop(struct GNUNET_RECLAIM_TicketIterator *it)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1613
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:192
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:1404
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:197
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attestation_delete(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_ATTESTATION_Claim *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Delete an attestation.
Definition: reclaim_api.c:1212
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:202
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.
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:1644
Handle for a attribute iterator operation.
Definition: reclaim_api.c:167
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.
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attribute_delete(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Delete an attribute.
Definition: reclaim_api.c:1122
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_ATTRIBUTE_ClaimList *attrs, GNUNET_RECLAIM_TicketCallback cb, void *cb_cls)
Issues a ticket to a relying party.
Definition: reclaim_api.c:1456
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:149
struct GNUNET_CRYPTO_EcdsaPublicKey identity
The ticket issuer (= the user)
uint64_t rnd
The ticket random (NBO)
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:1425
struct GNUNET_CRYPTO_EcdsaPublicKey audience
The ticket audience (= relying party)
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:212
A list of GNUNET_RECLAIM_ATTRIBUTE_Claim structures.
Handle for a ticket iterator operation.
Definition: reclaim_api.c:104
static char * rp
Relying party.
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_AttributeResult cb, void *cb_cls)
Consumes an issued ticket.
Definition: reclaim_api.c:1505
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:1004
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:124
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attestation_store(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_ATTESTATION_Claim *attr, const struct GNUNET_TIME_Relative *exp_interval, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Store an attestation.
Definition: reclaim_api.c:1166
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:187
Time for relative time used by GNUnet, in microseconds.
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attestation_reference_store(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr, const struct GNUNET_TIME_Relative *exp_interval, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Store an attestation reference.
Definition: reclaim_api.c:1256