芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/www/status.pulsehost.co.uk/vendor/web-token/jwt-library/Encryption/JWELoader.php
jweDecrypter; } /** * Returns the header checker manager if set. */ public function getHeaderCheckerManager(): ?HeaderCheckerManager { return $this->headerCheckerManager; } /** * Returns the serializer manager. */ public function getSerializerManager(): JWESerializerManager { return $this->serializerManager; } /** * This method will try to load and decrypt the given token using a JWK. If succeeded, the methods will populate the * $recipient variable and returns the JWE. */ public function loadAndDecryptWithKey(string $token, JWK $key, ?int &$recipient): JWE { $keyset = new JWKSet([$key]); return $this->loadAndDecryptWithKeySet($token, $keyset, $recipient); } /** * This method will try to load and decrypt the given token using a JWKSet. If succeeded, the methods will populate * the $recipient variable and returns the JWE. */ public function loadAndDecryptWithKeySet(string $token, JWKSet $keyset, ?int &$recipient): JWE { try { $jwe = $this->serializerManager->unserialize($token); $nbRecipients = $jwe->countRecipients(); for ($i = 0; $i < $nbRecipients; ++$i) { if ($this->processRecipient($jwe, $keyset, $i)) { $recipient = $i; return $jwe; } } } catch (Throwable) { // Nothing to do. Exception thrown just after } throw new RuntimeException('Unable to load and decrypt the token.'); } private function processRecipient(JWE &$jwe, JWKSet $keyset, int $recipient): bool { try { if ($this->headerCheckerManager !== null) { $this->headerCheckerManager->check($jwe, $recipient); } return $this->jweDecrypter->decryptUsingKeySet($jwe, $keyset, $recipient); } catch (Throwable) { return false; } } }