File manager - Edit - /home/opticamezl/www/newok/Signer.tar
Back
Hmac/Sha384.php 0000644 00000001130 15175507337 0007107 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer\Hmac; use Lcobucci\JWT\Signer\Hmac; /** * Signer for HMAC SHA-384 * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 0.1.0 */ class Sha384 extends Hmac { /** * {@inheritdoc} */ public function getAlgorithmId() { return 'HS384'; } /** * {@inheritdoc} */ public function getAlgorithm() { return 'sha384'; } } Hmac/Sha512.php 0000644 00000001130 15175507337 0007100 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer\Hmac; use Lcobucci\JWT\Signer\Hmac; /** * Signer for HMAC SHA-512 * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 0.1.0 */ class Sha512 extends Hmac { /** * {@inheritdoc} */ public function getAlgorithmId() { return 'HS512'; } /** * {@inheritdoc} */ public function getAlgorithm() { return 'sha512'; } } Hmac/Sha256.php 0000644 00000001130 15175507337 0007105 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer\Hmac; use Lcobucci\JWT\Signer\Hmac; /** * Signer for HMAC SHA-256 * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 0.1.0 */ class Sha256 extends Hmac { /** * {@inheritdoc} */ public function getAlgorithmId() { return 'HS256'; } /** * {@inheritdoc} */ public function getAlgorithm() { return 'sha256'; } } OpenSSL.php 0000644 00000005264 15175507337 0006564 0 ustar 00 <?php namespace Lcobucci\JWT\Signer; use InvalidArgumentException; use function is_resource; use function openssl_error_string; use function openssl_free_key; use function openssl_pkey_get_details; use function openssl_pkey_get_private; use function openssl_pkey_get_public; use function openssl_sign; use function openssl_verify; abstract class OpenSSL extends BaseSigner { public function createHash($payload, Key $key) { $privateKey = $this->getPrivateKey($key->getContent(), $key->getPassphrase()); try { $signature = ''; if (! openssl_sign($payload, $signature, $privateKey, $this->getAlgorithm())) { throw CannotSignPayload::errorHappened(openssl_error_string()); } return $signature; } finally { openssl_free_key($privateKey); } } /** * @param string $pem * @param string $passphrase * * @return resource */ private function getPrivateKey($pem, $passphrase) { $privateKey = openssl_pkey_get_private($pem, $passphrase); $this->validateKey($privateKey); return $privateKey; } /** * @param $expected * @param $payload * @param $key * @return bool */ public function doVerify($expected, $payload, Key $key) { $publicKey = $this->getPublicKey($key->getContent()); $result = openssl_verify($payload, $expected, $publicKey, $this->getAlgorithm()); openssl_free_key($publicKey); return $result === 1; } /** * @param string $pem * * @return resource */ private function getPublicKey($pem) { $publicKey = openssl_pkey_get_public($pem); $this->validateKey($publicKey); return $publicKey; } /** * Raises an exception when the key type is not the expected type * * @param resource|bool $key * * @throws InvalidArgumentException */ private function validateKey($key) { if (! is_resource($key)) { throw InvalidKeyProvided::cannotBeParsed(openssl_error_string()); } $details = openssl_pkey_get_details($key); if (! isset($details['key']) || $details['type'] !== $this->getKeyType()) { throw InvalidKeyProvided::incompatibleKey(); } } /** * Returns the type of key to be used to create/verify the signature (using OpenSSL constants) * * @internal */ abstract public function getKeyType(); /** * Returns which algorithm to be used to create/verify the signature (using OpenSSL constants) * * @internal */ abstract public function getAlgorithm(); } BaseSigner.php 0000644 00000003557 15175507337 0007326 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer; use Lcobucci\JWT\Signature; use Lcobucci\JWT\Signer; use function trigger_error; use const E_USER_DEPRECATED; /** * Base class for signers * * @deprecated This class will be removed on v4 * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 0.1.0 */ abstract class BaseSigner implements Signer { /** * {@inheritdoc} */ public function modifyHeader(array &$headers) { $headers['alg'] = $this->getAlgorithmId(); } /** * {@inheritdoc} */ public function sign($payload, $key) { return new Signature($this->createHash($payload, $this->getKey($key))); } /** * {@inheritdoc} */ public function verify($expected, $payload, $key) { return $this->doVerify($expected, $payload, $this->getKey($key)); } /** * @param Key|string $key * * @return Key */ private function getKey($key) { if (is_string($key)) { trigger_error('Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes.', E_USER_DEPRECATED); $key = new Key($key); } return $key; } /** * Creates a hash with the given data * * @internal * * @param string $payload * @param Key $key * * @return string */ abstract public function createHash($payload, Key $key); /** * Performs the signature verification * * @internal * * @param string $expected * @param string $payload * @param Key $key * * @return boolean */ abstract public function doVerify($expected, $payload, Key $key); } Ecdsa/ConversionFailed.php 0000644 00000001174 15175507337 0011546 0 ustar 00 <?php namespace Lcobucci\JWT\Signer\Ecdsa; use InvalidArgumentException; use Lcobucci\JWT\Exception; final class ConversionFailed extends InvalidArgumentException implements Exception { /** @return self */ public static function invalidLength() { return new self('Invalid signature length.'); } /** @return self */ public static function incorrectStartSequence() { return new self('Invalid data. Should start with a sequence.'); } /** @return self */ public static function integerExpected() { return new self('Invalid data. Should contain an integer.'); } } Ecdsa/Sha512.php 0000644 00000001305 15175507337 0007253 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer\Ecdsa; use Lcobucci\JWT\Signer\Ecdsa; /** * Signer for ECDSA SHA-512 * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 2.1.0 */ class Sha512 extends Ecdsa { /** * {@inheritdoc} */ public function getAlgorithmId() { return 'ES512'; } /** * {@inheritdoc} */ public function getAlgorithm() { return 'sha512'; } /** * {@inheritdoc} */ public function getKeyLength() { return 132; } } Ecdsa/Sha256.php 0000644 00000001304 15175507337 0007257 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer\Ecdsa; use Lcobucci\JWT\Signer\Ecdsa; /** * Signer for ECDSA SHA-256 * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 2.1.0 */ class Sha256 extends Ecdsa { /** * {@inheritdoc} */ public function getAlgorithmId() { return 'ES256'; } /** * {@inheritdoc} */ public function getAlgorithm() { return 'sha256'; } /** * {@inheritdoc} */ public function getKeyLength() { return 64; } } Ecdsa/SignatureConverter.php 0000644 00000001711 15175507337 0012142 0 ustar 00 <?php namespace Lcobucci\JWT\Signer\Ecdsa; /** * Manipulates the result of a ECDSA signature (points R and S) according to the * JWA specs. * * OpenSSL creates a signature using the ASN.1 format and, according the JWA specs, * the signature for JWTs must be the concatenated values of points R and S (in * big-endian octet order). * * @internal * * @see https://tools.ietf.org/html/rfc7518#page-9 * @see https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One */ interface SignatureConverter { /** * Converts the signature generated by OpenSSL into what JWA defines * * @param string $signature * @param int $length * * @return string */ public function fromAsn1($signature, $length); /** * Converts the JWA signature into something OpenSSL understands * * @param string $points * @param int $length * * @return string */ public function toAsn1($points, $length); } Ecdsa/Sha384.php 0000644 00000001304 15175507337 0007261 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer\Ecdsa; use Lcobucci\JWT\Signer\Ecdsa; /** * Signer for ECDSA SHA-384 * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 2.1.0 */ class Sha384 extends Ecdsa { /** * {@inheritdoc} */ public function getAlgorithmId() { return 'ES384'; } /** * {@inheritdoc} */ public function getAlgorithm() { return 'sha384'; } /** * {@inheritdoc} */ public function getKeyLength() { return 96; } } Ecdsa/MultibyteStringConverter.php 0000644 00000010330 15175507337 0013343 0 ustar 00 <?php /* * The MIT License (MIT) * * Copyright (c) 2014-2018 Spomky-Labs * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * * @link https://github.com/web-token/jwt-framework/blob/v1.2/src/Component/Core/Util/ECSignature.php */ namespace Lcobucci\JWT\Signer\Ecdsa; use function bin2hex; use function dechex; use function hex2bin; use function hexdec; use function mb_strlen; use function mb_substr; use function str_pad; use const STR_PAD_LEFT; /** * ECDSA signature converter using ext-mbstring * * @internal */ final class MultibyteStringConverter implements SignatureConverter { const ASN1_SEQUENCE = '30'; const ASN1_INTEGER = '02'; const ASN1_MAX_SINGLE_BYTE = 128; const ASN1_LENGTH_2BYTES = '81'; const ASN1_BIG_INTEGER_LIMIT = '7f'; const ASN1_NEGATIVE_INTEGER = '00'; const BYTE_SIZE = 2; public function toAsn1($signature, $length) { $signature = bin2hex($signature); if (self::octetLength($signature) !== $length) { throw ConversionFailed::invalidLength(); } $pointR = self::preparePositiveInteger(mb_substr($signature, 0, $length, '8bit')); $pointS = self::preparePositiveInteger(mb_substr($signature, $length, null, '8bit')); $lengthR = self::octetLength($pointR); $lengthS = self::octetLength($pointS); $totalLength = $lengthR + $lengthS + self::BYTE_SIZE + self::BYTE_SIZE; $lengthPrefix = $totalLength > self::ASN1_MAX_SINGLE_BYTE ? self::ASN1_LENGTH_2BYTES : ''; $asn1 = hex2bin( self::ASN1_SEQUENCE . $lengthPrefix . dechex($totalLength) . self::ASN1_INTEGER . dechex($lengthR) . $pointR . self::ASN1_INTEGER . dechex($lengthS) . $pointS ); return $asn1; } private static function octetLength($data) { return (int) (mb_strlen($data, '8bit') / self::BYTE_SIZE); } private static function preparePositiveInteger($data) { if (mb_substr($data, 0, self::BYTE_SIZE, '8bit') > self::ASN1_BIG_INTEGER_LIMIT) { return self::ASN1_NEGATIVE_INTEGER . $data; } while (mb_substr($data, 0, self::BYTE_SIZE, '8bit') === self::ASN1_NEGATIVE_INTEGER && mb_substr($data, 2, self::BYTE_SIZE, '8bit') <= self::ASN1_BIG_INTEGER_LIMIT) { $data = mb_substr($data, 2, null, '8bit'); } return $data; } public function fromAsn1($signature, $length) { $message = bin2hex($signature); $position = 0; if (self::readAsn1Content($message, $position, self::BYTE_SIZE) !== self::ASN1_SEQUENCE) { throw ConversionFailed::incorrectStartSequence(); } if (self::readAsn1Content($message, $position, self::BYTE_SIZE) === self::ASN1_LENGTH_2BYTES) { $position += self::BYTE_SIZE; } $pointR = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); $pointS = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); $points = hex2bin(str_pad($pointR, $length, '0', STR_PAD_LEFT) . str_pad($pointS, $length, '0', STR_PAD_LEFT)); return $points; } private static function readAsn1Content($message, &$position, $length) { $content = mb_substr($message, $position, $length, '8bit'); $position += $length; return $content; } private static function readAsn1Integer($message, &$position) { if (self::readAsn1Content($message, $position, self::BYTE_SIZE) !== self::ASN1_INTEGER) { throw ConversionFailed::integerExpected(); } $length = (int) hexdec(self::readAsn1Content($message, $position, self::BYTE_SIZE)); return self::readAsn1Content($message, $position, $length * self::BYTE_SIZE); } private static function retrievePositiveInteger($data) { while (mb_substr($data, 0, self::BYTE_SIZE, '8bit') === self::ASN1_NEGATIVE_INTEGER && mb_substr($data, 2, self::BYTE_SIZE, '8bit') > self::ASN1_BIG_INTEGER_LIMIT) { $data = mb_substr($data, 2, null, '8bit'); } return $data; } } Rsa.php 0000644 00000000744 15175507337 0006024 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer; use const OPENSSL_KEYTYPE_RSA; /** * Base class for RSASSA-PKCS1 signers * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 2.1.0 */ abstract class Rsa extends OpenSSL { final public function getKeyType() { return OPENSSL_KEYTYPE_RSA; } } None.php 0000644 00000000524 15175507337 0006172 0 ustar 00 <?php namespace Lcobucci\JWT\Signer; final class None extends BaseSigner { public function getAlgorithmId() { return 'none'; } public function createHash($payload, Key $key) { return ''; } public function doVerify($expected, $payload, Key $key) { return $expected === ''; } } InvalidKeyProvided.php 0000644 00000001065 15175507337 0011030 0 ustar 00 <?php namespace Lcobucci\JWT\Signer; use InvalidArgumentException; use Lcobucci\JWT\Exception; final class InvalidKeyProvided extends InvalidArgumentException implements Exception { /** * @param string $details * * @return self */ public static function cannotBeParsed($details) { return new self('It was not possible to parse your key, reason: ' . $details); } /** @return self */ public static function incompatibleKey() { return new self('This key is not compatible with this signer'); } } Key.php 0000644 00000004351 15175507337 0006025 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer; use Exception; use InvalidArgumentException; use Lcobucci\JWT\Signer\Key\FileCouldNotBeRead; use SplFileObject; use function strpos; use function substr; /** * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 3.0.4 */ class Key { /** * @var string */ protected $content; /** * @var string */ private $passphrase; /** * @param string $content * @param string $passphrase */ public function __construct($content, $passphrase = '') { $this->setContent($content); $this->passphrase = $passphrase; } /** * @param string $content * * @throws InvalidArgumentException */ private function setContent($content) { if (strpos($content, 'file://') === 0) { $content = $this->readFile($content); } $this->content = $content; } /** * @param string $content * * @return string * * @throws InvalidArgumentException */ private function readFile($content) { $path = substr($content, 7); try { $file = new SplFileObject($path); } catch (Exception $exception) { throw FileCouldNotBeRead::onPath($path, $exception); } $content = ''; while (! $file->eof()) { $content .= $file->fgets(); } return $content; } /** @return string */ public function contents() { return $this->content; } /** @return string */ public function passphrase() { return $this->passphrase; } /** * @deprecated This method is no longer part of the public interface * @see Key::contents() * * @return string */ public function getContent() { return $this->content; } /** * @deprecated This method is no longer part of the public interface * @see Key::passphrase() * * @return string */ public function getPassphrase() { return $this->passphrase; } } Keychain.php 0000644 00000001742 15175507337 0007031 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer; /** * A utilitarian class that encapsulates the retrieval of public and private keys * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 2.1.0 * * @deprecated Since we've removed OpenSSL from ECDSA there's no reason to use this class */ class Keychain { /** * Returns a private key from file path or content * * @param string $key * @param string $passphrase * * @return Key */ public function getPrivateKey($key, $passphrase = null) { return new Key($key, $passphrase); } /** * Returns a public key from file path or content * * @param string $certificate * * @return Key */ public function getPublicKey($certificate) { return new Key($certificate); } } Hmac.php 0000644 00000001671 15175507337 0006147 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer; /** * Base class for hmac signers * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 0.1.0 */ abstract class Hmac extends BaseSigner { /** * {@inheritdoc} */ public function createHash($payload, Key $key) { return hash_hmac($this->getAlgorithm(), $payload, $key->getContent(), true); } /** * {@inheritdoc} */ public function doVerify($expected, $payload, Key $key) { if (!is_string($expected)) { return false; } return hash_equals($expected, $this->createHash($payload, $key)); } /** * Returns the algorithm name * * @internal * * @return string */ abstract public function getAlgorithm(); } Rsa/Sha256.php 0000644 00000001137 15175507337 0006771 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer\Rsa; use Lcobucci\JWT\Signer\Rsa; /** * Signer for RSA SHA-256 * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 2.1.0 */ class Sha256 extends Rsa { /** * {@inheritdoc} */ public function getAlgorithmId() { return 'RS256'; } /** * {@inheritdoc} */ public function getAlgorithm() { return OPENSSL_ALGO_SHA256; } } Rsa/Sha512.php 0000644 00000001137 15175507337 0006764 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer\Rsa; use Lcobucci\JWT\Signer\Rsa; /** * Signer for RSA SHA-512 * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 2.1.0 */ class Sha512 extends Rsa { /** * {@inheritdoc} */ public function getAlgorithmId() { return 'RS512'; } /** * {@inheritdoc} */ public function getAlgorithm() { return OPENSSL_ALGO_SHA512; } } Rsa/Sha384.php 0000644 00000001137 15175507337 0006773 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer\Rsa; use Lcobucci\JWT\Signer\Rsa; /** * Signer for RSA SHA-384 * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 2.1.0 */ class Sha384 extends Rsa { /** * {@inheritdoc} */ public function getAlgorithmId() { return 'RS384'; } /** * {@inheritdoc} */ public function getAlgorithm() { return OPENSSL_ALGO_SHA384; } } Ecdsa.php 0000644 00000003022 15175507337 0006306 0 ustar 00 <?php /** * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS * * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause */ namespace Lcobucci\JWT\Signer; use Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter; use Lcobucci\JWT\Signer\Ecdsa\SignatureConverter; use const OPENSSL_KEYTYPE_EC; /** * Base class for ECDSA signers * * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com> * @since 2.1.0 */ abstract class Ecdsa extends OpenSSL { /** * @var SignatureConverter */ private $converter; public function __construct(SignatureConverter $converter = null) { $this->converter = $converter ?: new MultibyteStringConverter(); } /** * {@inheritdoc} */ public function createHash($payload, Key $key) { return $this->converter->fromAsn1( parent::createHash($payload, $key), $this->getKeyLength() ); } /** * {@inheritdoc} */ public function doVerify($expected, $payload, Key $key) { return parent::doVerify( $this->converter->toAsn1($expected, $this->getKeyLength()), $payload, $key ); } /** * Returns the length of each point in the signature, so that we can calculate and verify R and S points properly * * @internal */ abstract public function getKeyLength(); /** * {@inheritdoc} */ final public function getKeyType() { return OPENSSL_KEYTYPE_EC; } } CannotSignPayload.php 0000644 00000000626 15175507337 0010653 0 ustar 00 <?php namespace Lcobucci\JWT\Signer; use InvalidArgumentException; use Lcobucci\JWT\Exception; final class CannotSignPayload extends InvalidArgumentException implements Exception { /** * @pararm string $error * * @return self */ public static function errorHappened($error) { return new self('There was an error while creating the signature: ' . $error); } } Key/InMemory.php 0000644 00000002104 15175507337 0007556 0 ustar 00 <?php namespace Lcobucci\JWT\Signer\Key; use Lcobucci\JWT\Encoding\CannotDecodeContent; use Lcobucci\JWT\Signer\Key; use function base64_decode; final class InMemory extends Key { /** * @param string $contents * @param string $passphrase * * @return self */ public static function plainText($contents, $passphrase = '') { return new self($contents, $passphrase); } /** * @param string $contents * @param string $passphrase * * @return self */ public static function base64Encoded($contents, $passphrase = '') { $decoded = base64_decode($contents, true); if ($decoded === false) { throw CannotDecodeContent::invalidBase64String(); } return new self($decoded, $passphrase); } /** * @param string $path * @param string $passphrase * * @return InMemory * * @throws FileCouldNotBeRead */ public static function file($path, $passphrase = '') { return new self('file://' . $path, $passphrase); } } Key/LocalFileReference.php 0000644 00000001247 15175507337 0011477 0 ustar 00 <?php namespace Lcobucci\JWT\Signer\Key; use Lcobucci\JWT\Signer\Key; use function file_exists; use function strpos; use function substr; /** @deprecated Use \Lcobucci\JWT\Signer\Key\InMemory::file() instead */ final class LocalFileReference extends Key { const PATH_PREFIX = 'file://'; /** * @param string $path * @param string $passphrase * * @return self * * @throws FileCouldNotBeRead */ public static function file($path, $passphrase = '') { if (strpos($path, self::PATH_PREFIX) === 0) { $path = substr($path, 7); } return new self(self::PATH_PREFIX . $path, $passphrase); } } Key/FileCouldNotBeRead.php 0000644 00000001776 15175507337 0011427 0 ustar 00 <?php namespace Lcobucci\JWT\Signer\Key; use Lcobucci\JWT\Exception; use InvalidArgumentException; if (PHP_MAJOR_VERSION === 7) { final class FileCouldNotBeRead extends InvalidArgumentException implements Exception { /** @return self */ public static function onPath(string $path, \Throwable $cause = null) { return new self( 'The path "' . $path . '" does not contain a valid key file', 0, $cause ); } } } else { final class FileCouldNotBeRead extends InvalidArgumentException implements Exception { /** * @param string $path * @param \Exception|null $cause * * @return self */ public static function onPath($path, \Exception $cause = null) { return new self( 'The path "' . $path . '" does not contain a valid key file', 0, $cause ); } } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0 |
proxy
|
phpinfo
|
Settings