GNUnet 0.22.1
plugin_reclaim_credential_jwt.c File Reference

reclaim-credential-plugin-jwt attribute plugin to provide the API for JWT credentials. More...

#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_reclaim_plugin.h"
#include <inttypes.h>
#include <jansson.h>
Include dependency graph for plugin_reclaim_credential_jwt.c:

Go to the source code of this file.

Functions

static char * jwt_value_to_string (void *cls, uint32_t type, const void *data, size_t data_size)
 Convert the 'value' of an credential to a string. More...
 
static int jwt_string_to_value (void *cls, uint32_t type, const char *s, void **data, size_t *data_size)
 Convert human-readable version of a 'value' of an credential to the binary representation. More...
 
static uint32_t jwt_typename_to_number (void *cls, const char *jwt_typename)
 Convert a type name to the corresponding number. More...
 
static const char * jwt_number_to_typename (void *cls, uint32_t type)
 Convert a type number to the corresponding type string (e.g. More...
 
static struct GNUNET_RECLAIM_AttributeListjwt_parse_attributes (void *cls, const char *data, size_t data_size)
 Parse a JWT and return the respective claim value as Attribute. More...
 
static struct GNUNET_RECLAIM_AttributeListjwt_parse_attributes_c (void *cls, const struct GNUNET_RECLAIM_Credential *cred)
 Parse a JWT and return the respective claim value as Attribute. More...
 
static struct GNUNET_RECLAIM_AttributeListjwt_parse_attributes_p (void *cls, const struct GNUNET_RECLAIM_Presentation *cred)
 Parse a JWT and return the respective claim value as Attribute. More...
 
static char * jwt_get_issuer (void *cls, const char *data, size_t data_size)
 Parse a JWT and return the issuer. More...
 
static char * jwt_get_issuer_c (void *cls, const struct GNUNET_RECLAIM_Credential *cred)
 Parse a JWT and return the issuer. More...
 
static char * jwt_get_issuer_p (void *cls, const struct GNUNET_RECLAIM_Presentation *cred)
 Parse a JWT and return the issuer. More...
 
static enum GNUNET_GenericReturnValue jwt_get_expiration (void *cls, const char *data, size_t data_size, struct GNUNET_TIME_Absolute *exp)
 Parse a JWT and return the expiration. More...
 
static enum GNUNET_GenericReturnValue jwt_get_expiration_c (void *cls, const struct GNUNET_RECLAIM_Credential *cred, struct GNUNET_TIME_Absolute *exp)
 Parse a JWT and return the expiration. More...
 
static enum GNUNET_GenericReturnValue jwt_get_expiration_p (void *cls, const struct GNUNET_RECLAIM_Presentation *cred, struct GNUNET_TIME_Absolute *exp)
 Parse a JWT and return the expiration. More...
 
static enum GNUNET_GenericReturnValue jwt_create_presentation (void *cls, const struct GNUNET_RECLAIM_Credential *cred, const struct GNUNET_RECLAIM_AttributeList *attrs, struct GNUNET_RECLAIM_Presentation **presentation)
 
void * libgnunet_plugin_reclaim_credential_jwt_init (void *cls)
 Entry point for the plugin. More...
 
void * libgnunet_plugin_reclaim_credential_jwt_done (void *cls)
 Exit point from the plugin. More...
 

Variables

struct {
   const char *   name
 
   uint32_t   number
 
jwt_cred_name_map []
 Mapping of credential type numbers to human-readable credential type names. More...
 

Detailed Description

reclaim-credential-plugin-jwt attribute plugin to provide the API for JWT credentials.

Author
Martin Schanzenbach

Definition in file plugin_reclaim_credential_jwt.c.

Function Documentation

◆ jwt_value_to_string()

static char * jwt_value_to_string ( void *  cls,
uint32_t  type,
const void *  data,
size_t  data_size 
)
static

Convert the 'value' of an credential to a string.

Parameters
clsclosure, unused
typetype of the credential
datavalue in binary encoding
data_sizenumber of bytes in data
Returns
NULL on error, otherwise human-readable representation of the value

Definition at line 44 of file plugin_reclaim_credential_jwt.c.

48{
49 switch (type)
50 {
53
54 default:
55 return NULL;
56 }
57}
static char * data
The data to insert into the dht.
static uint32_t type
Type string converted to DNS type value.
static size_t data_size
Number of bytes in data.
#define GNUNET_strndup(a, length)
Wrapper around GNUNET_xstrndup_.
@ GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT
A JSON Web Token credential.

References data, data_size, GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT, GNUNET_strndup, and type.

Referenced by libgnunet_plugin_reclaim_credential_jwt_init().

Here is the caller graph for this function:

◆ jwt_string_to_value()

static int jwt_string_to_value ( void *  cls,
uint32_t  type,
const char *  s,
void **  data,
size_t *  data_size 
)
static

Convert human-readable version of a 'value' of an credential to the binary representation.

Parameters
clsclosure, unused
typetype of the credential
shuman-readable string
dataset to value in binary encoding (will be allocated)
data_sizeset to number of bytes in data
Returns
GNUNET_OK on success

Definition at line 72 of file plugin_reclaim_credential_jwt.c.

77{
78 if (NULL == s)
79 return GNUNET_SYSERR;
80 switch (type)
81 {
83 *data = GNUNET_strdup (s);
84 *data_size = strlen (s) + 1;
85 return GNUNET_OK;
86
87 default:
88 return GNUNET_SYSERR;
89 }
90}
@ GNUNET_OK
@ GNUNET_SYSERR
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.

References data, data_size, GNUNET_OK, GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT, GNUNET_strdup, GNUNET_SYSERR, and type.

Referenced by libgnunet_plugin_reclaim_credential_jwt_init().

Here is the caller graph for this function:

◆ jwt_typename_to_number()

static uint32_t jwt_typename_to_number ( void *  cls,
const char *  jwt_typename 
)
static

Convert a type name to the corresponding number.

Parameters
clsclosure, unused
jwt_typenamename to convert
Returns
corresponding number, UINT32_MAX on error

Definition at line 112 of file plugin_reclaim_credential_jwt.c.

113{
114 unsigned int i;
115
116 i = 0;
117 while ((NULL != jwt_cred_name_map[i].name) &&
118 (0 != strcasecmp (jwt_typename, jwt_cred_name_map[i].name)))
119 i++;
120 return jwt_cred_name_map[i].number;
121}
const char * name
static struct @42 jwt_cred_name_map[]
Mapping of credential type numbers to human-readable credential type names.

References jwt_cred_name_map, and name.

Referenced by libgnunet_plugin_reclaim_credential_jwt_init().

Here is the caller graph for this function:

◆ jwt_number_to_typename()

static const char * jwt_number_to_typename ( void *  cls,
uint32_t  type 
)
static

Convert a type number to the corresponding type string (e.g.

1 to "A")

Parameters
clsclosure, unused
typenumber of a type to convert
Returns
corresponding typestring, NULL on error

Definition at line 132 of file plugin_reclaim_credential_jwt.c.

133{
134 unsigned int i;
135
136 i = 0;
137 while ((NULL != jwt_cred_name_map[i].name) && (type !=
139 number))
140 i++;
141 return jwt_cred_name_map[i].name;
142}

References jwt_cred_name_map, name, number, and type.

Referenced by libgnunet_plugin_reclaim_credential_jwt_init().

Here is the caller graph for this function:

◆ jwt_parse_attributes()

static struct GNUNET_RECLAIM_AttributeList * jwt_parse_attributes ( void *  cls,
const char *  data,
size_t  data_size 
)
static

Parse a JWT and return the respective claim value as Attribute.

Parameters
clsthe plugin
credthe jwt credential
Returns
a GNUNET_RECLAIM_Attribute, containing the new value

Definition at line 153 of file plugin_reclaim_credential_jwt.c.

156{
157 struct GNUNET_RECLAIM_AttributeList *attrs;
158 const char *jwt_body;
159 char delim[] = ".";
160 char *jwt_string;
161 char *val_str = NULL;
162 char *decoded_jwt;
163 char *tmp;
164 json_t *json_val;
165 json_error_t json_err;
166
168
169 jwt_string = GNUNET_strndup (data, data_size);
170 jwt_body = strtok (jwt_string, delim);
171 if (NULL == jwt_body)
172 {
174 "Failed to parse JSON %s\n", jwt_string);
175 return attrs;
176 }
177 jwt_body = strtok (NULL, delim);
178 if (NULL == jwt_body)
179 {
181 "Failed to parse JSON %s\n", jwt_string);
182 GNUNET_free (jwt_string);
183 return attrs;
184 }
185 GNUNET_STRINGS_base64url_decode (jwt_body, strlen (jwt_body),
186 (void **) &decoded_jwt);
187 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Decoded JWT: %s\n", decoded_jwt);
188 GNUNET_assert (NULL != decoded_jwt);
189 json_val = json_loads (decoded_jwt, JSON_DECODE_ANY, &json_err);
190 GNUNET_free (decoded_jwt);
191 {
192 const char *key;
193 const char *addr_key;
194 json_t *value;
195 json_t *addr_value;
196
197 json_object_foreach (json_val, key, value) {
198 if (0 == strcmp ("iss", key))
199 continue;
200 if (0 == strcmp ("jti", key))
201 continue;
202 if (0 == strcmp ("exp", key))
203 continue;
204 if (0 == strcmp ("iat", key))
205 continue;
206 if (0 == strcmp ("nbf", key))
207 continue;
208 if (0 == strcmp ("aud", key))
209 continue;
210 if (0 == strcmp ("address", key))
211 {
212 if (! json_is_object (value))
213 {
215 "address claim in wrong format!");
216 continue;
217 }
218 json_object_foreach (value, addr_key, addr_value) {
219 val_str = json_dumps (addr_value, JSON_ENCODE_ANY);
220 tmp = val_str;
221 // Remove leading " from jasson conversion
222 if (tmp[0] == '"')
223 tmp++;
224 // Remove trailing " from jansson conversion
225 if (tmp[strlen (tmp) - 1] == '"')
226 tmp[strlen (tmp) - 1] = '\0';
228 addr_key,
229 NULL,
231 tmp,
232 strlen (val_str));
233 GNUNET_free (val_str);
234 }
235 continue;
236 }
237 val_str = json_dumps (value, JSON_ENCODE_ANY);
238 tmp = val_str;
239 // Remove leading " from jasson conversion
240 if (tmp[0] == '"')
241 tmp++;
242 // Remove trailing " from jansson conversion
243 if (tmp[strlen (tmp) - 1] == '"')
244 tmp[strlen (tmp) - 1] = '\0';
246 key,
247 NULL,
249 tmp,
250 strlen (val_str));
251 GNUNET_free (val_str);
252 }
253 }
254 json_decref (json_val);
255 GNUNET_free (jwt_string);
256 return attrs;
257}
struct GNUNET_HashCode key
The key used in the DHT.
static char * value
Value of the record to add/remove.
#define GNUNET_log(kind,...)
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_RECLAIM_attribute_list_add(struct GNUNET_RECLAIM_AttributeList *attrs, const char *attr_name, const struct GNUNET_RECLAIM_Identifier *credential, uint32_t type, const void *data, size_t data_size)
Add a new attribute to a claim list.
@ GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING
String attribute.
size_t GNUNET_STRINGS_base64url_decode(const char *data, size_t len, void **out)
Decode from Base64url.
Definition: strings.c:1805
A list of GNUNET_RECLAIM_Attribute structures.

