jwt_object_grp(3)
π jwt_object_grp(3) β the JWT functions page, bestie edition π
okay so this is a page from the Library Functions Manual (that's the 3 in jwt_object_grp(3), iykyk) and it's literally all about the LibJWT object group: the structs, the typedefs, and the six little functions that let you poke at a JWT's header and claims. pull up a chair, we're doing this together π«Ά
β¨ NAME β¨
jwt_object_grp β JWT Functions
like. the JWT functions. the whole squad. periodt.
πΈ SYNOPSIS πΈ
π Data Structures
struct jwt_config_tβ Structure used to pass state with a user callback.
π¦ Typedefs
typedef struct jwt jwt_tβ Opaque JWT object.typedef int(* jwt_callback_t) (jwt_t *, jwt_config_t *)β General callback for generation and verification of JWT.
π Functions
jwt_value_error_t jwt_header_set (jwt_t *jwt, jwt_value_t *value)
Set a value in the header of a JWT.
jwt_value_error_t jwt_header_get (jwt_t *jwt, jwt_value_t *value)
Get a value from the header of a JWT.
jwt_value_error_t jwt_header_del (jwt_t *jwt, const char *header)
Delete a value from the header of a JWT.
jwt_value_error_t jwt_claim_set (jwt_t *jwt, jwt_value_t *value)
Set a value in the claims of a JWT.
jwt_value_error_t jwt_claim_get (jwt_t *jwt, jwt_value_t *value)
Get a value from the claims of a JWT.
jwt_value_error_t jwt_claim_del (jwt_t *jwt, const char *claim)
Delete a value from the claims of a JWT.
π Detailed Description π
okay so here's the tea β β for most usage, setting values in the builder object is enough to provide all the information you would like set in a JWT token. easy. iconic. no notes.
but β and this is the plot twist π«’ β if some information is dynamic, meaning it is only known at the time the token is created, then you can provide this during the builder callback on the jwt_t object. that's the whole point of the callback, bestie. live wiring. real-time vibes. β¨
β οΈ important, no cap: when verifying a token, the checker callback should not modify the jwt_t object at all. like, do not touch. hands off. π
ββοΈ
the reason access to the jwt_t is provided at all is only to allow additional validation beyond LibJWT's internal checks. that's it. that's the assignment. π
π§ Typedef Documentation π§
typedef int(* jwt_callback_t) (jwt_t *, jwt_config_t *)
General callback for generation and verification of JWT.
typedef struct jwt jwt_t
Opaque JWT object. Used in callbacks when generating or verifying a JWT.
π₯ Function Documentation π₯
jwt_value_error_t jwt_claim_del (jwt_t * jwt, const char * claim)
Delete a value from the claims of a JWT. bye girl, we don't need you π
Parameters
jwtβ Pointer to ajwt_ttoken, previously created withjwt_create()claimβ The name of the claim to delete, orNULLto clear all claims
Returns
- A
jwt_value_error_tvalue,JWT_VALUE_ERR_NONEbeing success.
jwt_value_error_t jwt_claim_get (jwt_t * jwt, jwt_value_t * value)
Get a value from the claims of a JWT. reading the receipts π§Ύβ¨
Parameters
jwtβ Pointer to ajwt_ttoken, previously created withjwt_create()valueβ Ajwt_value_tstructure with relevant actions filled in
Returns
- A
jwt_value_error_tvalue,JWT_VALUE_ERR_NONEbeing success. Thevalue.errorfield will match this return value. (yes bestie, they're matching. twin behavior. π―)
jwt_value_error_t jwt_claim_set (jwt_t * jwt, jwt_value_t * value)
Set a value in the claims of a JWT. putting a lil something in there π
Parameters
jwtβ Pointer to ajwt_ttoken, previously created withjwt_create()valueβ Ajwt_value_tstructure with relevant actions filled in
Returns
- A
jwt_value_error_tvalue,JWT_VALUE_ERR_NONEbeing success. Thevalue.errorfield will match this return value.
jwt_value_error_t jwt_header_del (jwt_t * jwt, const char * header)
Delete a value from the header of a JWT. decluttering era π
Parameters
jwtβ Pointer to ajwt_ttoken, previously created withjwt_create()headerβ The name of the header to delete, orNULLto clear the entire header
π«’ passing NULL here wipes the entire header, not just one field. know that before you do it, fr fr.
Returns
- A
jwt_value_error_tvalue,JWT_VALUE_ERR_NONEbeing success.
jwt_value_error_t jwt_header_get (jwt_t * jwt, jwt_value_t * value)
Get a value from the header of a JWT. peeking at the top of the token, respectfully π
Parameters
jwtβ Pointer to ajwt_ttoken, previously created withjwt_create()valueβ Ajwt_value_tstructure with relevant actions filled in
Returns
- A
jwt_value_error_tvalue,JWT_VALUE_ERR_NONEbeing success. Thevalue.errorfield will match this return value.
jwt_value_error_t jwt_header_set (jwt_t * jwt, jwt_value_t * value)
Set a value in the header of a JWT. main character energy, in the header this time π
Parameters
jwtβ Pointer to ajwt_ttoken, previously created withjwt_create()valueβ Ajwt_value_tstructure with relevant actions filled in
Returns
- A
jwt_value_error_tvalue,JWT_VALUE_ERR_NONEbeing success. Thevalue.errorfield will match this return value.
π Author π
Generated automatically by Doxygen for LibJWT from the source code.
(so like, no human wrote this, a robot did. and honestly? slay, doxygen. π€β¨)
and that's the whole page, bestie π mwah. this was LibJWT, Version 3.3.3 β shoutout to the source code for making it all happen, and to jwt_object_grp(3) for being the section we all came here for. go forth and set those claims, but remember: don't modify the jwt_t during verification, or it's giving chaos ππ
π¦ where this page comes from
- ubuntu stonking: libjwt14-doc 3.3.3-1build1 Β· MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms