Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
mod_lti\local\ltiopenid\jwks_helper Class Reference

This class exposes functions for LTI 1.3 Key Management. More...

Static Public Member Functions

static fix_jwks_alg (array $jwks, string $jwt)
 Take an array of JWKS keys and infer the 'alg' property for a single key, if missing, based on an input JWT.
 
static get_jwks ()
 Returns the JWK Key Set for this site.
 
static get_private_key ()
 Returns the private key to use to sign outgoing JWT.
 

Detailed Description

This class exposes functions for LTI 1.3 Key Management.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ fix_jwks_alg()

static mod_lti\local\ltiopenid\jwks_helper::fix_jwks_alg ( array $jwks,
string $jwt )
static

Take an array of JWKS keys and infer the 'alg' property for a single key, if missing, based on an input JWT.

This only sets the 'alg' property for a single key when all the following conditions are met:

  • The key's 'kid' matches the 'kid' provided in the JWT's header.
  • The key's 'alg' is missing.
  • The JWT's header 'alg' matches the algorithm family of the key (the key's kty).
  • The JWT's header 'alg' matches one of the approved LTI asymmetric algorithms.

Keys not matching the above are left unchanged.

Parameters
array$jwksthe keyset array.
string$jwtthe JWT string.
Return values
arraythe fixed keyset array.

◆ get_jwks()

static mod_lti\local\ltiopenid\jwks_helper::get_jwks ( )
static

Returns the JWK Key Set for this site.

Return values
arraykeyset exposting the site public key.

◆ get_private_key()

static mod_lti\local\ltiopenid\jwks_helper::get_private_key ( )
static

Returns the private key to use to sign outgoing JWT.

Return values
arraykeys are kid and key in PEM format.

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