References data, data_size, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_new, GNUNET_RECLAIM_attribute_list_add(), GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING, GNUNET_STRINGS_base64url_decode(), GNUNET_strndup, key, and value.

Referenced by jwt_parse_attributes_c(), and jwt_parse_attributes_p().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jwt_parse_attributes_c()

static struct GNUNET_RECLAIM_AttributeList * jwt_parse_attributes_c ( void *  cls,
const struct GNUNET_RECLAIM_Credential cred 
)
static

Parse a JWT and return the respective claim value as Attribute.

Parameters
clsthe plugin
credthe jwt credential
Returns
a GNUNET_RECLAIM_Attribute, containing the new value

Definition at line 268 of file plugin_reclaim_credential_jwt.c.

270{
272 return NULL;
273 return jwt_parse_attributes (cls, cred->data, cred->data_size);
274}
static gnutls_certificate_credentials_t cred
The credential.
static struct GNUNET_RECLAIM_AttributeList * jwt_parse_attributes(void *cls, const char *data, size_t data_size)
Parse a JWT and return the respective claim value as Attribute.

References cred, GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT, and jwt_parse_attributes().

Referenced by libgnunet_plugin_reclaim_credential_jwt_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jwt_parse_attributes_p()

static struct GNUNET_RECLAIM_AttributeList * jwt_parse_attributes_p ( void *  cls,
const struct GNUNET_RECLAIM_Presentation cred 
)
static

Parse a JWT and return the respective claim value as Attribute.

Parameters
clsthe plugin
credthe jwt credential
Returns
a GNUNET_RECLAIM_Attribute, containing the new value

Definition at line 285 of file plugin_reclaim_credential_jwt.c.

287{
289 return NULL;
290 return jwt_parse_attributes (cls, cred->data, cred->data_size);
291}

References cred, GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT, and jwt_parse_attributes().

Referenced by libgnunet_plugin_reclaim_credential_jwt_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jwt_get_issuer()

static char * jwt_get_issuer ( void *  cls,
const char *  data,
size_t  data_size 
)
static

Parse a JWT and return the issuer.

Parameters
clsthe plugin
credthe jwt credential
Returns
a string, containing the isser

Definition at line 302 of file plugin_reclaim_credential_jwt.c.

305{
306 const char *jwt_body;
307 char *jwt_string;
308 char delim[] = ".";
309 char *issuer = NULL;
310 char *decoded_jwt;
311 json_t *issuer_json;
312 json_t *json_val;
313 json_error_t json_err;
314
315 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Parsing JWT attributes.\n");
316 jwt_string = GNUNET_strndup (data, data_size);
317 jwt_body = strtok (jwt_string, delim);
318 jwt_body = strtok (NULL, delim);
319 GNUNET_STRINGS_base64url_decode (jwt_body, strlen (jwt_body),
320 (void **) &decoded_jwt);
321 json_val = json_loads (decoded_jwt, JSON_DECODE_ANY, &json_err);
322 GNUNET_free (decoded_jwt);
323 GNUNET_free (jwt_string);
324 if (NULL == json_val)
325 return NULL;
326 issuer_json = json_object_get (json_val, "iss");
327 if ((NULL == issuer_json) || (! json_is_string (issuer_json)))
328 {
329 json_decref (json_val);
330 return NULL;
331 }
332 issuer = GNUNET_strdup (json_string_value (issuer_json));
333 json_decref (json_val);
334 return issuer;
335}

