GNUnet 0.21.2
gnunet-reclaim.c
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2012-2015 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 */
26#include "platform.h"
27#include <inttypes.h>
28
29#include "gnunet_util_lib.h"
30
34#include "gnunet_signatures.h"
38static int ret;
39
43static int list;
44
49
53static char *credential_id;
54
58static char *ex_rp_uri;
59
64
68static char *credential_name;
69
73static char *credential_type;
74
79
83static char *rp;
84
88static char *attr_name;
89
93static char *attr_value;
94
98static char *issue_attrs;
99
103static char *consume_ticket;
104
108static char *type_str;
109
113static char *revoke_ticket;
114
118static int list_tickets;
119
123static char *ego_name;
124
129
134
139
144
149
150
155
156
160static const struct GNUNET_CRYPTO_PrivateKey *pkey;
161
166
171
176
181
186
191
195static char *attr_delete;
196
201
202static void
203do_cleanup (void *cls)
204{
205 cleanup_task = NULL;
206 if (NULL != timeout)
208 if (NULL != reclaim_op)
210 if (NULL != attr_iterator)
212 if (NULL != cred_iterator)
214 if (NULL != ticket_iterator)
216 if (NULL != reclaim_handle)
218 if (NULL != identity_handle)
220 if (NULL != attr_list)
221 {
223 attr_list = NULL;
224 }
225 if (NULL != attr_to_delete)
227 if (NULL == credential_type)
229}
230
231
232static void
234 const struct GNUNET_RECLAIM_Ticket *ticket,
235 const struct GNUNET_RECLAIM_PresentationList *presentations)
236{
237 reclaim_op = NULL;
238 if (NULL != ticket)
239 {
240 printf ("%s\n", ticket->gns_name);
241 }
243}
244
245
246static void
247store_cont (void *cls, int32_t success, const char *emsg)
248{
249 reclaim_op = NULL;
250 if (GNUNET_SYSERR == success)
251 {
252 fprintf (stderr, "%s\n", emsg);
253 }
255}
256
257
258static void
259process_attrs (void *cls,
260 const struct GNUNET_CRYPTO_PublicKey *identity,
261 const struct GNUNET_RECLAIM_Attribute *attr,
262 const struct GNUNET_RECLAIM_Presentation *presentation)
263{
264 char *value_str;
265 char *id;
266 const char *attr_type;
267
268 if (NULL == identity)
269 {
270 reclaim_op = NULL;
272 return;
273 }
274 if (NULL == attr)
275 {
276 ret = 1;
277 return;
278 }
280 id = GNUNET_STRINGS_data_to_string_alloc (&attr->id, sizeof(attr->id));
281 value_str = NULL;
282 if (NULL == presentation)
283 {
285 attr->data,
286 attr->data_size);
287 }
288 else
289 {
293
294 for (ale = al->list_head; NULL != ale; ale = ale->next)
295 {
296 if (0 != strncmp (attr->data, ale->attribute->name, attr->data_size))
297 continue;
298 value_str
300 ale->attribute->data,
301 ale->attribute->data_size);
302 break;
303 }
304 }
305 fprintf (stdout,
306 "Name: %s; Value: %s (%s); Flag %u; ID: %s %s\n",
307 attr->name,
308 (NULL != value_str) ? value_str : "???",
309 attr_type,
310 attr->flag,
311 id,
312 (NULL == presentation) ? "" : "(ATTESTED)");
313 GNUNET_free (value_str);
314 GNUNET_free (id);
315}
316
317
318static void
320{
321 ticket_iterator = NULL;
322 fprintf (stderr, "Failed to iterate over tickets\n");
324}
325
326
327static void
329{
330 ticket_iterator = NULL;
332}
333
334
335static void
336ticket_iter (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket, const char* rp_uri)
337{
338 fprintf (stdout, "Ticket: %s | RP URI: %s\n", ticket->gns_name, rp_uri);
340}
341
342
343static void
344iter_error (void *cls)
345{
346 attr_iterator = NULL;
347 cred_iterator = NULL;
348 fprintf (stderr, "Failed\n");
349
351}
352
353
354static void
355timeout_task (void *cls)
356{
357 timeout = NULL;
358 ret = 1;
359 fprintf (stderr, "Timeout\n");
360 if (NULL == cleanup_task)
362}
363
364
365static void
366process_rvk (void *cls, int success, const char *msg)
367{
368 reclaim_op = NULL;
369 if (GNUNET_OK != success)
370 {
371 fprintf (stderr, "Revocation failed.\n");
372 ret = 1;
373 }
375}
376
377
378static void
379process_delete (void *cls, int success, const char *msg)
380{
381 reclaim_op = NULL;
382 if (GNUNET_OK != success)
383 {
384 fprintf (stderr, "Deletion failed.\n");
385 ret = 1;
386 }
388}
389
390
391static void
392iter_finished (void *cls)
393{
395 char *attrs_tmp;
396 char *attr_str;
397 char *data;
398 size_t data_size;
399 int type;
400
401 attr_iterator = NULL;
402 if (list)
403 {
405 return;
406 }
407
408 if (issue_attrs)
409 {
410 attrs_tmp = GNUNET_strdup (issue_attrs);
411 attr_str = strtok (attrs_tmp, ",");
412 while (NULL != attr_str)
413 {
414 le = attr_list->list_head;
415 while (le)
416 {
417 if (0 == strcasecmp (attr_str, le->attribute->name))
418 break;
419
420 le = le->next;
421 }
422
423 if (! le)
424 {
425 fprintf (stdout, "No such attribute ``%s''\n", attr_str);
426 break;
427 }
428 attr_str = strtok (NULL, ",");
429 }
430 GNUNET_free (attrs_tmp);
431 if (NULL != attr_str)
432 {
434 return;
435 }
436 if (NULL == ex_rp_uri)
437 {
438 fprintf (stdout, "No RP URI provided\n");
440 return;
441 }
443 pkey,
444 ex_rp_uri,
445 attr_list,
447 NULL);
448 return;
449 }
450 if (consume_ticket)
451 {
452 if (NULL == ex_rp_uri)
453 {
454 fprintf (stderr, "Expected an RP URI to consume ticket\n");
456 return;
457 }
459 &ticket,
460 ex_rp_uri,
462 NULL);
466 NULL);
467 return;
468 }
469 if (revoke_ticket)
470 {
472 pkey,
473 &ticket,
475 NULL);
476 return;
477 }
478 if (attr_delete)
479 {
480 if (NULL == attr_to_delete)
481 {
482 fprintf (stdout, "No such attribute ``%s''\n", attr_delete);
484 return;
485 }
487 pkey,
490 NULL);
491 return;
492 }
493 if (attr_name)
494 {
495 if (NULL == type_str)
497 else
499
503 (void **) &data,
504 &data_size));
505 if (NULL != claim)
506 {
507 claim->type = type;
508 claim->data = data;
510 }
511 else
512 {
513 claim =
515 }
516 if (NULL != credential_id)
517 {
519 }
521 pkey,
522 claim,
524 &store_cont,
525 NULL);
528 return;
529 }
531}
532
533
534static void
535iter_cb (void *cls,
536 const struct GNUNET_CRYPTO_PublicKey *identity,
537 const struct GNUNET_RECLAIM_Attribute *attr)
538{
540 char *attrs_tmp;
541 char *attr_str;
542 char *label;
543 char *id;
544 const char *attr_type;
545
546 if ((NULL != attr_name) && (NULL == claim))
547 {
548 if (0 == strcasecmp (attr_name, attr->name))
549 {
551 &attr->credential,
552 attr->type,
553 attr->data,
554 attr->data_size);
555 claim->id = attr->id;
556 }
557 }
558 else if (issue_attrs)
559 {
560 attrs_tmp = GNUNET_strdup (issue_attrs);
561 attr_str = strtok (attrs_tmp, ",");
562 while (NULL != attr_str)
563 {
564 if (0 != strcasecmp (attr_str, attr->name))
565 {
566 attr_str = strtok (NULL, ",");
567 continue;
568 }
571 &attr->credential,
572 attr->type,
573 attr->data,
574 attr->data_size);
575 le->attribute->flag = attr->flag;
576 le->attribute->id = attr->id;
579 le);
580 break;
581 }
582 GNUNET_free (attrs_tmp);
583 }
584 else if (attr_delete && (NULL == attr_to_delete))
585 {
586 label = GNUNET_STRINGS_data_to_string_alloc (&attr->id, sizeof(attr->id));
587 if (0 == strcasecmp (attr_delete, label))
588 {
590 &attr->credential,
591 attr->type,
592 attr->data,
593 attr->data_size);
594 attr_to_delete->id = attr->id;
595 }
596 GNUNET_free (label);
597 }
598 else if (list)
599 {
601 attr->data,
602 attr->data_size);
604 id = GNUNET_STRINGS_data_to_string_alloc (&attr->id, sizeof(attr->id));
606 {
607 fprintf (stdout,
608 "%s: ``%s'' (%s); ID: %s\n",
609 attr->name,
610 attr_str,
611 attr_type,
612 id);
613 }
614 else
615 {
616 char *cred_id =
618 sizeof(attr->credential));
619 fprintf (stdout,
620 "%s: ``%s'' in credential presentation `%s' (%s); ID: %s\n",
621 attr->name,
622 attr_str,
623 cred_id,
624 attr_type,
625 id);
626 GNUNET_free (cred_id);
627
628 }
629 GNUNET_free (id);
630 }
632}
633
634
635static void
637{
638 cred_iterator = NULL;
639
640 // Add new credential
641 if ((NULL != credential_name) &&
642 (NULL != attr_value))
643 {
648 ctype,
650 strlen (attr_value));
652 pkey,
656 NULL);
657 return;
658
659 }
661 {
663 return;
664 }
666 pkey,
667 &iter_error,
668 NULL,
669 &iter_cb,
670 NULL,
672 NULL);
673
674}
675
676
677static void
678cred_iter_cb (void *cls,
679 const struct GNUNET_CRYPTO_PublicKey *identity,
680 const struct GNUNET_RECLAIM_Credential *cred)
681{
682 char *cred_str;
683 char *attr_str;
684 char *id;
685 const char *cred_type;
687
689 &cred->id))
692 {
694 cred->data,
695 cred->data_size);
697 id = GNUNET_STRINGS_data_to_string_alloc (&cred->id, sizeof(cred->id));
698 fprintf (stdout,
699 "%s: ``%s'' (%s); ID: %s\n",
700 cred->name,
701 cred_str,
702 cred_type,
703 id);
704 struct GNUNET_RECLAIM_AttributeList *attrs =
706 if (NULL != attrs)
707 {
708 fprintf (stdout,
709 "\t Attributes:\n");
710 for (ale = attrs->list_head; NULL != ale; ale = ale->next)
711 {
713 ale->attribute->type,
714 ale->attribute->data,
715 ale->attribute->data_size);
716 fprintf (stdout,
717 "\t %s: %s\n", ale->attribute->name, attr_str);
718 GNUNET_free (attr_str);
719 }
721 }
722 GNUNET_free (id);
723 }
725}
726
727
728static void
730{
731 if (NULL == pkey)
732 {
733 fprintf (stderr, "Ego %s not found\n", ego_name);
735 return;
736 }
737 if (NULL == credential_type)
740 if (NULL != credential_id)
742 strlen (credential_id),
743 &credential, sizeof(credential));
745 if (list_tickets)
746 {
748 pkey,
750 NULL,
752 NULL,
754 NULL);
755 return;
756 }
757
758 if (NULL != consume_ticket)
759 memcpy (ticket.gns_name, consume_ticket, strlen (consume_ticket) + 1);
760 if (NULL != revoke_ticket)
762 strlen (revoke_ticket),
763 &ticket,
764 sizeof(struct GNUNET_RECLAIM_Ticket));
765
767 claim = NULL;
769 pkey,
770 &iter_error,
771 NULL,
773 NULL,
775 NULL);
776
777}
778
779
780static int init = GNUNET_YES;
781
782static void
783ego_cb (void *cls,
784 struct GNUNET_IDENTITY_Ego *ego,
785 void **ctx,
786 const char *name)
787{
788 if (NULL == name)
789 {
790 if (GNUNET_YES == init)
791 {
792 init = GNUNET_NO;
793 start_process ();
794 }
795 return;
796 }
797 if (0 != strcmp (name, ego_name))
798 return;
800}
801
802
803static void
804run (void *cls,
805 char *const *args,
806 const char *cfgfile,
807 const struct GNUNET_CONFIGURATION_Handle *c)
808{
809 ret = 0;
810 if (NULL == ego_name)
811 {
812 ret = 1;
813 fprintf (stderr, _ ("Ego is required\n"));
814 return;
815 }
816
817 if ((NULL == attr_value) && (NULL != attr_name))
818 {
819 ret = 1;
820 fprintf (stderr, _ ("Attribute value missing!\n"));
821 return;
822 }
823
824 if ((NULL == rp) && (NULL != issue_attrs))
825 {
826 ret = 1;
827 fprintf (stderr, _ ("Requesting party key is required!\n"));
828 return;
829 }
830
832 // Get Ego
834}
835
836
837int
838main (int argc, char *const argv[])
839{
843 "add",
844 "NAME",
846 "Add or update an attribute NAME"),
847 &attr_name),
849 "delete",
850 "ID",
851 gettext_noop ("Delete the attribute with ID"),
852 &attr_delete),
854 "value",
855 "VALUE",
856 gettext_noop ("The attribute VALUE"),
857 &attr_value),
859 "ego",
860 "EGO",
861 gettext_noop ("The EGO to use"),
862 &ego_name),
864 "rp",
865 "RP",
867 "Specify the relying party for issue"),
868 &rp),
870 "rpuri",
871 "RPURI",
873 "Specify the relying party URI for a ticket to consume"),
874 &ex_rp_uri),
876 "dump",
877 gettext_noop ("List attributes for EGO"),
878 &list),
880 "credentials",
881 gettext_noop ("List credentials for EGO"),
884 "credential-id",
885 "CREDENTIAL_ID",
887 "Credential to use for attribute"),
890 "credential-name",
891 "NAME",
892 gettext_noop ("Credential name"),
895 "issue",
896 "A1,A2,...",
898 "Issue a ticket for a set of attributes separated by comma"),
899 &issue_attrs),
901 "consume",
902 "TICKET",
903 gettext_noop ("Consume a ticket"),
906 "revoke",
907 "TICKET",
908 gettext_noop ("Revoke a ticket"),
911 "type",
912 "TYPE",
913 gettext_noop ("Type of attribute"),
914 &type_str),
916 "credential-type",
917 "TYPE",
918 gettext_noop ("Type of credential"),
921 "tickets",
922 gettext_noop ("List tickets of ego"),
923 &list_tickets),
925 "expiration",
926 "INTERVAL",
928 "Expiration interval of the attribute"),
929 &exp_interval),
930
932 };
933 if (GNUNET_OK != GNUNET_PROGRAM_run (argc,
934 argv,
935 "gnunet-reclaim",
936 _ ("re:claimID command line tool"),
937 options,
938 &run,
939 NULL))
940 return 1;
941 else
942 return ret;
943}
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
Definition: 002.c:13
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
#define gettext_noop(String)
Definition: gettext.h:74
static char * data
The data to insert into the dht.
static struct GNUNET_FS_Handle * ctx
static char * name
Name (label) of the records to list.
static struct GNUNET_IDENTITY_Handle * id
Handle to IDENTITY.
static uint32_t type
Type string converted to DNS type value.
static size_t data_size
Number of bytes in data.
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
static void do_cleanup(void *cls)
static void ticket_issue_cb(void *cls, const struct GNUNET_RECLAIM_Ticket *ticket, const struct GNUNET_RECLAIM_PresentationList *presentations)
static struct GNUNET_TIME_Relative exp_interval
Attribute expiration interval.
static void iter_error(void *cls)
struct GNUNET_RECLAIM_Attribute * claim
Claim to store.
static void process_attrs(void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr, const struct GNUNET_RECLAIM_Presentation *presentation)
static int credential_exists
Credential exists.
static void process_delete(void *cls, int success, const char *msg)
static struct GNUNET_RECLAIM_Handle * reclaim_handle
reclaim handle
static void ego_cb(void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *name)
static char * attr_name
The attribute.
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
static char * rp
Relying party.
static struct GNUNET_SCHEDULER_Task * timeout
Timeout task.
static const struct GNUNET_CRYPTO_PrivateKey * pkey
ego private key
static char * credential_type
Credential type.
static void ticket_iter_fin(void *cls)
static void timeout_task(void *cls)
static int list
List attribute flag.
static struct GNUNET_RECLAIM_Attribute * attr_to_delete
Claim object to delete.
static struct GNUNET_RECLAIM_Operation * reclaim_op
reclaim operation
static struct GNUNET_RECLAIM_AttributeIterator * attr_iterator
Attribute iterator.
static void iter_cb(void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr)
static void ticket_iter(void *cls, const struct GNUNET_RECLAIM_Ticket *ticket, const char *rp_uri)
static void ticket_iter_err(void *cls)
static struct GNUNET_RECLAIM_TicketIterator * ticket_iterator
Ticket iterator.
static int ret
return value
static char * attr_value
Attribute value.
static struct GNUNET_SCHEDULER_Task * cleanup_task
Cleanup task.
static char * issue_attrs
Attributes to issue.
static int list_tickets
Ticket listing.
static int init
static char * attr_delete
Claim to delete.
static char * ego_name
Ego name.
static void cred_iter_cb(void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Credential *cred)
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
static char * credential_name
Credential name.
static void process_rvk(void *cls, int success, const char *msg)
static char * consume_ticket
Ticket to consume.
static struct GNUNET_RECLAIM_Identifier credential
Credential ID.
static void start_process()
static void cred_iter_finished(void *cls)
static struct GNUNET_IDENTITY_Handle * identity_handle
Identity handle.
static int list_credentials
List credentials flag.
static struct GNUNET_RECLAIM_AttributeList * attr_list
Attribute list.
static char * revoke_ticket
Ticket to revoke.
static char * type_str
Attribute type.
static char * credential_id
Credential ID string.
static void store_cont(void *cls, int32_t success, const char *emsg)
static void iter_finished(void *cls)
static char * ex_rp_uri
The expected RP URI.
int main(int argc, char *const argv[])
static struct GNUNET_RECLAIM_CredentialIterator * cred_iterator
Credential iterator.
Identity service; implements identity management for GNUnet.
API that can be used to store naming information on a GNUnet node;.
reclaim service; implements identity and personal data sharing for GNUnet
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_relative_time(char shortName, const char *name, const char *argumentHelp, const char *description, struct GNUNET_TIME_Relative *val)
Allow user to specify a struct GNUNET_TIME_Relative (using human-readable "fancy" time).
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_flag(char shortName, const char *name, const char *description, int *val)
Allow user to specify a flag (which internally means setting an integer to 1/GNUNET_YES/GNUNET_OK.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_string(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a string.
const struct GNUNET_CRYPTO_PrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
Definition: identity_api.c:517
struct GNUNET_IDENTITY_Handle * GNUNET_IDENTITY_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_IDENTITY_Callback cb, void *cb_cls)
Connect to the identity service.
Definition: identity_api.c:487
void GNUNET_IDENTITY_disconnect(struct GNUNET_IDENTITY_Handle *h)
Disconnect from identity service.
Definition: identity_api.c:732
@ GNUNET_OK
@ GNUNET_YES
@ GNUNET_NO
@ GNUNET_SYSERR
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration,...
Definition: program.c:400
#define GNUNET_RECLAIM_id_is_equal(a, b)
int GNUNET_RECLAIM_attribute_string_to_value(uint32_t type, const char *s, void **data, size_t *data_size)
Convert human-readable version of a 'claim' of an attribute to the binary representation.
void GNUNET_RECLAIM_attribute_list_destroy(struct GNUNET_RECLAIM_AttributeList *attrs)
Destroy claim list.
char * GNUNET_RECLAIM_credential_value_to_string(uint32_t type, const void *data, size_t data_size)
Convert the 'claim' of an credential to a string.
#define GNUNET_RECLAIM_id_is_zero(a)
const char * GNUNET_RECLAIM_credential_number_to_typename(uint32_t type)
Convert an credential type number to the corresponding credential type string.
struct GNUNET_RECLAIM_AttributeList * GNUNET_RECLAIM_presentation_get_attributes(const struct GNUNET_RECLAIM_Presentation *cred)
static const struct GNUNET_RECLAIM_Identifier GNUNET_RECLAIM_ID_ZERO
struct GNUNET_RECLAIM_AttributeList * GNUNET_RECLAIM_credential_get_attributes(const struct GNUNET_RECLAIM_Credential *cred)
Convert an credential type name to the corresponding number.
GNUNET_RECLAIM_CredentialType
uint32_t GNUNET_RECLAIM_credential_typename_to_number(const char *typename)
Convert an credential type name to the corresponding number.
char * GNUNET_RECLAIM_attribute_value_to_string(uint32_t type, const void *data, size_t data_size)
Convert the 'claim' of an attribute to a string.
struct GNUNET_RECLAIM_Attribute * GNUNET_RECLAIM_attribute_new(const char *attr_name, const struct GNUNET_RECLAIM_Identifier *credential, uint32_t type, const void *data, size_t data_size)
Create a new attribute claim.
const char * GNUNET_RECLAIM_attribute_number_to_typename(uint32_t type)
Convert a type number to the corresponding type string.
uint32_t GNUNET_RECLAIM_attribute_typename_to_number(const char *typename)
Convert a type name to the corresponding number.
struct GNUNET_RECLAIM_Credential * GNUNET_RECLAIM_credential_new(const char *name, uint32_t type, const void *data, size_t data_size)
Create a new credential.
@ GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING
String attribute.
void GNUNET_RECLAIM_disconnect(struct GNUNET_RECLAIM_Handle *h)
Disconnect from identity provider service.
Definition: reclaim_api.c:1150
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:1254
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:1639
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_consume(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_RECLAIM_Ticket *ticket, const char *rp_uri, GNUNET_RECLAIM_AttributeTicketResult cb, void *cb_cls)
Consumes an issued ticket.
Definition: reclaim_api.c:1546
void GNUNET_RECLAIM_cancel(struct GNUNET_RECLAIM_Operation *op)
Cancel an identity provider operation.
Definition: reclaim_api.c:1135
void GNUNET_RECLAIM_get_attributes_stop(struct GNUNET_RECLAIM_AttributeIterator *it)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1398
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:1462
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:1339
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:1690
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:1384
struct GNUNET_RECLAIM_Handle * GNUNET_RECLAIM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the re:claimID service.
Definition: reclaim_api.c:1118
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:1169
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:1213
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_issue(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *iss, const char *rp_uri, const struct GNUNET_RECLAIM_AttributeList *attrs, GNUNET_RECLAIM_IssueTicketCallback cb, void *cb_cls)
Issues a ticket to a relying party.
Definition: reclaim_api.c:1497
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 identities (relying parties)
Definition: reclaim_api.c:1586
void GNUNET_RECLAIM_get_credentials_stop(struct GNUNET_RECLAIM_CredentialIterator *ait)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1477
void GNUNET_RECLAIM_ticket_iteration_stop(struct GNUNET_RECLAIM_TicketIterator *it)
Stops iteration and releases the handle for further calls.
Definition: reclaim_api.c:1659
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:1416
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:981
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
Definition: scheduler.c:1305
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition: scheduler.c:1278
char * GNUNET_STRINGS_data_to_string_alloc(const void *buf, size_t size)
Return the base32crockford encoding of the given buffer.
Definition: strings.c:764
enum GNUNET_GenericReturnValue GNUNET_STRINGS_string_to_data(const char *enc, size_t enclen, void *out, size_t out_size)
Convert CrockfordBase32 encoding back to data.
Definition: strings.c:789
#define GNUNET_TIME_UNIT_HOURS
One hour.
#define GNUNET_TIME_UNIT_SECONDS
One second.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
Definition: time.c:484
#define _(String)
GNU gettext support macro.
Definition: platform.h:178
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
Definition of a command line option.
Handle for an ego.
Definition: identity.h:37
Handle for the service.
Definition: identity_api.c:97
Handle for a attribute iterator operation.
Definition: reclaim_api.c:181
struct GNUNET_RECLAIM_Attribute * attribute
The attribute claim.
struct GNUNET_RECLAIM_AttributeListEntry * next
DLL.
A list of GNUNET_RECLAIM_Attribute structures.
struct GNUNET_RECLAIM_AttributeListEntry * list_tail
List tail.
struct GNUNET_RECLAIM_AttributeListEntry * list_head
List head.
const char * name
The name of the attribute.
struct GNUNET_RECLAIM_Identifier credential
Referenced ID of credential (may be GNUNET_RECLAIM_ID_ZERO if self-creded)
struct GNUNET_RECLAIM_Identifier id
ID.
uint32_t type
Type of Claim.
const void * data
Binary value stored as attribute value.
size_t data_size
Number of bytes in data.
Handle for a credential iterator operation.
Definition: reclaim_api.c:248
uint32_t type
Type/Format of Claim.
const char * name
The name of the credential.
const void * data
Binary value stored as credential value.
size_t data_size
Number of bytes in data.
struct GNUNET_RECLAIM_Identifier id
ID.
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
The authorization ticket.
char gns_name[63 *2+2]
The ticket.
Entry in list of pending tasks.
Definition: scheduler.c:136
Time for relative time used by GNUnet, in microseconds.