|
LibJWT 3.5.0
The C JSON Web Token Library +JWK +JWKS
|
Convert between algorithm types and their string names. More...
Functions | |
| jwt_alg_t | jwt_get_alg (const jwt_t *jwt) |
| const char * | jwt_alg_str (jwt_alg_t alg) |
| jwt_alg_t | jwt_str_alg (const char *alg) |
| const char * | jwe_alg_str (jwe_key_alg_t alg) |
| jwe_key_alg_t | jwe_str_alg (const char *alg) |
| const char * | jwe_enc_str (jwe_enc_t enc) |
| jwe_enc_t | jwe_str_enc (const char *enc) |
Convert between algorithm types and their string names.
Utility functions to convert between string and type for alg
| enum jwe_enc_t |
JWE content encryption algorithm types.
These are the supported JWE "enc" (content encryption) algorithm types for LibJWT. They determine the authenticated encryption applied to the plaintext using the CEK.
| enum jwe_key_alg_t |
JWE key management algorithm types.
These are the supported JWE "alg" (key management) algorithm types for LibJWT. They determine how the Content Encryption Key (CEK) is produced for or recovered from a recipient. They are intentionally a separate type from jwt_alg_t (which is JWS/signing only); the "alg" values used in JWE and JWS are not the same.
| enum jwe_serialization_t |
JWE serialization formats.
RFC 7516 defines two serializations. The Compact Serialization is the five-part header.encrypted_key.iv.ciphertext.tag string and supports a single recipient. The JSON Serialization is a JSON object; its Flattened form is the single-recipient special case, and its General form carries a recipients array for one or more recipients.
| Enumerator | |
|---|---|
| JWE_FORMAT_COMPACT | RFC-7516 Sec 7.1 Compact Serialization (default) |
| JWE_FORMAT_JSON_FLAT | RFC-7516 Sec 7.2.2 Flattened JSON Serialization |
| JWE_FORMAT_JSON_GENERAL | RFC-7516 Sec 7.2.1 General JSON Serialization |
| enum jwt_alg_t |
JWT algorithm types.
These are the supported algorithm types for LibJWT.
| const char * jwe_alg_str | ( | jwe_key_alg_t | alg | ) |
Convert a JWE key management alg type to its string representation.
| alg | A valid jwe_key_alg_t specifier. |
| const char * jwe_enc_str | ( | jwe_enc_t | enc | ) |
Convert a JWE content encryption enc type to its string representation.
| enc | A valid jwe_enc_t specifier. |
| jwe_key_alg_t jwe_str_alg | ( | const char * | alg | ) |
Convert a JWE key management alg string to type.
| alg | A valid string for a JWE key management algorithm (e.g. "A128KW"). |
| jwe_enc_t jwe_str_enc | ( | const char * | enc | ) |
Convert a JWE content encryption enc string to type.
| enc | A valid string for a JWE content encryption algorithm (e.g. "A256GCM"). |
| const char * jwt_alg_str | ( | jwt_alg_t | alg | ) |
Convert alg type to it's string representation.
Returns a string that matches the alg type provided.
| alg | A valid jwt_alg_t specifier. |
| jwt_alg_t jwt_str_alg | ( | const char * | alg | ) |
Convert alg string to type.
Returns an alg type based on the string representation.
| alg | A valid string for algorithm type (e.g. "RS256"). |