References data, data_size, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_strdup, GNUNET_STRINGS_base64url_decode(), and GNUNET_strndup.

Referenced by jwt_get_issuer_c(), and jwt_get_issuer_p().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jwt_get_issuer_c()

static char * jwt_get_issuer_c ( void *  cls,
const struct GNUNET_RECLAIM_Credential cred 
)
static

Parse a JWT and return the issuer.

Parameters
clsthe plugin
credthe jwt credential
Returns
a string, containing the isser

Definition at line 346 of file plugin_reclaim_credential_jwt.c.

348{
350 return NULL;
351 return jwt_get_issuer (cls, cred->data, cred->data_size);
352}
static char * jwt_get_issuer(void *cls, const char *data, size_t data_size)
Parse a JWT and return the issuer.

References cred, GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT, and jwt_get_issuer().

Referenced by libgnunet_plugin_reclaim_credential_jwt_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jwt_get_issuer_p()

static char * jwt_get_issuer_p ( void *  cls,
const struct GNUNET_RECLAIM_Presentation cred 
)
static

Parse a JWT and return the issuer.

Parameters
clsthe plugin
credthe jwt credential
Returns
a string, containing the isser

Definition at line 363 of file plugin_reclaim_credential_jwt.c.

365{
367 return NULL;
368 return jwt_get_issuer (cls, cred->data, cred->data_size);
369}

