jwt_alg_grp(3)
π jwt_alg_grp(3) π
okay bestie so this is a Library Functions Manual page β section 3, the "library functions" section β from LibJWT, and it's literally all about algorithms. like, the entire page. sit down, hydrate, we're doing this. π
β¨ NAME β¨
jwt_alg_grp β Algorithms π¦
β¨ SYNOPSIS β¨
πΈ Enumerations πΈ
enum jwt_alg_t { JWT_ALG_NONE = 0, JWT_ALG_HS256, JWT_ALG_HS384, JWT_ALG_HS512, JWT_ALG_RS256, JWT_ALG_RS384, JWT_ALG_RS512, JWT_ALG_ES256, JWT_ALG_ES384, JWT_ALG_ES512, JWT_ALG_PS256, JWT_ALG_PS384, JWT_ALG_PS512, JWT_ALG_ES256K, JWT_ALG_EDDSA, JWT_ALG_INVAL }
that's the JWT algorithm types one, obvs π
πΈ 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)
β¨ Detailed Description β¨
these are the utility functions whose whole job is converting between the string form and the type form for alg. little translators. tiny bilingual besties. obsessed. π
β¨ Enumeration Type Documentation β¨
π enum jwt_alg_t π
JWT algorithm types. these are literally the supported algorithm types for LibJWT, no cap.
also, for the record: RFC-7518 Sec 3.1 π
and now the Enumerator, one by one, no skipping, we are not that girl:
JWT_ALG_NONEβ no signature at all. bold. brave. πJWT_ALG_HS256β HMAC using SHA-256JWT_ALG_HS384β HMAC using SHA-384JWT_ALG_HS512β HMAC using SHA-512JWT_ALG_RS256β RSASSA-PKCS1-v1_5 using SHA-256JWT_ALG_RS384β RSASSA-PKCS1-v1_5 using SHA-384JWT_ALG_RS512β RSASSA-PKCS1-v1_5 using SHA-512JWT_ALG_ES256β ECDSA using P-256 and SHA-256JWT_ALG_ES384β ECDSA using P-384 and SHA-384JWT_ALG_ES512β ECDSA using P-521 and SHA-512JWT_ALG_PS256β RSASSA-PSS using SHA-256 and MGF1 with SHA-256JWT_ALG_PS384β RSASSA-PSS using SHA-384 and MGF1 with SHA-384JWT_ALG_PS512β RSASSA-PSS using SHA-512 and MGF1 with SHA-512JWT_ALG_ES256Kβ ECDSA using secp256k1 and SHA-256JWT_ALG_EDDSAβ EdDSA using Ed25519JWT_ALG_INVALβ an invalid algorithm from the caller or the token. the "something went wrong somewhere" girlie. π
β¨ Function Documentation β¨
π¦ const char * jwt_alg_str (jwt_alg_t alg) π¦
Convert alg type to it's string representation. it hands you back a string that matches the alg type you gave it.
Parameters
algβ a validjwt_alg_tspecifier. β¨
Returns
it returns a string (e.g. "RS256") matching the alg, or NULL for an invalid alg. so like, if you pass nonsense, you get nothing back. be normal about it. π
π¦ jwt_alg_t jwt_get_alg (const jwt_t * jwt) π¦
Get the jwt_alg_t set for this JWT object. it's giving "what algorithm is this token even using".
Returns the jwt_alg_t type for this JWT object.
Parameters
jwtβ pointer to a JWT object. π
Returns
returns a jwt_alg_t type for this object. that's it, that's the whole thing, periodt. π
π¦ jwt_alg_t jwt_str_alg (const char * alg) π¦
Convert alg string to type. you give it a string, it gives you a type. glow up.
Returns an alg type based on the string representation.
RFC-7518 Sec 3.1 π
Parameters
algβ a valid string for algorithm type (e.g."RS256"). πΈ
Returns
returns a jwt_alg_t matching the string, or JWT_ALG_INVAL if no matches were found. no matches = JWT_ALG_INVAL, remember that.
Note π β this only works for algorithms that LibJWT supports or knows about. so don't come at it with some algorithm it's never heard of, bestie, it will simply not know her.
β¨ Author β¨
Generated automatically by Doxygen for LibJWT from the source code. yes, a robot wrote it. and honestly? she ate. π€β¨
okay that's the whole page, you understood all of it, I'm so proud π«Ά this little manual page came from LibJWT, Version 3.3.3, and it lives under jwt_alg_grp(3) β and bestie, the date line on the footer was just empty, so there's no date to give you, that's not me gatekeeping, there's genuinely nothing there. bye babe, go sign some tokens responsibly πππ¦
π¦ where this page comes from
- ubuntu stonking: libjwt14-doc 3.3.3-1build1 Β· MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms