jwt_alg_grp(3)

πŸ“¦
version 3.3.3 Β· 2 versions
, in ubuntu stonking

πŸ’– 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-256
  • JWT_ALG_HS384 β€” HMAC using SHA-384
  • JWT_ALG_HS512 β€” HMAC using SHA-512
  • JWT_ALG_RS256 β€” RSASSA-PKCS1-v1_5 using SHA-256
  • JWT_ALG_RS384 β€” RSASSA-PKCS1-v1_5 using SHA-384
  • JWT_ALG_RS512 β€” RSASSA-PKCS1-v1_5 using SHA-512
  • JWT_ALG_ES256 β€” ECDSA using P-256 and SHA-256
  • JWT_ALG_ES384 β€” ECDSA using P-384 and SHA-384
  • JWT_ALG_ES512 β€” ECDSA using P-521 and SHA-512
  • JWT_ALG_PS256 β€” RSASSA-PSS using SHA-256 and MGF1 with SHA-256
  • JWT_ALG_PS384 β€” RSASSA-PSS using SHA-384 and MGF1 with SHA-384
  • JWT_ALG_PS512 β€” RSASSA-PSS using SHA-512 and MGF1 with SHA-512
  • JWT_ALG_ES256K β€” ECDSA using secp256k1 and SHA-256
  • JWT_ALG_EDDSA β€” EdDSA using Ed25519
  • JWT_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 valid jwt_alg_t specifier. ✨

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