References cred, GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT, and jwt_get_issuer().

Referenced by libgnunet_plugin_reclaim_credential_jwt_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jwt_get_expiration()

static enum GNUNET_GenericReturnValue jwt_get_expiration ( void *  cls,
const char *  data,
size_t  data_size,
struct GNUNET_TIME_Absolute exp 
)
static

Parse a JWT and return the expiration.

Parameters
clsthe plugin
credthe jwt credential
Returns
a string, containing the isser

Definition at line 380 of file plugin_reclaim_credential_jwt.c.

384{
385 const char *jwt_body;
386 char *jwt_string;
387 char delim[] = ".";
388 char *decoded_jwt;
389 json_t *exp_json;
390 json_t *json_val;
391 json_error_t json_err;
392
393 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Parsing JWT attributes.\n");
394 jwt_string = GNUNET_strndup (data, data_size);
395 jwt_body = strtok (jwt_string, delim);
396 jwt_body = strtok (NULL, delim);
397 GNUNET_STRINGS_base64url_decode (jwt_body, strlen (jwt_body),
398 (void **) &decoded_jwt);
399 json_val = json_loads (decoded_jwt, JSON_DECODE_ANY, &json_err);
400 GNUNET_free (decoded_jwt);
401 GNUNET_free (jwt_string);
402 if (NULL == json_val)
403 return GNUNET_SYSERR;
404 exp_json = json_object_get (json_val, "exp");
405 if ((NULL == exp_json) || (! json_is_integer (exp_json)))
406 {
407 json_decref (json_val);
408 return GNUNET_SYSERR;
409 }
410 exp->abs_value_us = json_integer_value (exp_json) * 1000 * 1000;
411 json_decref (json_val);
412 return GNUNET_OK;
413}
uint64_t abs_value_us
The actual value.

References GNUNET_TIME_Absolute::abs_value_us, data, data_size, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_STRINGS_base64url_decode(), GNUNET_strndup, and GNUNET_SYSERR.

Referenced by jwt_get_expiration_c(), and jwt_get_expiration_p().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jwt_get_expiration_c()

static enum GNUNET_GenericReturnValue jwt_get_expiration_c ( void *  cls,
const struct GNUNET_RECLAIM_Credential cred,
struct GNUNET_TIME_Absolute exp 
)
static

Parse a JWT and return the expiration.

Parameters
clsthe plugin
credthe jwt credential
Returns
the expirati

Definition at line 424 of file plugin_reclaim_credential_jwt.c.

427{
429 return GNUNET_NO;
430 return jwt_get_expiration (cls, cred->data, cred->data_size, exp);
431}
@ GNUNET_NO
static enum GNUNET_GenericReturnValue jwt_get_expiration(void *cls, const char *data, size_t data_size, struct GNUNET_TIME_Absolute *exp)
Parse a JWT and return the expiration.

References cred, GNUNET_NO, GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT, and jwt_get_expiration().

Referenced by libgnunet_plugin_reclaim_credential_jwt_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jwt_get_expiration_p()

static enum GNUNET_GenericReturnValue jwt_get_expiration_p ( void *  cls,
const struct GNUNET_RECLAIM_Presentation cred,
struct GNUNET_TIME_Absolute exp 
)
static

Parse a JWT and return the expiration.

