Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
JWK Class Reference

Static Public Member Functions

static parseKey (array $jwk, string $defaultAlg=null)
 Parse a JWK key.
 
static parseKeySet (array $jwks, string $defaultAlg=null)
 Parse a set of JWK keys.
 

Detailed Description

Member Function Documentation

◆ parseKey()

static JWK::parseKey ( array $jwk,
string $defaultAlg = null )
static

Parse a JWK key.

Parameters
array<mixed>$jwk An individual JWK
string$defaultAlgThe algorithm for the Key object if "alg" is not set in the JSON Web Key Set
Return values
KeyThe key object for the JWK
Exceptions
InvalidArgumentExceptionProvided JWK is empty
UnexpectedValueExceptionProvided JWK was invalid
DomainExceptionOpenSSL failure

@uses createPemFromModulusAndExponent

◆ parseKeySet()

static JWK::parseKeySet ( array $jwks,
string $defaultAlg = null )
static

Parse a set of JWK keys.

Parameters
array<mixed>$jwks The JSON Web Key Set as an associative array
string$defaultAlgThe algorithm for the Key object if "alg" is not set in the JSON Web Key Set
Return values
array<string,Key>An associative array of key IDs (kid) to Key objects
Exceptions
InvalidArgumentExceptionProvided JWK Set is empty
UnexpectedValueExceptionProvided JWK Set was invalid
DomainExceptionOpenSSL failure

@uses parseKey


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