ILIAS  release_8 Revision v8.24
ClientInterface.php
Go to the documentation of this file.
1<?php
2
20
29{
35 public static function getSupportedAlgorithms(): array;
36
42 public function hasJwt(): bool;
43
49 public function isEncrypted(): bool;
50
57 public function load(string $jwtString, string $privateKey = null): bool;
58
64 public function getJweHeaders(): array;
65
71 public function hasHeader(string $name): bool;
72
79 public function getHeader(string $name, string $defaultValue = null): string;
80
86 public function getHeaders(): array;
87
93 public static function getLastHeaders(): array;
94
100 public function hasClaim(string $name): bool;
101
108 public function getClaim(string $name, string $defaultValue = null);
109
115 public function getPayload(): array;
116
122 public static function getLastPayload(): array;
123
130 public function verify(string $publicKey, string $jku = null): bool;
131
143 public static function sign(
144 array $payload,
145 string $signatureMethod,
146 string $privateKey,
147 string $kid = null,
148 string $jku = null,
149 string $encryptionMethod = null,
150 string $publicKey = null
151 ): string;
152
158 public static function generateKey(string $signatureMethod = 'RS256'): ?string;
159
165 public static function getPublicKey(string $privateKey): string;
166
174 public static function getJWKS(string $pemKey, string $signatureMethod, string $kid): array;
175}
Interface to represent an HWT client.
static sign(array $payload, string $signatureMethod, string $privateKey, string $kid=null, string $jku=null, string $encryptionMethod=null, string $publicKey=null)
Sign the JWT.
hasJwt()
Check if a JWT is defined.
verify(string $publicKey, string $jku=null)
Verify the signature of the JWT.
static getJWKS(string $pemKey, string $signatureMethod, string $kid)
Get the public JWKS from a key in PEM format.
static getPublicKey(string $privateKey)
Get the public key for a private key.
static getSupportedAlgorithms()
Return an array of supported signature algorithms.
getJweHeaders()
Get the value of the JWE headers.
hasClaim(string $name)
Check whether a JWT has a claim with the specified name.
load(string $jwtString, string $privateKey=null)
Load a JWT from a string.
getClaim(string $name, string $defaultValue=null)
Get the value of the claim with the specified name.
isEncrypted()
Check if a JWT's content is encrypted.
hasHeader(string $name)
Check whether a JWT has a header with the specified name.
static getLastPayload()
Get the value of the payload for the last signed JWT (before any encryption).
static getLastHeaders()
Get the value of the headers for the last signed JWT (before any encryption).
getHeader(string $name, string $defaultValue=null)
Get the value of the header with the specified name.
getPayload()
Get the value of the payload.
getHeaders()
Get the value of the headers.
static generateKey(string $signatureMethod='RS256')
Generate a new private key in PEM format.
$privateKey
Definition: ltiregstart.php:68
if(count($parts) !=3) $payload
Definition: ltitoken.php:70
if($format !==null) $name
Definition: metadata.php:247
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $encryptionMethod
Algorithm used for encrypting messages.
Definition: System.php:57
string $jku
Endpoint for public key.
Definition: System.php:95
string $kid
Key ID.
Definition: System.php:88
string $signatureMethod
Method used for signing messages.
Definition: System.php:50