LibJWT Dev
The C JSON Web Token Library +JWK +JWKS
|
Functions | |
int | jwt_verify (jwt_t **jwt, const char *token, jwt_config_t *config) |
Decode and verify a JWT. | |
int | jwt_verify_wcb (jwt_t **jwt, const char *token, jwt_config_t *config, jwt_callback_t cb) |
Decode and verify a JWT, with user callback. | |
int | jwt_decode (jwt_t **jwt, const char *token, const unsigned char *key, int key_len) |
Decode a JWT. | |
int | jwt_decode_2 (jwt_t **jwt, const char *token, jwt_callback_t cb) |
Decode a JWT with a user provided callback. | |
int jwt_decode | ( | jwt_t ** | jwt, |
const char * | token, | ||
const unsigned char * | key, | ||
int | key_len ) |
Decode a JWT.
jwt | Pointer to a JWT object pointer |
token | Pointer to a nil terminated JWT string |
key | Pointer to key |
key_len | The length of the above key. |
int jwt_decode_2 | ( | jwt_t ** | jwt, |
const char * | token, | ||
jwt_callback_t | cb ) |
Decode a JWT with a user provided callback.
jwt | Pointer to a JWT object pointer |
token | Pointer to a nil terminated JWT string |
cb | Pointer to a callback |
int jwt_verify | ( | jwt_t ** | jwt, |
const char * | token, | ||
jwt_config_t * | config ) |
Decode and verify a JWT.
jwt | Pointer to a JWT object pointer |
token | Pointer to a nil terminated JWT string |
config | Pointer to a config structure to define how to verify the token |
int jwt_verify_wcb | ( | jwt_t ** | jwt, |
const char * | token, | ||
jwt_config_t * | config, | ||
jwt_callback_t | cb ) |
Decode and verify a JWT, with user callback.
This operates the same as jwt_verify, with the addition of calling a user defined callback function between the decode and verification step. This allows the user to perform some extra verification, and even provide a key after decoding (e.g. to match a "kid"
).
jwt | Pointer to a JWT object pointer |
token | Pointer to a nil terminated JWT string |
config | Pointer to a config structure to define how to verify the token |
cb | Pointer to a callback |