GNUnet 0.21.1
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
38extern "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
125typedef void (*GNUNET_RECLAIM_ContinuationWithStatus) (void *cls,
126 int32_t success,
127 const char *emsg);
128
137 void *cls, const struct GNUNET_CRYPTO_PublicKey *identity,
138 const struct GNUNET_RECLAIM_Attribute *attr);
139
149 void *cls, const struct GNUNET_CRYPTO_PublicKey *identity,
150 const struct GNUNET_RECLAIM_Attribute *attr,
151 const struct GNUNET_RECLAIM_Presentation *presentation);
152
153
163 void *cls, const struct GNUNET_CRYPTO_PublicKey *identity,
165
166
175
176
191 struct GNUNET_RECLAIM_Handle *h,
192 const struct GNUNET_CRYPTO_PrivateKey *pkey,
193 const struct GNUNET_RECLAIM_Attribute *attr,
195 GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls);
196
197
212 struct GNUNET_RECLAIM_Handle *h,
213 const struct GNUNET_CRYPTO_PrivateKey *pkey,
217 void *cont_cls);
218
219
233 struct GNUNET_RECLAIM_Handle *h,
234 const struct GNUNET_CRYPTO_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_CRYPTO_PrivateKey *pkey,
253 const struct GNUNET_RECLAIM_Credential *cred,
255 void *cont_cls);
256
283 struct GNUNET_RECLAIM_Handle *h,
288
289
296void
299
300
308void
311
312
339 struct GNUNET_RECLAIM_Handle *h,
342 void *error_cb_cls,
344 void *proc_cls,
346 void *finish_cb_cls);
347
348
355void
358
359
367void
370
371
387 struct GNUNET_RECLAIM_Handle *h,
388 const struct GNUNET_CRYPTO_PrivateKey *iss,
389 const struct GNUNET_CRYPTO_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,
411 const struct GNUNET_RECLAIM_Ticket *ticket,
413
414
429 struct GNUNET_RECLAIM_Handle *h,
431 const struct GNUNET_RECLAIM_Ticket *ticket,
432 GNUNET_RECLAIM_AttributeTicketResult cb, void *cb_cls);
433
434
454 struct GNUNET_RECLAIM_Handle *h,
457 GNUNET_RECLAIM_TicketCallback proc, void *proc_cls,
459
460
467void
469
470
478void
480
481
487void
489
490
499void
501
508size_t
510
522 size_t len,
523 struct GNUNET_RECLAIM_Ticket *tkt,
524 size_t *tb_read);
525
534ssize_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 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 struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:109
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:1145
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_credential_store(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_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:1249
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:1643
void(* GNUNET_RECLAIM_TicketCallback)(void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
Method called when a token has been issued.
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:1752
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_issue(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *iss, const struct GNUNET_CRYPTO_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:1491
void GNUNET_RECLAIM_cancel(struct GNUNET_RECLAIM_Operation *op)
Cancel an identity provider operation.
Definition: reclaim_api.c:1130
void GNUNET_RECLAIM_get_attributes_stop(struct GNUNET_RECLAIM_AttributeIterator *it)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1393
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:1456
struct GNUNET_RECLAIM_AttributeIterator * GNUNET_RECLAIM_get_attributes_start(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_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:1334
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:1785
void(* GNUNET_RECLAIM_AttributeResult)(void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr)
Callback used to notify the client of attribute results.
void(* GNUNET_RECLAIM_CredentialResult)(void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Credential *credential)
Callback used to notify the client of credential results.
size_t GNUNET_RECLAIM_ticket_serialize_get_size(const struct GNUNET_RECLAIM_Ticket *tkt)
Get serialized ticket size.
Definition: reclaim_api.c:1742
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_revoke(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *identity, const struct GNUNET_RECLAIM_Ticket *ticket, GNUNET_RECLAIM_ContinuationWithStatus cb, void *cb_cls)
Revoked an issued ticket.
Definition: reclaim_api.c:1694
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:1379
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_ticket_consume(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *identity, const struct GNUNET_RECLAIM_Ticket *ticket, GNUNET_RECLAIM_AttributeTicketResult cb, void *cb_cls)
Consumes an issued ticket.
Definition: reclaim_api.c:1551
struct GNUNET_RECLAIM_Handle * GNUNET_RECLAIM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the re:claimID service.
Definition: reclaim_api.c:1113
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attribute_store(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_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:1164
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attribute_delete(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const struct GNUNET_RECLAIM_Attribute *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Delete an attribute.
Definition: reclaim_api.c:1208
void(* GNUNET_RECLAIM_AttributeTicketResult)(void *cls, const struct GNUNET_CRYPTO_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_TicketIterator * GNUNET_RECLAIM_ticket_iteration_start(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_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:1591
void GNUNET_RECLAIM_get_credentials_stop(struct GNUNET_RECLAIM_CredentialIterator *ait)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1471
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_credential_delete(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const struct GNUNET_RECLAIM_Credential *cred, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
Delete a credential.
Definition: reclaim_api.c:1293
void GNUNET_RECLAIM_ticket_iteration_stop(struct GNUNET_RECLAIM_TicketIterator *it)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1663
struct GNUNET_RECLAIM_CredentialIterator * GNUNET_RECLAIM_get_credentials_start(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_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:1411
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:181
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:225
GNUNET_RECLAIM_AttributeResult proc
The continuation to call with the results.
Definition: reclaim_api.c:210
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:215
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:200
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:205
A list of GNUNET_RECLAIM_Attribute structures.
Handle for a credential iterator operation.
Definition: reclaim_api.c:248
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:267
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:282
GNUNET_RECLAIM_CredentialResult proc
The continuation to call with the results.
Definition: reclaim_api.c:277
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:272
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:292
Handle to the service.
Definition: reclaim_api.c:316
A reclaim identifier FIXME maybe put this in a different namespace.
Handle for an operation with the service.
Definition: reclaim_api.c:40
A list of GNUNET_RECLAIM_Presentation structures.
A credential presentation.
Handle for a ticket iterator operation.
Definition: reclaim_api.c:118
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:162
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:137
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:142
The authorization ticket.
struct GNUNET_CRYPTO_PublicKey audience
The ticket audience (= relying party)
struct GNUNET_RECLAIM_Identifier rnd
The ticket random identifier.
struct GNUNET_CRYPTO_PublicKey identity
The ticket issuer (= the user)
Time for relative time used by GNUnet, in microseconds.