GNUnet  0.19.2
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 
44 
46 #include "gnunet_reclaim_lib.h"
47 #include "gnunet_util_lib.h"
48 
52 #define GNUNET_RECLAIM_VERSION 0x00000001
53 
58 
59 
64 
65 
73 {
78 
83 
88 };
89 
90 
100  void *cls,
101  const struct GNUNET_RECLAIM_Ticket *ticket);
102 
112  void *cls,
113  const struct GNUNET_RECLAIM_Ticket *ticket,
114  const struct GNUNET_RECLAIM_PresentationList *presentations);
115 
116 
125 typedef void (*GNUNET_RECLAIM_ContinuationWithStatus) (void *cls,
126  int32_t success,
127  const char *emsg);
128 
137  void *cls, const struct GNUNET_IDENTITY_PublicKey *identity,
138  const struct GNUNET_RECLAIM_Attribute *attr);
139 
149  void *cls, const struct GNUNET_IDENTITY_PublicKey *identity,
150  const struct GNUNET_RECLAIM_Attribute *attr,
151  const struct GNUNET_RECLAIM_Presentation *presentation);
152 
153 
163  void *cls, const struct GNUNET_IDENTITY_PublicKey *identity,
164  const struct GNUNET_RECLAIM_Credential *credential);
165 
166 
173 struct GNUNET_RECLAIM_Handle *
175 
176 
191  struct GNUNET_RECLAIM_Handle *h,
192  const struct GNUNET_IDENTITY_PrivateKey *pkey,
193  const struct GNUNET_RECLAIM_Attribute *attr,
194  const struct GNUNET_TIME_Relative *exp_interval,
195  GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls);
196 
197 
212  struct GNUNET_RECLAIM_Handle *h,
213  const struct GNUNET_IDENTITY_PrivateKey *pkey,
215  const struct GNUNET_TIME_Relative *exp_interval,
217  void *cont_cls);
218 
219 
233  struct GNUNET_RECLAIM_Handle *h,
234  const struct GNUNET_IDENTITY_PrivateKey *pkey,
235  const struct GNUNET_RECLAIM_Attribute *attr,
236  GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls);
237 
251  struct GNUNET_RECLAIM_Handle *h,
252  const struct GNUNET_IDENTITY_PrivateKey *pkey,
253  const struct GNUNET_RECLAIM_Credential *cred,
255  void *cont_cls);
256 
283  struct GNUNET_RECLAIM_Handle *h,
284  const struct GNUNET_IDENTITY_PrivateKey *identity,
288 
289 
296 void
299 
300 
308 void
311 
312 
339  struct GNUNET_RECLAIM_Handle *h,
340  const struct GNUNET_IDENTITY_PrivateKey *identity,
342  void *error_cb_cls,
344  void *proc_cls,
346  void *finish_cb_cls);
347 
348 
355 void
358 
359 
367 void
370 
371 
387  struct GNUNET_RECLAIM_Handle *h,
388  const struct GNUNET_IDENTITY_PrivateKey *iss,
389  const struct GNUNET_IDENTITY_PublicKey *rp,
390  const struct GNUNET_RECLAIM_AttributeList *attrs,
391  GNUNET_RECLAIM_IssueTicketCallback cb, void *cb_cls);
392 
393 
409  struct GNUNET_RECLAIM_Handle *h,
410  const struct GNUNET_IDENTITY_PrivateKey *identity,
411  const struct GNUNET_RECLAIM_Ticket *ticket,
412  GNUNET_RECLAIM_ContinuationWithStatus cb, void *cb_cls);
413 
414 
429  struct GNUNET_RECLAIM_Handle *h,
430  const struct GNUNET_IDENTITY_PrivateKey *identity,
431  const struct GNUNET_RECLAIM_Ticket *ticket,
432  GNUNET_RECLAIM_AttributeTicketResult cb, void *cb_cls);
433 
434 
454  struct GNUNET_RECLAIM_Handle *h,
455  const struct GNUNET_IDENTITY_PrivateKey *identity,
457  GNUNET_RECLAIM_TicketCallback proc, void *proc_cls,
459 
460 
467 void
469 
470 
478 void
480 
481 
487 void
489 
490 
499 void
501 
508 size_t
510 
521 GNUNET_RECLAIM_read_ticket_from_buffer (const void *buffer,
522  size_t len,
523  struct GNUNET_RECLAIM_Ticket *tkt,
524  size_t *tb_read);
525 
534 ssize_t
537  void *buffer,
538  size_t len);
539 
540 #if 0 /* keep Emacsens' auto-indent happy */
541 {
542 #endif
543 #ifdef __cplusplus
544 }
545 #endif
546 
547 
548 /* ifndef GNUNET_RECLAIM_SERVICE_H */
549 #endif
550  /* end of group reclaim */
552  /* end of group addition */
554 
555 /* 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
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
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.
GNUNET_GenericReturnValue
Named constants for return values.
void GNUNET_RECLAIM_disconnect(struct GNUNET_RECLAIM_Handle *h)
Disconnect from identity provider service.
Definition: reclaim_api.c:1143
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:1247
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:1641
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:1332
enum GNUNET_GenericReturnValue GNUNET_RECLAIM_read_ticket_from_buffer(const void *buffer, size_t len, struct GNUNET_RECLAIM_Ticket *tkt, size_t *tb_read)
Deserializes a ticket.
Definition: reclaim_api.c:1750
void GNUNET_RECLAIM_cancel(struct GNUNET_RECLAIM_Operation *op)
Cancel an identity provider operation.
Definition: reclaim_api.c:1128
void GNUNET_RECLAIM_get_attributes_stop(struct GNUNET_RECLAIM_AttributeIterator *it)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1391
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:1454
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:1162
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.
ssize_t GNUNET_RECLAIM_write_ticket_to_buffer(const struct GNUNET_RECLAIM_Ticket *tkt, void *buffer, size_t len)
Serializes a ticket.
Definition: reclaim_api.c:1783
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:1291
size_t GNUNET_RECLAIM_ticket_serialize_get_size(const struct GNUNET_RECLAIM_Ticket *tkt)
Get serialized ticket size.
Definition: reclaim_api.c:1740
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:1409
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:1377
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:1489
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:1206
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:1692
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:1589
struct GNUNET_RECLAIM_Handle * GNUNET_RECLAIM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the re:claimID service.
Definition: reclaim_api.c:1111
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:1469
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:1549
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(* 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:182
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:226
GNUNET_RECLAIM_AttributeResult proc
The continuation to call with the results.
Definition: reclaim_api.c:211
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:216
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:201
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:206
A list of GNUNET_RECLAIM_Attribute structures.
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:268
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:283
GNUNET_RECLAIM_CredentialResult proc
The continuation to call with the results.
Definition: reclaim_api.c:278
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:273
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:293
Handle to the service.
Definition: reclaim_api.c:317
A reclaim identifier FIXME maybe put this in a different namespace.
Handle for an operation with the service.
Definition: reclaim_api.c:41
A list of GNUNET_RECLAIM_Presentation structures.
A credential presentation.
Handle for a ticket iterator operation.
Definition: reclaim_api.c:119
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:163
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:138
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:143
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.