Scroll to navigation

jwt_alg_grp(3) Library Functions Manual jwt_alg_grp(3)

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 }
JWT algorithm types.

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

Utility functions to convert between string and type for alg

Enumeration Type Documentation

enum jwt_alg_t

JWT algorithm types. These are the supported algorithm types for LibJWT.

RFC-7518 Sec 3.1

Enumerator

No signature
HMAC using SHA-256
HMAC using SHA-384
HMAC using SHA-512
RSASSA-PKCS1-v1_5 using SHA-256
RSASSA-PKCS1-v1_5 using SHA-384
RSASSA-PKCS1-v1_5 using SHA-512
ECDSA using P-256 and SHA-256
ECDSA using P-384 and SHA-384
ECDSA using P-521 and SHA-512
RSASSA-PSS using SHA-256 and MGF1 with SHA-256
RSASSA-PSS using SHA-384 and MGF1 with SHA-384
RSASSA-PSS using SHA-512 and MGF1 with SHA-512
ECDSA using secp256k1 and SHA-256
EdDSA using Ed25519
An invalid algorithm from the caller or the token

Function Documentation

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.

Parameters

alg A valid jwt_alg_t specifier.

Returns

Returns a string (e.g. 'RS256') matching the alg or NULL for invalid alg.

jwt_alg_t jwt_get_alg (const jwt_t * jwt)

Get the jwt_alg_t set for this JWT object.

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.

jwt_alg_t jwt_str_alg (const char * alg)

Convert alg string to type.

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.

Note

This only works for algorithms that LibJWT supports or knows about.

Author

Generated automatically by Doxygen for LibJWT from the source code.

Version 3.2.2 LibJWT