237 if (NULL != iss_ticket)
239 printf (
"%s\n", iss_ticket->
gns_name);
251 fprintf (stderr,
"%s\n", emsg);
265 const char *attr_type;
281 if (NULL == presentation)
305 "Name: %s; Value: %s (%s); Flag %u; ID: %s %s\n",
307 (NULL != value_str) ? value_str :
"???",
311 (NULL == presentation) ?
"" :
"(ATTESTED)");
321 fprintf (stderr,
"Failed to iterate over tickets\n");
338 fprintf (stdout,
"Ticket: %s | RP URI: %s\n", tkt->
gns_name, rp_uri);
348 fprintf (stderr,
"Failed\n");
359 fprintf (stderr,
"Timeout\n");
371 fprintf (stderr,
"Revocation failed.\n");
384 fprintf (stderr,
"Deletion failed.\n");
411 attr_str = strtok (attrs_tmp,
",");
412 while (NULL != attr_str)
425 fprintf (stdout,
"No such attribute ``%s''\n", attr_str);
428 attr_str = strtok (NULL,
",");
431 if (NULL != attr_str)
438 fprintf (stdout,
"No RP URI provided\n");
454 fprintf (stderr,
"Expected an RP URI to consume ticket\n");
482 fprintf (stdout,
"No such attribute ``%s''\n",
attr_delete);
544 const char *attr_type;
561 attr_str = strtok (attrs_tmp,
",");
562 while (NULL != attr_str)
564 if (0 != strcasecmp (attr_str, attr->
name))
566 attr_str = strtok (NULL,
",");
608 "%s: ``%s'' (%s); ID: %s\n",
620 "%s: ``%s'' in credential presentation `%s' (%s); ID: %s\n",
685 const char *cred_type;
700 "%s: ``%s'' (%s); ID: %s\n",
733 fprintf (stderr,
"Ego %s not found\n",
ego_name);
813 fprintf (stderr,
_ (
"Ego is required\n"));
820 fprintf (stderr,
_ (
"Attribute value missing!\n"));
827 fprintf (stderr,
_ (
"Requesting party key is required!\n"));
838main (
int argc,
char *
const argv[])
845 "Add or update an attribute NAME"),
866 "Specify the relying party for issue"),
872 "Specify the relying party URI for a ticket to consume"),
886 "Credential to use for attribute"),
897 "Issue a ticket for a set of attributes separated by comma"),
927 "Expiration interval of the attribute"),
938 _ (
"re:claimID command line tool"),
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
struct GNUNET_GETOPT_CommandLineOption options[]
struct GNUNET_MessageHeader * msg
#define gettext_noop(String)
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 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.
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.
void GNUNET_IDENTITY_disconnect(struct GNUNET_IDENTITY_Handle *h)
Disconnect from identity service.
#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,...
#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.
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.
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.
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.
void GNUNET_RECLAIM_cancel(struct GNUNET_RECLAIM_Operation *op)
Cancel an identity provider operation.
void GNUNET_RECLAIM_get_attributes_stop(struct GNUNET_RECLAIM_AttributeIterator *it)
Stops iteration and releases the handle for further calls.
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.
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.
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.
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.
struct GNUNET_RECLAIM_Handle * GNUNET_RECLAIM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the re:claimID service.
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.
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.
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.
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)
void GNUNET_RECLAIM_get_credentials_stop(struct GNUNET_RECLAIM_CredentialIterator *ait)
Stops iteration and releases the handle for further calls.
void GNUNET_RECLAIM_ticket_iteration_stop(struct GNUNET_RECLAIM_TicketIterator *it)
Stops iteration and releases the handle for further calls.
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.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
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.
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.
char * GNUNET_STRINGS_data_to_string_alloc(const void *buf, size_t size)
Return the base32crockford encoding of the given buffer.
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.
#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.
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
Definition of a command line option.
Handle for a attribute iterator operation.
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.
A reclaim identifier FIXME maybe put this in a different namespace.
Handle for an operation with the service.
A list of GNUNET_RECLAIM_Presentation structures.
A credential presentation.
Handle for a ticket iterator operation.
The authorization ticket.
char gns_name[63 *2+2]
The ticket.
Entry in list of pending tasks.
Time for relative time used by GNUnet, in microseconds.