ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
Firebase\JWT\Key Class Reference
+ Collaboration diagram for Firebase\JWT\Key:

Public Member Functions

 __construct ( $keyMaterial, string $algorithm)
 
 getAlgorithm ()
 Return the algorithm valid for this key. More...
 
 getKeyMaterial ()
 

Private Attributes

 $keyMaterial
 
string $algorithm
 

Detailed Description

Definition at line 10 of file Key.php.

Constructor & Destructor Documentation

◆ __construct()

Firebase\JWT\Key::__construct (   $keyMaterial,
string  $algorithm 
)
Parameters
string | resource | OpenSSLAsymmetricKey | OpenSSLCertificate$keyMaterial
string$algorithm

Definition at line 21 of file Key.php.

References Firebase\JWT\Key\$algorithm, and Firebase\JWT\Key\$keyMaterial.

24  {
25  if (
26  !\is_string($keyMaterial)
27  && !$keyMaterial instanceof OpenSSLAsymmetricKey
28  && !$keyMaterial instanceof OpenSSLCertificate
29  && !\is_resource($keyMaterial)
30  ) {
31  throw new TypeError('Key material must be a string, resource, or OpenSSLAsymmetricKey');
32  }
33 
34  if (empty($keyMaterial)) {
35  throw new InvalidArgumentException('Key material must not be empty');
36  }
37 
38  if (empty($algorithm)) {
39  throw new InvalidArgumentException('Algorithm must not be empty');
40  }
41 
42  // TODO: Remove in PHP 8.0 in favor of class constructor property promotion
43  $this->keyMaterial = $keyMaterial;
44  $this->algorithm = $algorithm;
45  }
string $algorithm
Definition: Key.php:15

Member Function Documentation

◆ getAlgorithm()

Firebase\JWT\Key::getAlgorithm ( )

Return the algorithm valid for this key.

Returns
string

Definition at line 52 of file Key.php.

References Firebase\JWT\Key\$algorithm.

52  : string
53  {
54  return $this->algorithm;
55  }
string $algorithm
Definition: Key.php:15

◆ getKeyMaterial()

Firebase\JWT\Key::getKeyMaterial ( )
Returns
string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate

Definition at line 60 of file Key.php.

References Firebase\JWT\Key\$keyMaterial.

61  {
62  return $this->keyMaterial;
63  }

Field Documentation

◆ $algorithm

string Firebase\JWT\Key::$algorithm
private

Definition at line 15 of file Key.php.

Referenced by Firebase\JWT\Key\__construct(), and Firebase\JWT\Key\getAlgorithm().

◆ $keyMaterial

Firebase\JWT\Key::$keyMaterial
private

Definition at line 13 of file Key.php.

Referenced by Firebase\JWT\Key\__construct(), and Firebase\JWT\Key\getKeyMaterial().


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