OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
firebase
/
php-jwt
/
src
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:33:09 AM
rwxr-xr-x
📄
BeforeValidException.php
375 bytes
08/12/2024 10:33:08 AM
rw-r--r--
📄
CachedKeySet.php
7.39 KB
08/12/2024 10:33:09 AM
rw-r--r--
📄
ExpiredException.php
371 bytes
08/12/2024 10:33:09 AM
rw-r--r--
📄
JWK.php
11.89 KB
08/12/2024 10:33:09 AM
rw-r--r--
📄
JWT.php
24.46 KB
08/12/2024 10:33:09 AM
rw-r--r--
📄
JWTExceptionWithPayloadInterface.php
416 bytes
08/12/2024 10:33:09 AM
rw-r--r--
📄
Key.php
1.65 KB
08/12/2024 10:33:09 AM
rw-r--r--
📄
SignatureInvalidException.php
109 bytes
08/12/2024 10:33:09 AM
rw-r--r--
Editing: Key.php
Close
<?php namespace Firebase\JWT; use InvalidArgumentException; use OpenSSLAsymmetricKey; use OpenSSLCertificate; use TypeError; class Key { /** @var string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate */ private $keyMaterial; /** @var string */ private $algorithm; /** * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial * @param string $algorithm */ public function __construct( $keyMaterial, string $algorithm ) { if ( !\is_string($keyMaterial) && !$keyMaterial instanceof OpenSSLAsymmetricKey && !$keyMaterial instanceof OpenSSLCertificate && !\is_resource($keyMaterial) ) { throw new TypeError('Key material must be a string, resource, or OpenSSLAsymmetricKey'); } if (empty($keyMaterial)) { throw new InvalidArgumentException('Key material must not be empty'); } if (empty($algorithm)) { throw new InvalidArgumentException('Algorithm must not be empty'); } // TODO: Remove in PHP 8.0 in favor of class constructor property promotion $this->keyMaterial = $keyMaterial; $this->algorithm = $algorithm; } /** * Return the algorithm valid for this key * * @return string */ public function getAlgorithm(): string { return $this->algorithm; } /** * @return string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate */ public function getKeyMaterial() { return $this->keyMaterial; } }