GNUnet 0.22.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
33
37static int ret;
38
42static int list;
43
48
52static char *credential_id;
53
57static char *ex_rp_uri;
58
63
67static char *credential_name;
68
72static char *credential_type;
73
78
82static char *rp;
83
87static char *attr_name;
88
92static char *attr_value;
93
97static char *issue_attrs;
98
102static char *consume_ticket;
103
107static char *type_str;
108
112static char *revoke_ticket;
113
117static int list_tickets;
118
122static char *ego_name;
123
128
133
138
143
148
149
154
155
159static const struct GNUNET_CRYPTO_PrivateKey *pkey;
160
165
170
175
180
185
190
194static char *attr_delete;
195
200
201static void
202do_cleanup (void *cls)
203{
204 cleanup_task = NULL;
205 if (NULL != timeout)
207 if (NULL != reclaim_op)
209 if (NULL != attr_iterator)
211 if (NULL != cred_iterator)
213 if (NULL != ticket_iterator)
215 if (NULL != reclaim_handle)
217 if (NULL != identity_handle)
219 if (NULL != attr_list)
220 {
222 attr_list = NULL;
223 }
224 if (NULL != attr_to_delete)
226 if (NULL == credential_type)
228}
229
230
231static void
233 const struct GNUNET_RECLAIM_Ticket *iss_ticket,
234 const struct GNUNET_RECLAIM_PresentationList *presentations)
235{
236 reclaim_op = NULL;
237 if (NULL != iss_ticket)
238 {
239 printf ("%s\n", iss_ticket->gns_name);
240 }
242}
243
244
245static void
246store_cont (void *cls, int32_t success, const char *emsg)
247{
248 reclaim_op = NULL;
249 if (GNUNET_SYSERR == success)
250 {
251 fprintf (stderr, "%s\n", emsg);
252 }
254}
255
256
257static void
258process_attrs (void *cls,
259 const struct GNUNET_CRYPTO_PublicKey *identity,
260 const struct GNUNET_RECLAIM_Attribute *attr,
261 const struct GNUNET_RECLAIM_Presentation *presentation)
262{
263 char *value_str;
264 char *id;
265 const char *attr_type;
266
267 if (NULL == identity)
268 {
269 reclaim_op = NULL;
271 return;
272 }
273 if (NULL == attr)
274 {
275 ret = 1;
276 return;
277 }
279 id = GNUNET_STRINGS_data_to_string_alloc (&attr->id, sizeof(attr->id));
280 value_str = NULL;
281 if (NULL == presentation)
282 {
284 attr->data,
285 attr->data_size);
286 }
287 else
288 {
292
293 for (ale = al->list_head; NULL != ale; ale = ale->next)
294 {
295 if (0 != strncmp (attr->data, ale->attribute->name, attr->data_size))
296 continue;
297 value_str
299 ale->attribute->data,
300 ale->attribute->data_size);
301 break;
302 }
303 }
304 fprintf (stdout,
305 "Name: %s; Value: %s (%s); Flag %u; ID: %s %s\n",
306 attr->name,
307 (NULL != value_str) ? value_str : "???",
308 attr_type,
309 attr->flag,
310 id,
311 (NULL == presentation) ? "" : "(ATTESTED)");
312 GNUNET_free (value_str);
313 GNUNET_free (id);
314}
315
316
317static void
319{
320 ticket_iterator = NULL;
321 fprintf (stderr, "Failed to iterate over tickets\n");
323}
324
325
326static void
328{
329 ticket_iterator = NULL;
331}
332
333
334static void
335ticket_iter (void *cls, const struct GNUNET_RECLAIM_Ticket *tkt, const char*
336 rp_uri)
337{
338 fprintf (stdout, "Ticket: %s | RP URI: %s\n", tkt->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,
653 cred,
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 struct GNUNET_RECLAIM_AttributeList *attrs;
688
690 &cred->id))
693 {
695 cred->data,
696 cred->data_size);
698 id = GNUNET_STRINGS_data_to_string_alloc (&cred->id, sizeof(cred->id));
699 fprintf (stdout,
700 "%s: ``%s'' (%s); ID: %s\n",
701 cred->name,
702 cred_str,
703 cred_type,
704 id);
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{
842 "add",
843 "NAME",
845 "Add or update an attribute NAME"),
846 &attr_name),
848 "delete",
849 "ID",
850 gettext_noop ("Delete the attribute with ID"),
851 &attr_delete),
853 "value",
854 "VALUE",
855 gettext_noop ("The attribute VALUE"),
856 &attr_value),
858 "ego",
859 "EGO",
860 gettext_noop ("The EGO to use"),
861 &ego_name),
863 "rp",
864 "RP",
866 "Specify the relying party for issue"),
867 &rp),
869 "rpuri",
870 "RPURI",
872 "Specify the relying party URI for a ticket to consume"),
873 &ex_rp_uri),
875 "dump",
876 gettext_noop ("List attributes for EGO"),
877 &list),
879 "credentials",
880 gettext_noop ("List credentials for EGO"),
883 "credential-id",
884 "CREDENTIAL_ID",
886 "Credential to use for attribute"),
889 "credential-name",
890 "NAME",
891 gettext_noop ("Credential name"),
894 "issue",
895 "A1,A2,...",
897 "Issue a ticket for a set of attributes separated by comma"),
898 &issue_attrs),
900 "consume",
901 "TICKET",
902 gettext_noop ("Consume a ticket"),
905 "revoke",
906 "TICKET",
907 gettext_noop ("Revoke a ticket"),
910 "type",
911 "TYPE",
912 gettext_noop ("Type of attribute"),
913 &type_str),
915 "credential-type",
916 "TYPE",
917 gettext_noop ("Type of credential"),
920 "tickets",
921 gettext_noop ("List tickets of ego"),
922 &list_tickets),
924 "expiration",
925 "INTERVAL",
927 "Expiration interval of the attribute"),
928 &exp_interval),
929
931 };
933 if (GNUNET_OK !=
935 argc,
936 argv,
937 "gnunet-reclaim",
938 _ ("re:claimID command line tool"),
939 options,
940 &run,
941 NULL))
942 return 1;
943 else
944 return ret;
945}
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 gnutls_certificate_credentials_t cred
The credential.
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 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_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 ticket_iter(void *cls, const struct GNUNET_RECLAIM_Ticket *tkt, const char *rp_uri)
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 ticket_issue_cb(void *cls, const struct GNUNET_RECLAIM_Ticket *iss_ticket, const struct GNUNET_RECLAIM_PresentationList *presentations)
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.
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.
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(const struct GNUNET_OS_ProjectData *pd, 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:407
#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:980
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:1304
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:1277
char * GNUNET_STRINGS_data_to_string_alloc(const void *buf, size_t size)
Return the base32crockford encoding of the given buffer.
Definition: strings.c:787
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:812
#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:486
#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
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.