LibJWT Dev
The C JSON Web Token Library +JWK +JWKS
|
Functions for encoding a valid JWT optionally (but preferably) using JWA operation such as sigining or encryption. More...
Functions | |
int | jwt_dump_fp (jwt_t *jwt, FILE *fp, int pretty) |
Output plain text representation to a FILE pointer. | |
char * | jwt_dump_str (jwt_t *jwt, int pretty) |
Return plain text representation as a string. | |
char * | jwt_dump_grants_str (jwt_t *jwt, int pretty) |
Return plain text representation of grants as a string. | |
int | jwt_encode_fp (jwt_t *jwt, FILE *fp) |
Fully encode a JWT object and write it to FILE. | |
char * | jwt_encode_str (jwt_t *jwt) |
Fully encode a JWT object and return as a string. | |
void | jwt_free_str (char *str) |
Free a string returned from the library. | |
Functions for encoding a valid JWT optionally (but preferably) using JWA operation such as sigining or encryption.
int jwt_dump_fp | ( | jwt_t * | jwt, |
FILE * | fp, | ||
int | pretty ) |
Output plain text representation to a FILE pointer.
This function will write a plain text representation of this JWT object without Base64 encoding. This only writes the header and body, and does not compute the signature or encryption (if such an algorithm were being used).
jwt | Pointer to a JWT object. |
fp | Valid FILE pointer to write data to. |
pretty | Enables better visual formatting of output. Generally only used for debugging. |
char * jwt_dump_grants_str | ( | jwt_t * | jwt, |
int | pretty ) |
Return plain text representation of grants as a string.
Similar to jwt_dump_str() except that only a string containing the grants string is returned. The string must be freed by the caller.
jwt | Pointer to a JWT object. |
pretty | Enables better visual formatting of output. Generally only used for debugging. |
char * jwt_dump_str | ( | jwt_t * | jwt, |
int | pretty ) |
Return plain text representation as a string.
Similar to jwt_dump_fp() except that a string is returned. The string must be freed by the caller.
jwt | Pointer to a JWT object. |
pretty | Enables better visual formatting of output. Generally only used for debugging. |
int jwt_encode_fp | ( | jwt_t * | jwt, |
FILE * | fp ) |
Fully encode a JWT object and write it to FILE.
This will create and write the complete JWT object to FILE. All parts will be Base64 encoded and signatures or encryption will be applied if the algorithm specified requires it.
jwt | Pointer to a JWT object. |
fp | Valid FILE pointer to write data to. |
char * jwt_encode_str | ( | jwt_t * | jwt | ) |
Fully encode a JWT object and return as a string.
Similar to jwt_encode_fp() except that a string is returned. The string must be freed by the caller. If you changed the allocation method using jwt_set_alloc, then you must use jwt_free_str() to free the memory.
jwt | Pointer to a JWT object. |
void jwt_free_str | ( | char * | str | ) |
Free a string returned from the library.
str | Pointer to a string previously created with jwt_encode_str(). |