LibJWT Dev
The C JSON Web Token Library +JWK +JWKS
jwk_item_t Struct Reference

Structural representation of a JWK. More...

#include <jwt.h>

Data Fields

jwk_key_type_t kty
 The key type of this key

 
char * pem
 If not NULL, contains PEM string of this key

 
jwt_crypto_provider_t provider
 Crypto provider that owns this key

 
void * provider_data
 Internal data used by the provider

 
int is_private_key
 Whether this is a public or private key

 
char curve [256]
 Curve name of an "EC" or "OKP" key

 
size_t bits
 The number of bits in the key (may be 0)

 
int error
 Shows there is an error present in this key (unusable)

 
char error_msg [256]
 Descriptive message for jwk_item_t::error

 
jwk_pub_key_use_t use
 Value of the JWK "use" attribute

 
jwk_key_op_t key_ops
 Bitwise flags of "key_ops" supported for this key

 
jwt_alg_t alg
 Valid "alg" that this key can be used for

 
char * kid
  RFC-7517 Sec 4.5

 

Detailed Description

Structural representation of a JWK.

This data structure is produced by importing a JWK or JWKS into a jwk_set_t object. Generally, you would not change any values here and only use this to probe the internal parser and possibly to decide whether a key applies to certain jwt_t for verification or signing.

Remarks
If the jwk_item_t::pem field is not NULL, then it contains a nil terminated string of the key. The underlying crypto algorith may or may not support this. It's provided as a convenience.

Definition at line 205 of file jwt.h.

Field Documentation

◆ alg

jwt_alg_t jwk_item_t::alg

Valid "alg" that this key can be used for

Definition at line 217 of file jwt.h.

◆ bits

size_t jwk_item_t::bits

The number of bits in the key (may be 0)

Definition at line 212 of file jwt.h.

◆ curve

char jwk_item_t::curve[256]

Curve name of an "EC" or "OKP" key

Definition at line 211 of file jwt.h.

◆ error

int jwk_item_t::error

Shows there is an error present in this key (unusable)

Definition at line 213 of file jwt.h.

◆ error_msg

char jwk_item_t::error_msg[256]

Descriptive message for jwk_item_t::error

Definition at line 214 of file jwt.h.

◆ is_private_key

int jwk_item_t::is_private_key

Whether this is a public or private key

Definition at line 210 of file jwt.h.

◆ key_ops

jwk_key_op_t jwk_item_t::key_ops

Bitwise flags of "key_ops" supported for this key

Definition at line 216 of file jwt.h.

◆ kid

char* jwk_item_t::kid

RFC-7517 Sec 4.5

Definition at line 218 of file jwt.h.

◆ kty

jwk_key_type_t jwk_item_t::kty

The key type of this key

Definition at line 206 of file jwt.h.

◆ pem

char* jwk_item_t::pem

If not NULL, contains PEM string of this key

Definition at line 207 of file jwt.h.

◆ provider

jwt_crypto_provider_t jwk_item_t::provider

Crypto provider that owns this key

Definition at line 208 of file jwt.h.

◆ provider_data

void* jwk_item_t::provider_data

Internal data used by the provider

Definition at line 209 of file jwt.h.

◆ use

jwk_pub_key_use_t jwk_item_t::use

Value of the JWK "use" attribute

Definition at line 215 of file jwt.h.


The documentation for this struct was generated from the following file: