GNUnet  0.17.6
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 
34 #ifndef GNUNET_RECLAIM_SERVICE_H
35 #define GNUNET_RECLAIM_SERVICE_H
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #if 0 /* keep Emacsens' auto-indent happy */
40 }
41 #endif
42 #endif
43 
45 #include "gnunet_reclaim_lib.h"
46 #include "gnunet_util_lib.h"
47 
51 #define GNUNET_RECLAIM_VERSION 0x00000001
52 
57 
58 
63 
64 
72 {
77 
82 
87 };
88 
89 
99  void *cls,
100  const struct GNUNET_RECLAIM_Ticket *ticket);
101 
111  void *cls,
112  const struct GNUNET_RECLAIM_Ticket *ticket,
113  const struct GNUNET_RECLAIM_PresentationList *presentations);
114 
115 
124 typedef void (*GNUNET_RECLAIM_ContinuationWithStatus) (void *cls,
125  int32_t success,
126  const char *emsg);
127 
136  void *cls, const struct GNUNET_IDENTITY_PublicKey *identity,
137  const struct GNUNET_RECLAIM_Attribute *attr);
138 
148  void *cls, const struct GNUNET_IDENTITY_PublicKey *identity,
149  const struct GNUNET_RECLAIM_Attribute *attr,
150  const struct GNUNET_RECLAIM_Presentation *presentation);
151 
152 
162  void *cls, const struct GNUNET_IDENTITY_PublicKey *identity,
163  const struct GNUNET_RECLAIM_Credential *credential);
164 
165 
172 struct GNUNET_RECLAIM_Handle *
174 
175 
190  struct GNUNET_RECLAIM_Handle *h,
191  const struct GNUNET_IDENTITY_PrivateKey *pkey,
192  const struct GNUNET_RECLAIM_Attribute *attr,
193  const struct GNUNET_TIME_Relative *exp_interval,
194  GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls);
195 
196 
211  struct GNUNET_RECLAIM_Handle *h,
212  const struct GNUNET_IDENTITY_PrivateKey *pkey,
214  const struct GNUNET_TIME_Relative *exp_interval,
216  void *cont_cls);
217 
218 
232  struct GNUNET_RECLAIM_Handle *h,
233  const struct GNUNET_IDENTITY_PrivateKey *pkey,
234  const struct GNUNET_RECLAIM_Attribute *attr,
235  GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls);
236 
250  struct GNUNET_RECLAIM_Handle *h,
251  const struct GNUNET_IDENTITY_PrivateKey *pkey,
252  const struct GNUNET_RECLAIM_Credential *cred,
254  void *cont_cls);
255 
282  struct GNUNET_RECLAIM_Handle *h,
283  const struct GNUNET_IDENTITY_PrivateKey *identity,
287 
288 
295 void
298 
299 
307 void
310 
311 
338  struct GNUNET_RECLAIM_Handle *h,
339  const struct GNUNET_IDENTITY_PrivateKey *identity,
341  void *error_cb_cls,
343  void *proc_cls,
345  void *finish_cb_cls);
346 
347 
354 void
357 
358 
366 void
369 
370 
386  struct GNUNET_RECLAIM_Handle *h,
387  const struct GNUNET_IDENTITY_PrivateKey *iss,
388  const struct GNUNET_IDENTITY_PublicKey *rp,
389  const struct GNUNET_RECLAIM_AttributeList *attrs,
390  GNUNET_RECLAIM_IssueTicketCallback cb, void *cb_cls);
391 
392 
408  struct GNUNET_RECLAIM_Handle *h,
409  const struct GNUNET_IDENTITY_PrivateKey *identity,
410  const struct GNUNET_RECLAIM_Ticket *ticket,
411  GNUNET_RECLAIM_ContinuationWithStatus cb, void *cb_cls);
412 
413 
428  struct GNUNET_RECLAIM_Handle *h,
429  const struct GNUNET_IDENTITY_PrivateKey *identity,
430  const struct GNUNET_RECLAIM_Ticket *ticket,
431  GNUNET_RECLAIM_AttributeTicketResult cb, void *cb_cls);
432 
433 
453  struct GNUNET_RECLAIM_Handle *h,
454  const struct GNUNET_IDENTITY_PrivateKey *identity,
456  GNUNET_RECLAIM_TicketCallback proc, void *proc_cls,
458 
459 
466 void
468 
469 
477 void
479 
480 
486 void
488 
489 
498 void
500 
501 
502 #if 0 /* keep Emacsens' auto-indent happy */
503 {
504 #endif
505 #ifdef __cplusplus
506 }
507 #endif
508 
509 
510 /* ifndef GNUNET_RECLAIM_SERVICE_H */
511 #endif
512  /* end of group reclaim */
514  /* end of group addition */
516 
517 /* end of gnunet_reclaim_service.h */
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:479
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static char * pkey
Public key of the zone to look in, in ASCII.
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
static struct GNUNET_TIME_Relative exp_interval
Attribute expiration interval.
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
static char * rp
Relying party.
static struct GNUNET_RECLAIM_Identifier credential
Credential ID.
Identity service; implements identity management for GNUnet.
Identity attribute definitions.
void GNUNET_RECLAIM_disconnect(struct GNUNET_RECLAIM_Handle *h)
Disconnect from identity provider service.
Definition: reclaim_api.c:1103
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
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_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:1679
void(* GNUNET_RECLAIM_TicketCallback)(void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
Method called when a token has been issued.
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
void GNUNET_RECLAIM_cancel(struct GNUNET_RECLAIM_Operation *op)
Cancel an identity provider operation.
Definition: reclaim_api.c:1088
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
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
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
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.
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
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(* 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
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
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.
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
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:1730
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:1635
struct GNUNET_RECLAIM_Handle * GNUNET_RECLAIM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the re:claimID service.
Definition: reclaim_api.c:1063
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.
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
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:1589
void GNUNET_RECLAIM_ticket_iteration_stop(struct GNUNET_RECLAIM_TicketIterator *it)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1699
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
Handle for a attribute iterator operation.
Definition: reclaim_api.c:183
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:227
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
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:202
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:207
A list of GNUNET_RECLAIM_Attribute structures.
Handle for a credential iterator operation.
Definition: reclaim_api.c:250
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:269
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:284
GNUNET_RECLAIM_CredentialResult proc
The continuation to call with the results.
Definition: reclaim_api.c:279
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:274
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:294
Handle to the service.
Definition: reclaim_api.c:318
A reclaim identifier FIXME maybe put this in a different namespace.
Handle for an operation with the service.
Definition: reclaim_api.c:42
A list of GNUNET_RECLAIM_Presentation structures.
A credential presentation.
Handle for a ticket iterator operation.
Definition: reclaim_api.c:120
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:164
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:139
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:144
The authorization ticket.
struct GNUNET_RECLAIM_Identifier rnd
The ticket random identifier.
struct GNUNET_IDENTITY_PublicKey audience
The ticket audience (= relying party)
struct GNUNET_IDENTITY_PublicKey identity
The ticket issuer (= the user)
Time for relative time used by GNUnet, in microseconds.