helper library to manage identity attribute credentials More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_reclaim_plugin.h"
#include "reclaim_credential.h"
Go to the source code of this file.
Data Structures | |
struct | Plugin |
Handle for a plugin. More... | |
Functions | |
static void | add_plugin (void *cls, const char *library_name, void *lib_ret) |
Add a plugin. More... | |
static void | init () |
Load plugins. More... | |
void | __attribute__ ((destructor)) |
Dual function to init(). More... | |
uint32_t | GNUNET_RECLAIM_credential_typename_to_number (const char *typename) |
Convert an credential type name to the corresponding number. More... | |
const char * | GNUNET_RECLAIM_credential_number_to_typename (uint32_t type) |
Convert an credential type number to the corresponding credential type string. More... | |
int | GNUNET_RECLAIM_credential_string_to_value (uint32_t type, const char *s, void **data, size_t *data_size) |
Convert human-readable version of a 'claim' of an credential to the binary representation. More... | |
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. More... | |
struct GNUNET_RECLAIM_Credential * | GNUNET_RECLAIM_credential_new (const char *attr_name, uint32_t type, const void *data, size_t data_size) |
Create a new credential. More... | |
size_t | GNUNET_RECLAIM_credential_list_serialize_get_size (const struct GNUNET_RECLAIM_CredentialList *credentials) |
Get required size for serialization buffer. More... | |
size_t | GNUNET_RECLAIM_credential_list_serialize (const struct GNUNET_RECLAIM_CredentialList *credentials, char *result) |
Serialize a credential list. More... | |
struct GNUNET_RECLAIM_CredentialList * | GNUNET_RECLAIM_credential_list_deserialize (const char *data, size_t data_size) |
Deserialize an attribute list. More... | |
struct GNUNET_RECLAIM_CredentialList * | GNUNET_RECLAIM_credential_list_dup (const struct GNUNET_RECLAIM_CredentialList *al) |
Make a (deep) copy of the credential list. More... | |
void | GNUNET_RECLAIM_credential_list_destroy (struct GNUNET_RECLAIM_CredentialList *credentials) |
Destroy credential list. More... | |
size_t | GNUNET_RECLAIM_credential_serialize_get_size (const struct GNUNET_RECLAIM_Credential *credential) |
Get required size for serialization buffer. More... | |
size_t | GNUNET_RECLAIM_credential_serialize (const struct GNUNET_RECLAIM_Credential *credential, char *result) |
Serialize an credential. More... | |
struct GNUNET_RECLAIM_Credential * | GNUNET_RECLAIM_credential_deserialize (const char *data, size_t data_size) |
Deserialize an credential. More... | |
struct GNUNET_RECLAIM_AttributeList * | GNUNET_RECLAIM_credential_get_attributes (const struct GNUNET_RECLAIM_Credential *credential) |
Convert an credential type name to the corresponding number. More... | |
char * | GNUNET_RECLAIM_credential_get_issuer (const struct GNUNET_RECLAIM_Credential *credential) |
int | GNUNET_RECLAIM_credential_get_expiration (const struct GNUNET_RECLAIM_Credential *credential, struct GNUNET_TIME_Absolute *exp) |
uint32_t | GNUNET_RECLAIM_presentation_typename_to_number (const char *typename) |
Convert an presentation type name to the corresponding number. More... | |
const char * | GNUNET_RECLAIM_presentation_number_to_typename (uint32_t type) |
Convert a presentation type number to the corresponding credential type string. More... | |
int | GNUNET_RECLAIM_presentation_string_to_value (uint32_t type, const char *s, void **data, size_t *data_size) |
Convert human-readable version of a 'claim' of an presentation to the binary representation. More... | |
char * | GNUNET_RECLAIM_presentation_value_to_string (uint32_t type, const void *data, size_t data_size) |
Convert the 'claim' of an presentation to a string. More... | |
struct GNUNET_RECLAIM_Presentation * | GNUNET_RECLAIM_presentation_new (uint32_t type, const void *data, size_t data_size) |
size_t | GNUNET_RECLAIM_presentation_list_serialize_get_size (const struct GNUNET_RECLAIM_PresentationList *presentations) |
Get required size for serialization buffer. More... | |
size_t | GNUNET_RECLAIM_presentation_list_serialize (const struct GNUNET_RECLAIM_PresentationList *presentations, char *result) |
Serialize a presentation list. More... | |
struct GNUNET_RECLAIM_PresentationList * | GNUNET_RECLAIM_presentation_list_deserialize (const char *data, size_t data_size) |
Deserialize an presentation list. More... | |
struct GNUNET_RECLAIM_PresentationList * | GNUNET_RECLAIM_presentation_list_dup (const struct GNUNET_RECLAIM_PresentationList *al) |
Make a (deep) copy of the presentation list. More... | |
void | GNUNET_RECLAIM_presentation_list_destroy (struct GNUNET_RECLAIM_PresentationList *presentations) |
Destroy presentations list. More... | |
size_t | GNUNET_RECLAIM_presentation_serialize_get_size (const struct GNUNET_RECLAIM_Presentation *presentation) |
Get required size for serialization buffer. More... | |
size_t | GNUNET_RECLAIM_presentation_serialize (const struct GNUNET_RECLAIM_Presentation *presentation, char *result) |
Serialize a presentation. More... | |
struct GNUNET_RECLAIM_Presentation * | GNUNET_RECLAIM_presentation_deserialize (const char *data, size_t data_size) |
Deserialize an presentation. More... | |
struct GNUNET_RECLAIM_AttributeList * | GNUNET_RECLAIM_presentation_get_attributes (const struct GNUNET_RECLAIM_Presentation *presentation) |
char * | GNUNET_RECLAIM_presentation_get_issuer (const struct GNUNET_RECLAIM_Presentation *presentation) |
int | GNUNET_RECLAIM_presentation_get_expiration (const struct GNUNET_RECLAIM_Presentation *presentation, struct GNUNET_TIME_Absolute *exp) |
int | GNUNET_RECLAIM_credential_get_presentation (const struct GNUNET_RECLAIM_Credential *cred, const struct GNUNET_RECLAIM_AttributeList *attrs, struct GNUNET_RECLAIM_Presentation **presentation) |
Create a presentation from a credential and a lift of (selected) attributes in the credential. More... | |
Variables | |
static struct Plugin ** | credential_plugins |
Plugins. More... | |
static unsigned int | num_plugins |
Number of plugins. More... | |
static int | initialized |
Init canary. More... | |
helper library to manage identity attribute credentials
Definition in file reclaim_credential.c.
|
static |
Add a plugin.
cls | closure |
library_name | name of the API library |
lib_ret | the plugin API pointer |
Definition at line 75 of file reclaim_credential.c.
References Plugin::api, TestcasePlugin::api, credential_plugins, GNUNET_array_append, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, GNUNET_strdup, Plugin::library_name, TestcasePlugin::library_name, num_plugins, and plugin.
Referenced by init().
|
static |
Load plugins.
Definition at line 94 of file reclaim_credential.c.
References add_plugin(), GNUNET_OS_project_data_default(), GNUNET_PLUGIN_load_all_in_context(), GNUNET_YES, and initialized.
Referenced by GNUNET_RECLAIM_credential_get_attributes(), GNUNET_RECLAIM_credential_get_expiration(), GNUNET_RECLAIM_credential_get_issuer(), GNUNET_RECLAIM_credential_get_presentation(), GNUNET_RECLAIM_credential_number_to_typename(), GNUNET_RECLAIM_credential_string_to_value(), GNUNET_RECLAIM_credential_typename_to_number(), GNUNET_RECLAIM_credential_value_to_string(), GNUNET_RECLAIM_presentation_get_attributes(), GNUNET_RECLAIM_presentation_get_expiration(), GNUNET_RECLAIM_presentation_get_issuer(), GNUNET_RECLAIM_presentation_number_to_typename(), GNUNET_RECLAIM_presentation_string_to_value(), GNUNET_RECLAIM_presentation_typename_to_number(), and GNUNET_RECLAIM_presentation_value_to_string().
void __attribute__ | ( | (destructor) | ) |
Dual function to init().
Definition at line 110 of file reclaim_credential.c.
References TestcasePlugin::api, credential_plugins, GNUNET_break, GNUNET_free, GNUNET_OS_init(), GNUNET_OS_project_data_default(), GNUNET_OS_project_data_get(), GNUNET_PLUGIN_unload(), TestcasePlugin::library_name, num_plugins, and plugin.
struct GNUNET_RECLAIM_CredentialList* GNUNET_RECLAIM_credential_list_dup | ( | const struct GNUNET_RECLAIM_CredentialList * | al | ) |
Make a (deep) copy of the credential list.
attrs | claim list to copy |
Definition at line 369 of file reclaim_credential.c.
References GNUNET_RECLAIM_CredentialListEntry::credential, GNUNET_RECLAIM_Credential::data, GNUNET_RECLAIM_Credential::data_size, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_new, GNUNET_RECLAIM_credential_new(), GNUNET_RECLAIM_Credential::id, GNUNET_RECLAIM_CredentialList::list_head, GNUNET_RECLAIM_Credential::name, GNUNET_RECLAIM_CredentialListEntry::next, result, and GNUNET_RECLAIM_Credential::type.
uint32_t GNUNET_RECLAIM_presentation_typename_to_number | ( | const char * | typename | ) |
Convert an presentation type name to the corresponding number.
typename | name to convert |
Definition at line 577 of file reclaim_credential.c.
References TestcasePlugin::api, credential_plugins, init(), num_plugins, plugin, and ret.
struct GNUNET_RECLAIM_PresentationList* GNUNET_RECLAIM_presentation_list_dup | ( | const struct GNUNET_RECLAIM_PresentationList * | al | ) |
Make a (deep) copy of the presentation list.
attrs | claim list to copy |
Definition at line 792 of file reclaim_credential.c.
References GNUNET_RECLAIM_Presentation::credential_id, GNUNET_RECLAIM_Presentation::data, GNUNET_RECLAIM_Presentation::data_size, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_new, GNUNET_RECLAIM_presentation_new(), GNUNET_RECLAIM_PresentationList::list_head, GNUNET_RECLAIM_PresentationListEntry::next, GNUNET_RECLAIM_PresentationListEntry::presentation, result, and GNUNET_RECLAIM_Presentation::type.
|
static |
Plugins.
Definition at line 52 of file reclaim_credential.c.
Referenced by __attribute__(), add_plugin(), GNUNET_RECLAIM_credential_get_attributes(), GNUNET_RECLAIM_credential_get_expiration(), GNUNET_RECLAIM_credential_get_issuer(), GNUNET_RECLAIM_credential_get_presentation(), GNUNET_RECLAIM_credential_number_to_typename(), GNUNET_RECLAIM_credential_string_to_value(), GNUNET_RECLAIM_credential_typename_to_number(), GNUNET_RECLAIM_credential_value_to_string(), GNUNET_RECLAIM_presentation_get_attributes(), GNUNET_RECLAIM_presentation_get_expiration(), GNUNET_RECLAIM_presentation_get_issuer(), GNUNET_RECLAIM_presentation_number_to_typename(), GNUNET_RECLAIM_presentation_string_to_value(), GNUNET_RECLAIM_presentation_typename_to_number(), and GNUNET_RECLAIM_presentation_value_to_string().
|
static |
Number of plugins.
Definition at line 58 of file reclaim_credential.c.
Referenced by __attribute__(), add_plugin(), GNUNET_RECLAIM_credential_get_attributes(), GNUNET_RECLAIM_credential_get_expiration(), GNUNET_RECLAIM_credential_get_issuer(), GNUNET_RECLAIM_credential_get_presentation(), GNUNET_RECLAIM_credential_number_to_typename(), GNUNET_RECLAIM_credential_string_to_value(), GNUNET_RECLAIM_credential_typename_to_number(), GNUNET_RECLAIM_credential_value_to_string(), GNUNET_RECLAIM_presentation_get_attributes(), GNUNET_RECLAIM_presentation_get_expiration(), GNUNET_RECLAIM_presentation_get_issuer(), GNUNET_RECLAIM_presentation_number_to_typename(), GNUNET_RECLAIM_presentation_string_to_value(), GNUNET_RECLAIM_presentation_typename_to_number(), and GNUNET_RECLAIM_presentation_value_to_string().
|
static |