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_reclaim_lib.h"
43 #include "gnunet_util_lib.h"
44 
48 #define GNUNET_RECLAIM_VERSION 0x00000001
49 
54 
55 
60 
61 
69 {
74 
79 
84 };
85 
86 
96  void *cls,
97  const struct GNUNET_RECLAIM_Ticket *ticket);
98 
108  void *cls,
109  const struct GNUNET_RECLAIM_Ticket *ticket,
110  const struct GNUNET_RECLAIM_PresentationList *presentations);
111 
112 
121 typedef void (*GNUNET_RECLAIM_ContinuationWithStatus) (void *cls,
122  int32_t success,
123  const char *emsg);
124 
133  void *cls, const struct GNUNET_IDENTITY_PublicKey *identity,
134  const struct GNUNET_RECLAIM_Attribute *attr);
135 
145  void *cls, const struct GNUNET_IDENTITY_PublicKey *identity,
146  const struct GNUNET_RECLAIM_Attribute *attr,
147  const struct GNUNET_RECLAIM_Presentation *presentation);
148 
149 
159  void *cls, const struct GNUNET_IDENTITY_PublicKey *identity,
160  const struct GNUNET_RECLAIM_Credential *credential);
161 
162 
169 struct GNUNET_RECLAIM_Handle *
171 
172 
187  struct GNUNET_RECLAIM_Handle *h,
188  const struct GNUNET_IDENTITY_PrivateKey *pkey,
189  const struct GNUNET_RECLAIM_Attribute *attr,
190  const struct GNUNET_TIME_Relative *exp_interval,
191  GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls);
192 
193 
208  struct GNUNET_RECLAIM_Handle *h,
209  const struct GNUNET_IDENTITY_PrivateKey *pkey,
211  const struct GNUNET_TIME_Relative *exp_interval,
213  void *cont_cls);
214 
215 
229  struct GNUNET_RECLAIM_Handle *h,
230  const struct GNUNET_IDENTITY_PrivateKey *pkey,
231  const struct GNUNET_RECLAIM_Attribute *attr,
232  GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls);
233 
247  struct GNUNET_RECLAIM_Handle *h,
248  const struct GNUNET_IDENTITY_PrivateKey *pkey,
249  const struct GNUNET_RECLAIM_Credential *cred,
251  void *cont_cls);
252 
279  struct GNUNET_RECLAIM_Handle *h,
280  const struct GNUNET_IDENTITY_PrivateKey *identity,
284 
285 
292 void
295 
296 
304 void
307 
308 
335  struct GNUNET_RECLAIM_Handle *h,
336  const struct GNUNET_IDENTITY_PrivateKey *identity,
338  void *error_cb_cls,
340  void *proc_cls,
342  void *finish_cb_cls);
343 
344 
351 void
354 
355 
363 void
366 
367 
383  struct GNUNET_RECLAIM_Handle *h,
384  const struct GNUNET_IDENTITY_PrivateKey *iss,
385  const struct GNUNET_IDENTITY_PublicKey *rp,
386  const struct GNUNET_RECLAIM_AttributeList *attrs,
387  GNUNET_RECLAIM_IssueTicketCallback cb, void *cb_cls);
388 
389 
405  struct GNUNET_RECLAIM_Handle *h,
406  const struct GNUNET_IDENTITY_PrivateKey *identity,
407  const struct GNUNET_RECLAIM_Ticket *ticket,
408  GNUNET_RECLAIM_ContinuationWithStatus cb, void *cb_cls);
409 
410 
425  struct GNUNET_RECLAIM_Handle *h,
426  const struct GNUNET_IDENTITY_PrivateKey *identity,
427  const struct GNUNET_RECLAIM_Ticket *ticket,
428  GNUNET_RECLAIM_AttributeTicketResult cb, void *cb_cls);
429 
430 
450  struct GNUNET_RECLAIM_Handle *h,
451  const struct GNUNET_IDENTITY_PrivateKey *identity,
453  GNUNET_RECLAIM_TicketCallback proc, void *proc_cls,
455 
456 
463 void
465 
466 
474 void
476 
477 
483 void
485 
486 
495 void
497 
498 
499 #if 0 /* keep Emacsens' auto-indent happy */
500 {
501 #endif
502 #ifdef __cplusplus
503 }
504 #endif
505 
506 
507 /* ifndef GNUNET_RECLAIM_SERVICE_H */
508 #endif
509  /* end of group reclaim */
511 
512 /* end of gnunet_reclaim_service.h */
void GNUNET_RECLAIM_get_credentials_next(struct GNUNET_RECLAIM_CredentialIterator *ait)
Calls the record processor specified in GNUNET_RECLAIM_get_credentials_start for the next record...
Definition: reclaim_api.c:1486
Handle to the service.
Definition: reclaim_api.c:317
The authorization ticket.
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.
void GNUNET_RECLAIM_get_credentials_stop(struct GNUNET_RECLAIM_CredentialIterator *ait)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1508
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:485
struct GNUNET_RECLAIM_CredentialIterator * GNUNET_RECLAIM_get_credentials_start(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *identity, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_RECLAIM_CredentialResult proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
List all credentials for a local identity.
Definition: reclaim_api.c:1439
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:294
void GNUNET_RECLAIM_disconnect(struct GNUNET_RECLAIM_Handle *h)
Disconnect from identity provider service.
Definition: reclaim_api.c:1103
void GNUNET_RECLAIM_cancel(struct GNUNET_RECLAIM_Operation *op)
Cancel an identity provider operation.
Definition: reclaim_api.c:1088
A private key for an identity as per LSD0001.
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:144
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:1680
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:1700
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_consume(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *identity, const struct GNUNET_RECLAIM_Ticket *ticket, GNUNET_RECLAIM_AttributeTicketResult cb, void *cb_cls)
Consumes an issued ticket.
Definition: reclaim_api.c:1590
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:207
void(* GNUNET_RECLAIM_AttributeResult)(void *cls, const struct GNUNET_IDENTITY_PublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr)
Callback used to notify the client of attribute results.
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:1376
static struct GNUNET_TIME_Relative exp_interval
Attribute expiration interval.
Handle for an operation with the service.
Definition: reclaim_api.c:41
void(* GNUNET_RECLAIM_CredentialResult)(void *cls, const struct GNUNET_IDENTITY_PublicKey *identity, const struct GNUNET_RECLAIM_Credential *credential)
Callback used to notify the client of credential results.
GNUNET_RECLAIM_AttributeResult proc
The continuation to call with the results.
Definition: reclaim_api.c:212
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:217
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.
Handle for a attribute iterator operation.
Definition: reclaim_api.c:182
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:284
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_IDENTITY_PublicKey identity
The ticket issuer (= the user)
struct GNUNET_RECLAIM_AttributeIterator * GNUNET_RECLAIM_get_attributes_start(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *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:1330
GNUNET_RECLAIM_CredentialResult proc
The continuation to call with the results.
Definition: reclaim_api.c:279
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:164
A reclaim identifier FIXME maybe put this in a different namespace.
A credential presentation.
static struct GNUNET_RECLAIM_Identifier credential
Credential ID.
void(* GNUNET_RECLAIM_AttributeTicketResult)(void *cls, const struct GNUNET_IDENTITY_PublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr, const struct GNUNET_RECLAIM_Presentation *presentation)
Callback used to notify the client of attribute results.
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_credential_store(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *pkey, const struct GNUNET_RECLAIM_Credential *credential, const struct GNUNET_TIME_Relative *exp_interval, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Store a credential.
Definition: reclaim_api.c:1226
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attribute_delete(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *pkey, const struct GNUNET_RECLAIM_Attribute *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Delete an attribute.
Definition: reclaim_api.c:1181
An identity key as per LSD0001.
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:274
A list of GNUNET_RECLAIM_Presentation structures.
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_revoke(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *identity, const struct GNUNET_RECLAIM_Ticket *ticket, GNUNET_RECLAIM_ContinuationWithStatus cb, void *cb_cls)
Revoked an issued ticket.
Definition: reclaim_api.c:1731
configuration data
Definition: configuration.c:84
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_credential_delete(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *pkey, const struct GNUNET_RECLAIM_Credential *cred, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Delete a credential.
Definition: reclaim_api.c:1273
void GNUNET_RECLAIM_get_attributes_stop(struct GNUNET_RECLAIM_AttributeIterator *it)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1397
struct GNUNET_RECLAIM_Identifier rnd
The ticket random identifier.
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:227
void(* GNUNET_RECLAIM_IssueTicketCallback)(void *cls, const struct GNUNET_RECLAIM_Ticket *ticket, const struct GNUNET_RECLAIM_PresentationList *presentations)
Method called when a token has been issued.
Handle for a ticket iterator operation.
Definition: reclaim_api.c:119
struct GNUNET_IDENTITY_PublicKey audience
The ticket audience (= relying party)
static char * rp
Relying party.
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:269
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attribute_store(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *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:1134
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:1063
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_issue(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *iss, const struct GNUNET_IDENTITY_PublicKey *rp, const struct GNUNET_RECLAIM_AttributeList *attrs, GNUNET_RECLAIM_IssueTicketCallback cb, void *cb_cls)
Issues a ticket to a relying party.
Definition: reclaim_api.c:1541
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:139
Handle for a credential iterator operation.
Definition: reclaim_api.c:249
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:202
struct GNUNET_RECLAIM_TicketIterator * GNUNET_RECLAIM_ticket_iteration_start(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *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:1636
Time for relative time used by GNUnet, in microseconds.