Parameters
clsthe plugin
credthe jwt credential
Returns
a string, containing the isser

Definition at line 442 of file plugin_reclaim_credential_jwt.c.

445{
447 return GNUNET_NO;
448 return jwt_get_expiration (cls, cred->data, cred->data_size, exp);
449}

References cred, GNUNET_NO, GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT, and jwt_get_expiration().

Referenced by libgnunet_plugin_reclaim_credential_jwt_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jwt_create_presentation()

static enum GNUNET_GenericReturnValue jwt_create_presentation ( void *  cls,
const struct GNUNET_RECLAIM_Credential cred,
const struct GNUNET_RECLAIM_AttributeList attrs,
struct GNUNET_RECLAIM_Presentation **  presentation 
)
static

Definition at line 453 of file plugin_reclaim_credential_jwt.c.

457{
459 return GNUNET_NO;
460 *presentation = GNUNET_RECLAIM_presentation_new (
462 cred->data,
463 cred->data_size);
464 return GNUNET_OK;
465}
struct GNUNET_RECLAIM_Presentation * GNUNET_RECLAIM_presentation_new(uint32_t type, const void *data, size_t data_size)

References cred, GNUNET_NO, GNUNET_OK, GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT, and GNUNET_RECLAIM_presentation_new().

Referenced by libgnunet_plugin_reclaim_credential_jwt_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ libgnunet_plugin_reclaim_credential_jwt_init()

void * libgnunet_plugin_reclaim_credential_jwt_init ( void *  cls)

Entry point for the plugin.

Parameters
clsNULL
Returns
the exported block API

Definition at line 478 of file plugin_reclaim_credential_jwt.c.

