LibJWT Dev
The C JSON Web Token Library +JWK +JWKS
jwt.h
Go to the documentation of this file.
1/* Copyright (C) 2015-2024 maClara, LLC <info@maclara-llc.com>
2 This file is part of the JWT C Library
3
4 SPDX-License-Identifier: MPL-2.0
5 This Source Code Form is subject to the terms of the Mozilla Public
6 License, v. 2.0. If a copy of the MPL was not distributed with this
7 file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8
16#ifndef JWT_H
17#define JWT_H
18
19#include <stdio.h>
20#include <time.h>
21
23#ifdef _MSC_VER
24
25 #define DEPR(__msg) __declspec(deprecated)
26
27 #define alloca _alloca
28 #define strcasecmp _stricmp
29 #define strdup _strdup
30
31 #ifdef JWT_DLL_CONFIG
32 #ifdef JWT_BUILD_SHARED_LIBRARY
33 #define JWT_EX __declspec(dllexport)
34 #else
35 #define JWT_EX __declspec(dllimport)
36 #endif
37 #else
38 #define JWT_EX
39 #endif
40
41#else
42
43 #define DEPR(__msg) [[deprecated(__msg)]]
44 #define JWT_EX
45
46#endif
49#ifdef __cplusplus
50extern "C" {
51#endif
52
63typedef struct jwt jwt_t;
64
70typedef struct jwt_valid jwt_valid_t;
71
82typedef struct jwk_set jwk_set_t;
83
118
135
149
162
189
220
242
246typedef void *(*jwt_malloc_t)(size_t);
247
251typedef void *(*jwt_realloc_t)(void *, size_t);
252
256typedef void (*jwt_free_t)(void *);
257
293JWT_EX int jwt_new(jwt_t **jwt);
294
303JWT_EX void jwt_free(jwt_t *jwt);
304
305#if defined(__GNUC__) || defined(__clang__)
309static inline void jwt_freep(jwt_t **jwt) {
310 if (jwt) {
311 jwt_free(*jwt);
312 *jwt = NULL;
313 }
314}
315#define jwt_auto_t jwt_t __attribute__((cleanup(jwt_freep)))
316#endif
317
327JWT_EX jwt_t *jwt_dup(jwt_t *jwt);
328
353typedef struct {
354 union {
355 const void *key;
356 DEPR("use key") const void *jwt_key;
357 };
358 union {
359 size_t key_len;
360 DEPR("use key_len") int jwt_key_len;
361 };
363 void *ctx;
365
375JWT_EX
377
401#define JWT_CONFIG_DECLARE(__name) \
402 jwt_config_t __name = { { NULL }, { 0 }, JWT_ALG_NONE, NULL}
403
410typedef int (*jwt_callback_t)(const jwt_t *, jwt_config_t *);
411
416#define jwt_key_p_t jwt_callback_t
417
421#define jwt_key_t jwt_config_t
445JWT_EX
446int jwt_verify(jwt_t **jwt, const char *token, jwt_config_t *config);
447
465JWT_EX
466int jwt_verify_wcb(jwt_t **jwt, const char *token,
467 jwt_config_t *config, jwt_callback_t cb);
468
480JWT_EX DEPR("Migrate your code to jwt_verify()")
481int jwt_decode(jwt_t **jwt, const char *token,
482 const unsigned char *key, int key_len);
483
494JWT_EX DEPR("Migriate your code to jwt_verify_wcb()")
495int jwt_decode_2(jwt_t **jwt, const char *token,
496 jwt_callback_t cb);
497
526JWT_EX const char *jwt_get_grant(jwt_t *jwt, const char *grant);
527
544JWT_EX long jwt_get_grant_int(jwt_t *jwt, const char *grant);
545
562JWT_EX int jwt_get_grant_bool(jwt_t *jwt, const char *grant);
563
577JWT_EX char *jwt_get_grants_json(jwt_t *jwt, const char *grant);
578
597JWT_EX int jwt_add_grant(jwt_t *jwt, const char *grant, const char *val);
598
616JWT_EX int jwt_add_grant_int(jwt_t *jwt, const char *grant, long val);
617
635JWT_EX int jwt_add_grant_bool(jwt_t *jwt, const char *grant, int val);
636
649JWT_EX int jwt_add_grants_json(jwt_t *jwt, const char *json);
650
663JWT_EX int jwt_del_grants(jwt_t *jwt, const char *grant);
664
693JWT_EX const char *jwt_get_header(jwt_t *jwt, const char *header);
694
711JWT_EX long jwt_get_header_int(jwt_t *jwt, const char *header);
712
729JWT_EX int jwt_get_header_bool(jwt_t *jwt, const char *header);
730
744JWT_EX char *jwt_get_headers_json(jwt_t *jwt, const char *header);
745
764JWT_EX int jwt_add_header(jwt_t *jwt, const char *header, const char *val);
765
783JWT_EX int jwt_add_header_int(jwt_t *jwt, const char *header, long val);
784
802JWT_EX int jwt_add_header_bool(jwt_t *jwt, const char *header, int val);
803
816JWT_EX int jwt_add_headers_json(jwt_t *jwt, const char *json);
817
830JWT_EX int jwt_del_headers(jwt_t *jwt, const char *header);
831
864JWT_EX int jwt_dump_fp(jwt_t *jwt, FILE *fp, int pretty);
865
884JWT_EX char *jwt_dump_str(jwt_t *jwt, int pretty);
885
898JWT_EX char *jwt_dump_grants_str(jwt_t *jwt, int pretty);
899
911JWT_EX int jwt_encode_fp(jwt_t *jwt, FILE *fp);
912
924JWT_EX char *jwt_encode_str(jwt_t *jwt);
925
932JWT_EX void jwt_free_str(char *str);
933
964JWT_EX
965int jwt_set_alg(jwt_t *jwt, jwt_alg_t alg, const unsigned char *key, int len);
966
980JWT_EX jwt_alg_t jwt_get_alg(const jwt_t *jwt);
981
991JWT_EX const char *jwt_alg_str(jwt_alg_t alg);
992
1006JWT_EX jwt_alg_t jwt_str_alg(const char *alg);
1007
1043JWT_EX jwk_set_t *jwks_create(const char *jwk_json_str);
1044
1052JWT_EX int jwks_item_add(jwk_set_t *jwk_set, jwk_item_t *item);
1053
1062JWT_EX int jwks_error(jwk_set_t *jwk_set);
1063
1071JWT_EX int jwks_error_any(jwk_set_t *jwk_set);
1072
1080JWT_EX const char *jwks_error_msg(jwk_set_t *jwk_set);
1081
1099JWT_EX jwk_item_t *jwks_item_get(jwk_set_t *jwk_set, size_t index);
1100
1107JWT_EX void jwks_free(jwk_set_t *jwk_set);
1108
1116JWT_EX int jwks_item_free(jwk_set_t *jwk_set, size_t index);
1117
1125JWT_EX int jwks_item_free_all(jwk_set_t *jwk_set);
1126
1157
1170JWT_EX int jwt_valid_new(jwt_valid_t **jwt_valid, jwt_alg_t alg);
1171
1181JWT_EX void jwt_valid_free(jwt_valid_t *jwt_valid);
1182
1194
1201JWT_EX time_t jwt_valid_get_nbf_leeway(jwt_valid_t *jwt_valid);
1202
1209JWT_EX time_t jwt_valid_get_exp_leeway(jwt_valid_t *jwt_valid);
1210
1224JWT_EX int jwt_valid_add_grant(jwt_valid_t *jwt_valid, const char *grant, const char *val);
1225
1242JWT_EX const char *jwt_valid_get_grant(jwt_valid_t *jwt_valid, const char *grant);
1243
1256JWT_EX int jwt_valid_add_grant_int(jwt_valid_t *jwt_valid, const char *grant, long val);
1257
1274JWT_EX long jwt_valid_get_grant_int(jwt_valid_t *jwt_valid, const char *grant);
1275
1293JWT_EX int jwt_valid_add_grant_bool(jwt_valid_t *jwt_valid, const char *grant, int val);
1294
1311JWT_EX int jwt_valid_get_grant_bool(jwt_valid_t *jwt_valid, const char *grant);
1312
1323JWT_EX int jwt_valid_add_grants_json(jwt_valid_t *jwt_valid, const char *json);
1324
1337JWT_EX char* jwt_valid_get_grants_json(jwt_valid_t *jwt_valid, const char *grant);
1338
1351JWT_EX int jwt_valid_del_grants(jwt_valid_t *jwt_valid, const char *grant);
1352
1363JWT_EX int jwt_valid_set_now(jwt_valid_t *jwt_valid, const time_t now);
1364
1373JWT_EX int jwt_valid_set_nbf_leeway(jwt_valid_t *jwt_valid, const time_t nbf_leeway);
1374
1383JWT_EX int jwt_valid_set_exp_leeway(jwt_valid_t *jwt_valid, const time_t exp_leeway);
1384
1398JWT_EX int jwt_valid_set_headers(jwt_valid_t *jwt_valid, int hdr);
1399
1413JWT_EX char *jwt_exception_str(unsigned int exceptions);
1414
1455JWT_EX int jwt_set_alloc(jwt_malloc_t pmalloc, jwt_realloc_t prealloc,
1456 jwt_free_t pfree);
1457
1465JWT_EX void jwt_get_alloc(jwt_malloc_t *pmalloc, jwt_realloc_t *prealloc,
1466 jwt_free_t *pfree);
1467
1498JWT_EX const char *jwt_get_crypto_ops(void);
1499
1506
1516JWT_EX int jwt_set_crypto_ops(const char *opname);
1517
1527
1534
1545#ifdef __cplusplus
1546}
1547#endif
1548
1549#endif /* JWT_H */
jwk_key_op_t
Allowed key operations for JWK private keys.
Definition jwt.h:177
int jwks_item_add(jwk_set_t *jwk_set, jwk_item_t *item)
Add a jwk_item_t to an existing jwk_set_t.
int jwks_error(jwk_set_t *jwk_set)
Check if there is an error within the jwk_set.
struct jwk_set jwk_set_t
Opaque JWKS object.
Definition jwt.h:82
jwk_set_t * jwks_create(const char *jwk_json_str)
Create a new JWKS object for later use in validating JWTs.
jwk_key_type_t
JWK Key Types.
Definition jwt.h:143
const char * jwks_error_msg(jwk_set_t *jwk_set)
Retrieve an error message from a jwk_set.
int jwks_item_free(jwk_set_t *jwk_set, size_t index)
Free all memory associated with the nth jwt_item_t in a jwk_set.
int jwks_item_free_all(jwk_set_t *jwk_set)
Free all memory associated with alljwt_item_t in a jwk_set.
jwk_pub_key_use_t
Usage types for JWK public keys.
Definition jwt.h:157
int jwks_error_any(jwk_set_t *jwk_set)
Check if there is an error within the jwk_set and any of the jwk_item_t in the set.
void jwks_free(jwk_set_t *jwk_set)
Free all memory associated with a jwt_set_t, including any jwk_item_t in the set.
jwk_item_t * jwks_item_get(jwk_set_t *jwk_set, size_t index)
Return the index'th jwk_item in the jwk_set.
@ JWK_KEY_OP_DERIVE_BITS
Bits derivation.
Definition jwt.h:186
@ JWK_KEY_OP_ENCRYPT
Used for encryption.
Definition jwt.h:181
@ JWK_KEY_OP_WRAP
For wrapping other keys.
Definition jwt.h:183
@ JWK_KEY_OP_UNWRAP
For unwrappng other keys.
Definition jwt.h:184
@ JWK_KEY_OP_VERIFY
Signature verification.
Definition jwt.h:180
@ JWK_KEY_OP_SIGN
Signing.
Definition jwt.h:179
@ JWK_KEY_OP_NONE
No key_op set.
Definition jwt.h:178
@ JWK_KEY_OP_DECRYPT
Used for decrypting.
Definition jwt.h:182
@ JWK_KEY_OP_DERIVE_KEY
Key derivation.
Definition jwt.h:185
@ JWK_KEY_OP_INVALID
Invalid key_ops in JWK.
Definition jwt.h:187
@ JWK_KEY_TYPE_NONE
Unused on valid keys.
Definition jwt.h:144
@ JWK_KEY_TYPE_OKP
Octet Key Pair (e.g.
Definition jwt.h:147
@ JWK_KEY_TYPE_EC
Eliptic Curve keys.
Definition jwt.h:145
@ JWK_KEY_TYPE_RSA
RSA keys (RSA and RSA-PSS)
Definition jwt.h:146
@ JWK_PUB_KEY_USE_SIG
Signature validation (JWS)
Definition jwt.h:159
@ JWK_PUB_KEY_USE_ENC
Decryption key (JWE)
Definition jwt.h:160
@ JWK_PUB_KEY_USE_NONE
No usable attribute was set.
Definition jwt.h:158
jwt_alg_t jwt_get_alg(const jwt_t *jwt)
Get the jwt_alg_t set for this JWT object.
int jwt_set_alg(jwt_t *jwt, jwt_alg_t alg, const unsigned char *key, int len)
Set an algorithm for a jwt_t object.
const char * jwt_alg_str(jwt_alg_t alg)
Convert alg type to it's string representation.
jwt_alg_t jwt_str_alg(const char *alg)
Convert alg string to type.
void jwt_config_init(jwt_config_t *config)
Intialize jwt_config_t to a clean state.
int(* jwt_callback_t)(const jwt_t *, jwt_config_t *)
Callback for operations involving verification of tokens.
Definition jwt.h:410
jwt_alg_t
JWT algorithm types.
Definition jwt.h:100
int jwt_new(jwt_t **jwt)
Allocate a new, empty, JWT object.
struct jwt jwt_t
<
Definition jwt.h:63
jwt_t * jwt_dup(jwt_t *jwt)
Duplicate an existing JWT object.
void jwt_free(jwt_t *jwt)
Free a JWT object and any other resources it is using.
@ JWT_ALG_INVAL
An invalid algorithm from the caller or the token.
Definition jwt.h:116
@ JWT_ALG_NONE
No signature.
Definition jwt.h:101
@ JWT_ALG_PS384
RSASSA-PSS using SHA-384 and MGF1 with SHA-384.
Definition jwt.h:112
@ JWT_ALG_RS384
RSASSA-PKCS1-v1_5 using SHA-384.
Definition jwt.h:106
@ JWT_ALG_HS512
HMAC using SHA-512.
Definition jwt.h:104
@ JWT_ALG_PS512
RSASSA-PSS using SHA-512 and MGF1 with SHA-512.
Definition jwt.h:113
@ JWT_ALG_ES256K
ECDSA using secp256k1 and SHA-256.
Definition jwt.h:114
@ JWT_ALG_ES256
ECDSA using P-256 and SHA-256.
Definition jwt.h:108
@ JWT_ALG_ES512
ECDSA using P-521 and SHA-512.
Definition jwt.h:110
@ JWT_ALG_RS256
RSASSA-PKCS1-v1_5 using SHA-256.
Definition jwt.h:105
@ JWT_ALG_HS256
HMAC using SHA-256.
Definition jwt.h:102
@ JWT_ALG_EDDSA
EdDSA using Ed25519.
Definition jwt.h:115
@ JWT_ALG_RS512
RSASSA-PKCS1-v1_5 using SHA-512.
Definition jwt.h:107
@ JWT_ALG_PS256
RSASSA-PSS using SHA-256 and MGF1 with SHA-256.
Definition jwt.h:111
@ JWT_ALG_ES384
ECDSA using P-384 and SHA-384.
Definition jwt.h:109
@ JWT_ALG_HS384
HMAC using SHA-384.
Definition jwt.h:103
int jwt_set_crypto_ops_t(jwt_crypto_provider_t opname)
Set the crypto operations to a jwt_crypto_provider_t type.
const char * jwt_get_crypto_ops(void)
Retrieve the name of the current crypto operations being used.
jwt_crypto_provider_t jwt_get_crypto_ops_t(void)
Retrieve the type of the current crypto operations being used.
int jwt_set_crypto_ops(const char *opname)
Set the crypto operations to the named set.
jwt_crypto_provider_t
Different providers for crypto operations.
Definition jwt.h:129
int jwt_crypto_ops_supports_jwk(void)
Check if the current crypto operations support JWK usage.
@ JWT_CRYPTO_OPS_NONE
Used for error handling.
Definition jwt.h:130
@ JWT_CRYPTO_OPS_MBEDTLS
MBedTLS embedded library.
Definition jwt.h:133
@ JWT_CRYPTO_OPS_OPENSSL
OpenSSL Library.
Definition jwt.h:131
@ JWT_CRYPTO_OPS_GNUTLS
GnuTLS Library.
Definition jwt.h:132
char * jwt_encode_str(jwt_t *jwt)
Fully encode a JWT object and return as a string.
char * jwt_dump_str(jwt_t *jwt, int pretty)
Return plain text representation as a string.
void jwt_free_str(char *str)
Free a string returned from the library.
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.
int jwt_dump_fp(jwt_t *jwt, FILE *fp, int pretty)
Output plain text representation to a FILE pointer.
int jwt_add_grants_json(jwt_t *jwt, const char *json)
Add grants from a JSON encoded object string.
int jwt_del_grants(jwt_t *jwt, const char *grant)
Delete a grant from this JWT object.
const char * jwt_get_grant(jwt_t *jwt, const char *grant)
Return the value of a string grant.
int jwt_get_grant_bool(jwt_t *jwt, const char *grant)
Return the value of an boolean grant.
int jwt_add_grant(jwt_t *jwt, const char *grant, const char *val)
Add a new string grant to this JWT object.
char * jwt_get_grants_json(jwt_t *jwt, const char *grant)
Return the value of a grant as JSON encoded object string.
int jwt_add_grant_bool(jwt_t *jwt, const char *grant, int val)
Add a new boolean grant to this JWT object.
long jwt_get_grant_int(jwt_t *jwt, const char *grant)
Return the value of an integer grant.
int jwt_add_grant_int(jwt_t *jwt, const char *grant, long val)
Add a new integer grant to this JWT object.
int jwt_add_header(jwt_t *jwt, const char *header, const char *val)
Add a new string header to this JWT object.
int jwt_add_header_int(jwt_t *jwt, const char *header, long val)
Add a new integer header to this JWT object.
int jwt_add_headers_json(jwt_t *jwt, const char *json)
Add headers from a JSON encoded object string.
int jwt_add_header_bool(jwt_t *jwt, const char *header, int val)
Add a new boolean header to this JWT object.
int jwt_get_header_bool(jwt_t *jwt, const char *header)
Return the value of an boolean header.
char * jwt_get_headers_json(jwt_t *jwt, const char *header)
Return the value of a header as JSON encoded object string.
const char * jwt_get_header(jwt_t *jwt, const char *header)
Return the value of a string header.
long jwt_get_header_int(jwt_t *jwt, const char *header)
Return the value of an integer header.
int jwt_del_headers(jwt_t *jwt, const char *header)
Delete a header from this JWT object.
int jwt_set_alloc(jwt_malloc_t pmalloc, jwt_realloc_t prealloc, jwt_free_t pfree)
Set functions to be used for allocating and freeing memory.
void jwt_get_alloc(jwt_malloc_t *pmalloc, jwt_realloc_t *prealloc, jwt_free_t *pfree)
Get functions used for allocating and freeing memory.
void(* jwt_free_t)(void *)
Prototype for free(3)
Definition jwt.h:256
void *(* jwt_malloc_t)(size_t)
Prototype for malloc(3)
Definition jwt.h:246
void *(* jwt_realloc_t)(void *, size_t)
Prototype for realloc(3)
Definition jwt.h:251
const char * jwt_valid_get_grant(jwt_valid_t *jwt_valid, const char *grant)
Return the value of a string required grant.
time_t jwt_valid_get_exp_leeway(jwt_valid_t *jwt_valid)
Return the exp_leeway value set.
jwt_valid_exception_t jwt_valid_get_status(jwt_valid_t *jwt_valid)
Return the status string for the validation object.
int jwt_valid_set_exp_leeway(jwt_valid_t *jwt_valid, const time_t exp_leeway)
Set the exp_leeway value as defined in: https://www.rfc-editor.org/rfc/rfc7519#section-4....
jwt_valid_exception_t jwt_validate(jwt_t *jwt, jwt_valid_t *jwt_valid)
Validate a JWT object with a validation object.
jwt_valid_exception_t
Validation exception types for jwt_t objects.
Definition jwt.h:230
int jwt_valid_add_grant_int(jwt_valid_t *jwt_valid, const char *grant, long val)
Add a new integer grant requirement to this JWT validation object.
int jwt_valid_set_nbf_leeway(jwt_valid_t *jwt_valid, const time_t nbf_leeway)
Set the nbf_leeway value as defined in: https://www.rfc-editor.org/rfc/rfc7519#section-4....
void jwt_valid_free(jwt_valid_t *jwt_valid)
Free a JWT validation object and any other resources it is using.
int jwt_valid_del_grants(jwt_valid_t *jwt_valid, const char *grant)
Delete a grant from this JWT object.
int jwt_valid_add_grants_json(jwt_valid_t *jwt_valid, const char *json)
Add required grants from a JSON encoded object string.
long jwt_valid_get_grant_int(jwt_valid_t *jwt_valid, const char *grant)
Return the value of an integer required grant.
char * jwt_exception_str(unsigned int exceptions)
Parses exceptions and returns a comma delimited and human-readable string.
int jwt_valid_set_headers(jwt_valid_t *jwt_valid, int hdr)
Set validation for replicated claims in headers.
int jwt_valid_add_grant(jwt_valid_t *jwt_valid, const char *grant, const char *val)
Add a new string grant requirement to this JWT validation object.
int jwt_valid_get_grant_bool(jwt_valid_t *jwt_valid, const char *grant)
Return the value of an boolean required grant.
struct jwt_valid jwt_valid_t
Opaque JWT Validation object.
Definition jwt.h:70
char * jwt_valid_get_grants_json(jwt_valid_t *jwt_valid, const char *grant)
Return the value of a grant as JSON encoded object string.
int jwt_valid_set_now(jwt_valid_t *jwt_valid, const time_t now)
Set the time for which expires and not-before claims should be evaluated.
int jwt_valid_new(jwt_valid_t **jwt_valid, jwt_alg_t alg)
Allocate a new, JWT validation object.
int jwt_valid_add_grant_bool(jwt_valid_t *jwt_valid, const char *grant, int val)
Add a new boolean required grant to this JWT validation object.
time_t jwt_valid_get_nbf_leeway(jwt_valid_t *jwt_valid)
Return the nbf_leeway value set.
@ JWT_VALIDATION_ISS_MISMATCH
RFC-7519 Sec 4.1.1 "iss" Issuer
Definition jwt.h:236
@ JWT_VALIDATION_GRANT_MISMATCH
User-defined Grant mismatch
Definition jwt.h:240
@ JWT_VALIDATION_TOO_NEW
RFC-7519 Sec 4.1.5 "nbf" Not Before
Definition jwt.h:235
@ JWT_VALIDATION_EXPIRED
RFC-7519 Sec 4.1.4 "exp" Expired
Definition jwt.h:234
@ JWT_VALIDATION_SUCCESS
Validation succeeded
Definition jwt.h:231
@ JWT_VALIDATION_GRANT_MISSING
User-defined Grant missing
Definition jwt.h:239
@ JWT_VALIDATION_ALG_MISMATCH
RFC-7518 Sec 3.1 "alg" Algorithm
Definition jwt.h:233
@ JWT_VALIDATION_SUB_MISMATCH
RFC-7519 Sec 4.1.2 "sub" Subject
Definition jwt.h:237
@ JWT_VALIDATION_AUD_MISMATCH
RFC-7519 Sec 4.1.3 "aud" Audience
Definition jwt.h:238
@ JWT_VALIDATION_ERROR
General failures
Definition jwt.h:232
int jwt_decode(jwt_t **jwt, const char *token, const unsigned char *key, int key_len)
Decode a JWT.
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_2(jwt_t **jwt, const char *token, jwt_callback_t cb)
Decode a JWT with a user provided callback.
Structural representation of a JWK.
Definition jwt.h:205
size_t bits
The number of bits in the key (may be 0)
Definition jwt.h:212
jwk_key_op_t key_ops
Bitwise flags of "key_ops" supported for this key
Definition jwt.h:216
int is_private_key
Whether this is a public or private key
Definition jwt.h:210
void * provider_data
Internal data used by the provider
Definition jwt.h:209
char * kid
RFC-7517 Sec 4.5
Definition jwt.h:218
jwk_pub_key_use_t use
Value of the JWK "use" attribute
Definition jwt.h:215
jwt_crypto_provider_t provider
Crypto provider that owns this key
Definition jwt.h:208
jwt_alg_t alg
Valid "alg" that this key can be used for
Definition jwt.h:217
jwk_key_type_t kty
The key type of this key
Definition jwt.h:206
int error
Shows there is an error present in this key (unusable)
Definition jwt.h:213
char * pem
If not NULL, contains PEM string of this key
Definition jwt.h:207
Structure used to manage configuration state.
Definition jwt.h:353
size_t key_len
Length of key material
Definition jwt.h:359
const void * key
Pointer to key material.
Definition jwt.h:355