479{
481
498 return api;
499}
static enum GNUNET_GenericReturnValue jwt_create_presentation(void *cls, const struct GNUNET_RECLAIM_Credential *cred, const struct GNUNET_RECLAIM_AttributeList *attrs, struct GNUNET_RECLAIM_Presentation **presentation)
static char * jwt_get_issuer_c(void *cls, const struct GNUNET_RECLAIM_Credential *cred)
Parse a JWT and return the issuer.
static struct GNUNET_RECLAIM_AttributeList * jwt_parse_attributes_c(void *cls, const struct GNUNET_RECLAIM_Credential *cred)
Parse a JWT and return the respective claim value as Attribute.
static char * jwt_get_issuer_p(void *cls, const struct GNUNET_RECLAIM_Presentation *cred)
Parse a JWT and return the issuer.
static char * jwt_value_to_string(void *cls, uint32_t type, const void *data, size_t data_size)
Convert the 'value' of an credential to a string.
static uint32_t jwt_typename_to_number(void *cls, const char *jwt_typename)
Convert a type name to the corresponding number.
static const char * jwt_number_to_typename(void *cls, uint32_t type)
Convert a type number to the corresponding type string (e.g.
static int jwt_string_to_value(void *cls, uint32_t type, const char *s, void **data, size_t *data_size)
Convert human-readable version of a 'value' of an credential to the binary representation.
static enum GNUNET_GenericReturnValue jwt_get_expiration_p(void *cls, const struct GNUNET_RECLAIM_Presentation *cred, struct GNUNET_TIME_Absolute *exp)
Parse a JWT and return the expiration.
static struct GNUNET_RECLAIM_AttributeList * jwt_parse_attributes_p(void *cls, const struct GNUNET_RECLAIM_Presentation *cred)
Parse a JWT and return the respective claim value as Attribute.
static enum GNUNET_GenericReturnValue jwt_get_expiration_c(void *cls, const struct GNUNET_RECLAIM_Credential *cred, struct GNUNET_TIME_Absolute *exp)
Parse a JWT and return the expiration.
Each plugin is required to return a pointer to a struct of this type as the return value from its ent...
GNUNET_RECLAIM_CredentialValueToStringFunction value_to_string
Conversion to string.
GNUNET_RECLAIM_CredentialTypenameToNumberFunction typename_to_number
Typename to number.
GNUNET_RECLAIM_PresentationGetIssuerFunction get_issuer_p
Attesation issuer.
GNUNET_RECLAIM_CredentialNumberToTypenameFunction number_to_typename
Number to typename.
GNUNET_RECLAIM_CredentialGetIssuerFunction get_issuer
Attesation issuer.
GNUNET_RECLAIM_PresentationGetExpirationFunction get_expiration_p
Expiration.
GNUNET_RECLAIM_PresentationValueToStringFunction value_to_string_p
Conversion to string.
GNUNET_RECLAIM_CredentialStringToValueFunction string_to_value
Conversion to binary.
GNUNET_RECLAIM_CredentialGetExpirationFunction get_expiration
Expiration.
GNUNET_RECLAIM_CredentialGetAttributesFunction get_attributes
Attesation attributes.
GNUNET_RECLAIM_PresentationStringToValueFunction string_to_value_p
Conversion to binary.
GNUNET_RECLAIM_PresentationTypenameToNumberFunction typename_to_number_p
Typename to number.
GNUNET_RECLAIM_PresentationNumberToTypenameFunction number_to_typename_p
Number to typename.
GNUNET_RECLAIM_CredentialToPresentation create_presentation
Get presentation.
GNUNET_RECLAIM_PresentationGetAttributesFunction get_attributes_p
Attesation attributes.

References GNUNET_RECLAIM_CredentialPluginFunctions::create_presentation, GNUNET_RECLAIM_CredentialPluginFunctions::get_attributes, GNUNET_RECLAIM_CredentialPluginFunctions::get_attributes_p, GNUNET_RECLAIM_CredentialPluginFunctions::get_expiration, GNUNET_RECLAIM_CredentialPluginFunctions::get_expiration_p, GNUNET_RECLAIM_CredentialPluginFunctions::get_issuer, GNUNET_RECLAIM_CredentialPluginFunctions::get_issuer_p, GNUNET_new, jwt_create_presentation(), jwt_get_expiration_c(), jwt_get_expiration_p(), jwt_get_issuer_c(), jwt_get_issuer_p(), jwt_number_to_typename(), jwt_parse_attributes_c(), jwt_parse_attributes_p(), jwt_string_to_value(), jwt_typename_to_number(), jwt_value_to_string(), GNUNET_RECLAIM_CredentialPluginFunctions::number_to_typename, GNUNET_RECLAIM_CredentialPluginFunctions::number_to_typename_p, GNUNET_RECLAIM_CredentialPluginFunctions::string_to_value, GNUNET_RECLAIM_CredentialPluginFunctions::string_to_value_p, GNUNET_RECLAIM_CredentialPluginFunctions::typename_to_number, GNUNET_RECLAIM_CredentialPluginFunctions::typename_to_number_p, GNUNET_RECLAIM_CredentialPluginFunctions::value_to_string, and GNUNET_RECLAIM_CredentialPluginFunctions::value_to_string_p.

Here is the call graph for this function:

◆ libgnunet_plugin_reclaim_credential_jwt_done()

void * libgnunet_plugin_reclaim_credential_jwt_done ( void *  cls)

Exit point from the plugin.

Parameters
clsthe return value from libgnunet_plugin_block_test_init()
Returns
NULL

Definition at line 512 of file plugin_reclaim_credential_jwt.c.

513{
515
516 GNUNET_free (api);
517 return NULL;
518}
void * cls
Closure for all of the callbacks.

References GNUNET_RECLAIM_CredentialPluginFunctions::cls, and GNUNET_free.

Variable Documentation

◆ name

const char* name

◆ number

uint32_t number

Definition at line 100 of file plugin_reclaim_credential_jwt.c.

Referenced by jwt_number_to_typename().

◆ 

struct { ... } jwt_cred_name_map[]
Initial value:
{ NULL, UINT32_MAX } }

Mapping of credential type numbers to human-readable credential type names.

Referenced by jwt_number_to_typename(), and jwt_typename_to_number().