Laravel version update
Laravel version update
This commit is contained in:
320
vendor/lcobucci/jwt/test/functional/EcdsaTokenTest.php
vendored
Normal file
320
vendor/lcobucci/jwt/test/functional/EcdsaTokenTest.php
vendored
Normal file
@@ -0,0 +1,320 @@
|
||||
<?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\FunctionalTests;
|
||||
|
||||
use Lcobucci\JWT\Builder;
|
||||
use Lcobucci\JWT\Parser;
|
||||
use Lcobucci\JWT\Signer\Key;
|
||||
use Lcobucci\JWT\Token;
|
||||
use Lcobucci\JWT\Signature;
|
||||
use Lcobucci\JWT\Signer\Ecdsa\Sha256;
|
||||
use Lcobucci\JWT\Signer\Ecdsa\Sha512;
|
||||
use Lcobucci\JWT\Signer\Keychain;
|
||||
use Lcobucci\JWT\Keys;
|
||||
|
||||
/**
|
||||
* @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
|
||||
* @since 2.1.0
|
||||
*/
|
||||
class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
use Keys;
|
||||
|
||||
/**
|
||||
* @var Sha256
|
||||
*/
|
||||
private $signer;
|
||||
|
||||
/**
|
||||
* @before
|
||||
*/
|
||||
public function createSigner()
|
||||
{
|
||||
$this->signer = new Sha256();
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @expectedException \InvalidArgumentException
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
|
||||
*/
|
||||
public function builderShouldRaiseExceptionWhenKeyIsInvalid()
|
||||
{
|
||||
$user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
|
||||
|
||||
(new Builder())->setId(1)
|
||||
->setAudience('http://client.abc.com')
|
||||
->setIssuer('http://api.abc.com')
|
||||
->set('user', $user)
|
||||
->sign($this->signer, new Key('testing'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @expectedException \InvalidArgumentException
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
|
||||
*/
|
||||
public function builderShouldRaiseExceptionWhenKeyIsNotEcdsaCompatible()
|
||||
{
|
||||
$user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
|
||||
|
||||
(new Builder())->setId(1)
|
||||
->setAudience('http://client.abc.com')
|
||||
->setIssuer('http://api.abc.com')
|
||||
->set('user', $user)
|
||||
->sign($this->signer, static::$rsaKeys['private']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
|
||||
*/
|
||||
public function builderCanGenerateAToken()
|
||||
{
|
||||
$user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
|
||||
|
||||
$token = (new Builder())->setId(1)
|
||||
->setAudience('http://client.abc.com')
|
||||
->setIssuer('http://api.abc.com')
|
||||
->set('user', $user)
|
||||
->setHeader('jki', '1234')
|
||||
->sign($this->signer, static::$ecdsaKeys['private'])
|
||||
->getToken();
|
||||
|
||||
$this->assertAttributeInstanceOf(Signature::class, 'signature', $token);
|
||||
$this->assertEquals('1234', $token->getHeader('jki'));
|
||||
$this->assertEquals('http://client.abc.com', $token->getClaim('aud'));
|
||||
$this->assertEquals('http://api.abc.com', $token->getClaim('iss'));
|
||||
$this->assertEquals($user, $token->getClaim('user'));
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Parsing\Decoder
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
|
||||
*/
|
||||
public function parserCanReadAToken(Token $generated)
|
||||
{
|
||||
$read = (new Parser())->parse((string) $generated);
|
||||
|
||||
$this->assertEquals($generated, $read);
|
||||
$this->assertEquals('testing', $read->getClaim('user')->name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
|
||||
*/
|
||||
public function verifyShouldReturnFalseWhenKeyIsNotRight(Token $token)
|
||||
{
|
||||
$this->assertFalse($token->verify($this->signer, static::$ecdsaKeys['public2']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\Sha512
|
||||
*/
|
||||
public function verifyShouldReturnFalseWhenAlgorithmIsDifferent(Token $token)
|
||||
{
|
||||
$this->assertFalse($token->verify(new Sha512(), static::$ecdsaKeys['public1']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @expectedException \RuntimeException
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
|
||||
*/
|
||||
public function verifyShouldRaiseExceptionWhenKeyIsNotEcdsaCompatible(Token $token)
|
||||
{
|
||||
$this->assertFalse($token->verify($this->signer, static::$rsaKeys['public']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
|
||||
*/
|
||||
public function verifyShouldReturnTrueWhenKeyIsRight(Token $token)
|
||||
{
|
||||
$this->assertTrue($token->verify($this->signer, static::$ecdsaKeys['public1']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
|
||||
*/
|
||||
public function everythingShouldWorkWithAKeyWithParams()
|
||||
{
|
||||
$user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
|
||||
|
||||
$token = (new Builder())->setId(1)
|
||||
->setAudience('http://client.abc.com')
|
||||
->setIssuer('http://api.abc.com')
|
||||
->set('user', $user)
|
||||
->setHeader('jki', '1234')
|
||||
->sign($this->signer, static::$ecdsaKeys['private-params'])
|
||||
->getToken();
|
||||
|
||||
$this->assertTrue($token->verify($this->signer, static::$ecdsaKeys['public-params']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
|
||||
* @covers Lcobucci\JWT\Signer\Ecdsa\Sha512
|
||||
* @covers Lcobucci\JWT\Signer\Keychain
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Parsing\Decoder
|
||||
*/
|
||||
public function everythingShouldWorkWhenUsingATokenGeneratedByOtherLibs()
|
||||
{
|
||||
$data = 'eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJoZWxsbyI6IndvcmxkIn0.'
|
||||
. 'AQx1MqdTni6KuzfOoedg2-7NUiwe-b88SWbdmviz40GTwrM0Mybp1i1tVtm'
|
||||
. 'TSQ91oEXGXBdtwsN6yalzP9J-sp2YATX_Tv4h-BednbdSvYxZsYnUoZ--ZU'
|
||||
. 'dL10t7g8Yt3y9hdY_diOjIptcha6ajX8yzkDGYG42iSe3f5LywSuD6FO5c';
|
||||
|
||||
$key = '-----BEGIN PUBLIC KEY-----' . PHP_EOL
|
||||
. 'MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQAcpkss6wI7PPlxj3t7A1RqMH3nvL4' . PHP_EOL
|
||||
. 'L5Tzxze/XeeYZnHqxiX+gle70DlGRMqqOq+PJ6RYX7vK0PJFdiAIXlyPQq0B3KaU' . PHP_EOL
|
||||
. 'e86IvFeQSFrJdCc0K8NfiH2G1loIk3fiR+YLqlXk6FAeKtpXJKxR1pCQCAM+vBCs' . PHP_EOL
|
||||
. 'mZudf1zCUZ8/4eodlHU=' . PHP_EOL
|
||||
. '-----END PUBLIC KEY-----';
|
||||
|
||||
$keychain = new Keychain();
|
||||
$token = (new Parser())->parse((string) $data);
|
||||
|
||||
$this->assertEquals('world', $token->getClaim('hello'));
|
||||
$this->assertTrue($token->verify(new Sha512(), $keychain->getPublicKey($key)));
|
||||
}
|
||||
}
|
||||
186
vendor/lcobucci/jwt/test/functional/HmacTokenTest.php
vendored
Normal file
186
vendor/lcobucci/jwt/test/functional/HmacTokenTest.php
vendored
Normal file
@@ -0,0 +1,186 @@
|
||||
<?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\FunctionalTests;
|
||||
|
||||
use Lcobucci\JWT\Builder;
|
||||
use Lcobucci\JWT\Parser;
|
||||
use Lcobucci\JWT\Token;
|
||||
use Lcobucci\JWT\Signature;
|
||||
use Lcobucci\JWT\Signer\Hmac\Sha256;
|
||||
use Lcobucci\JWT\Signer\Hmac\Sha512;
|
||||
|
||||
/**
|
||||
* @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
|
||||
* @since 2.1.0
|
||||
*/
|
||||
class HmacTokenTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var Sha256
|
||||
*/
|
||||
private $signer;
|
||||
|
||||
/**
|
||||
* @before
|
||||
*/
|
||||
public function createSigner()
|
||||
{
|
||||
$this->signer = new Sha256();
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Hmac
|
||||
* @covers Lcobucci\JWT\Signer\Hmac\Sha256
|
||||
*/
|
||||
public function builderCanGenerateAToken()
|
||||
{
|
||||
$user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
|
||||
|
||||
$token = (new Builder())->setId(1)
|
||||
->setAudience('http://client.abc.com')
|
||||
->setIssuer('http://api.abc.com')
|
||||
->set('user', $user)
|
||||
->setHeader('jki', '1234')
|
||||
->sign($this->signer, 'testing')
|
||||
->getToken();
|
||||
|
||||
$this->assertAttributeInstanceOf(Signature::class, 'signature', $token);
|
||||
$this->assertEquals('1234', $token->getHeader('jki'));
|
||||
$this->assertEquals('http://client.abc.com', $token->getClaim('aud'));
|
||||
$this->assertEquals('http://api.abc.com', $token->getClaim('iss'));
|
||||
$this->assertEquals($user, $token->getClaim('user'));
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Parsing\Decoder
|
||||
*/
|
||||
public function parserCanReadAToken(Token $generated)
|
||||
{
|
||||
$read = (new Parser())->parse((string) $generated);
|
||||
|
||||
$this->assertEquals($generated, $read);
|
||||
$this->assertEquals('testing', $read->getClaim('user')->name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Hmac
|
||||
* @covers Lcobucci\JWT\Signer\Hmac\Sha256
|
||||
*/
|
||||
public function verifyShouldReturnFalseWhenKeyIsNotRight(Token $token)
|
||||
{
|
||||
$this->assertFalse($token->verify($this->signer, 'testing1'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Hmac
|
||||
* @covers Lcobucci\JWT\Signer\Hmac\Sha256
|
||||
* @covers Lcobucci\JWT\Signer\Hmac\Sha512
|
||||
*/
|
||||
public function verifyShouldReturnFalseWhenAlgorithmIsDifferent(Token $token)
|
||||
{
|
||||
$this->assertFalse($token->verify(new Sha512(), 'testing'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Hmac
|
||||
* @covers Lcobucci\JWT\Signer\Hmac\Sha256
|
||||
*/
|
||||
public function verifyShouldReturnTrueWhenKeyIsRight(Token $token)
|
||||
{
|
||||
$this->assertTrue($token->verify($this->signer, 'testing'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Hmac
|
||||
* @covers Lcobucci\JWT\Signer\Hmac\Sha256
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Parsing\Decoder
|
||||
*/
|
||||
public function everythingShouldWorkWhenUsingATokenGeneratedByOtherLibs()
|
||||
{
|
||||
$data = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJoZWxsbyI6IndvcmxkIn0.Rh'
|
||||
. '7AEgqCB7zae1PkgIlvOpeyw9Ab8NGTbeOH7heHO0o';
|
||||
|
||||
$token = (new Parser())->parse((string) $data);
|
||||
|
||||
$this->assertEquals('world', $token->getClaim('hello'));
|
||||
$this->assertTrue($token->verify($this->signer, 'testing'));
|
||||
}
|
||||
}
|
||||
53
vendor/lcobucci/jwt/test/functional/Keys.php
vendored
Normal file
53
vendor/lcobucci/jwt/test/functional/Keys.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
namespace Lcobucci\JWT;
|
||||
|
||||
use Lcobucci\JWT\Signer\Keychain;
|
||||
|
||||
/**
|
||||
* @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
|
||||
*/
|
||||
trait Keys
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $rsaKeys;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $ecdsaKeys;
|
||||
|
||||
/**
|
||||
* @beforeClass
|
||||
*/
|
||||
public static function createRsaKeys()
|
||||
{
|
||||
$keychain = new Keychain();
|
||||
$dir = 'file://' . __DIR__;
|
||||
|
||||
static::$rsaKeys = [
|
||||
'private' => $keychain->getPrivateKey($dir . '/rsa/private.key'),
|
||||
'public' => $keychain->getPublicKey($dir . '/rsa/public.key'),
|
||||
'encrypted-private' => $keychain->getPrivateKey($dir . '/rsa/encrypted-private.key', 'testing'),
|
||||
'encrypted-public' => $keychain->getPublicKey($dir . '/rsa/encrypted-public.key')
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @beforeClass
|
||||
*/
|
||||
public static function createEcdsaKeys()
|
||||
{
|
||||
$keychain = new Keychain();
|
||||
$dir = 'file://' . __DIR__;
|
||||
|
||||
static::$ecdsaKeys = [
|
||||
'private' => $keychain->getPrivateKey($dir . '/ecdsa/private.key'),
|
||||
'private-params' => $keychain->getPrivateKey($dir . '/ecdsa/private2.key'),
|
||||
'public1' => $keychain->getPublicKey($dir . '/ecdsa/public1.key'),
|
||||
'public2' => $keychain->getPublicKey($dir . '/ecdsa/public2.key'),
|
||||
'public-params' => $keychain->getPublicKey($dir . '/ecdsa/public3.key'),
|
||||
];
|
||||
}
|
||||
}
|
||||
272
vendor/lcobucci/jwt/test/functional/RsaTokenTest.php
vendored
Normal file
272
vendor/lcobucci/jwt/test/functional/RsaTokenTest.php
vendored
Normal file
@@ -0,0 +1,272 @@
|
||||
<?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\FunctionalTests;
|
||||
|
||||
use Lcobucci\JWT\Builder;
|
||||
use Lcobucci\JWT\Keys;
|
||||
use Lcobucci\JWT\Parser;
|
||||
use Lcobucci\JWT\Signer\Key;
|
||||
use Lcobucci\JWT\Token;
|
||||
use Lcobucci\JWT\Signature;
|
||||
use Lcobucci\JWT\Signer\Rsa\Sha256;
|
||||
use Lcobucci\JWT\Signer\Rsa\Sha512;
|
||||
|
||||
/**
|
||||
* @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
|
||||
* @since 2.1.0
|
||||
*/
|
||||
class RsaTokenTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
use Keys;
|
||||
|
||||
/**
|
||||
* @var Sha256
|
||||
*/
|
||||
private $signer;
|
||||
|
||||
/**
|
||||
* @before
|
||||
*/
|
||||
public function createSigner()
|
||||
{
|
||||
$this->signer = new Sha256();
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @expectedException \InvalidArgumentException
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Rsa
|
||||
* @covers Lcobucci\JWT\Signer\Rsa\Sha256
|
||||
*/
|
||||
public function builderShouldRaiseExceptionWhenKeyIsInvalid()
|
||||
{
|
||||
$user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
|
||||
|
||||
(new Builder())->setId(1)
|
||||
->setAudience('http://client.abc.com')
|
||||
->setIssuer('http://api.abc.com')
|
||||
->set('user', $user)
|
||||
->sign($this->signer, new Key('testing'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @expectedException \InvalidArgumentException
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Rsa
|
||||
* @covers Lcobucci\JWT\Signer\Rsa\Sha256
|
||||
*/
|
||||
public function builderShouldRaiseExceptionWhenKeyIsNotRsaCompatible()
|
||||
{
|
||||
$user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
|
||||
|
||||
(new Builder())->setId(1)
|
||||
->setAudience('http://client.abc.com')
|
||||
->setIssuer('http://api.abc.com')
|
||||
->set('user', $user)
|
||||
->sign($this->signer, static::$ecdsaKeys['private']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Rsa
|
||||
* @covers Lcobucci\JWT\Signer\Rsa\Sha256
|
||||
*/
|
||||
public function builderCanGenerateAToken()
|
||||
{
|
||||
$user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
|
||||
|
||||
$token = (new Builder())->setId(1)
|
||||
->setAudience('http://client.abc.com')
|
||||
->setIssuer('http://api.abc.com')
|
||||
->set('user', $user)
|
||||
->setHeader('jki', '1234')
|
||||
->sign($this->signer, static::$rsaKeys['private'])
|
||||
->getToken();
|
||||
|
||||
$this->assertAttributeInstanceOf(Signature::class, 'signature', $token);
|
||||
$this->assertEquals('1234', $token->getHeader('jki'));
|
||||
$this->assertEquals('http://client.abc.com', $token->getClaim('aud'));
|
||||
$this->assertEquals('http://api.abc.com', $token->getClaim('iss'));
|
||||
$this->assertEquals($user, $token->getClaim('user'));
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Parsing\Decoder
|
||||
*/
|
||||
public function parserCanReadAToken(Token $generated)
|
||||
{
|
||||
$read = (new Parser())->parse((string) $generated);
|
||||
|
||||
$this->assertEquals($generated, $read);
|
||||
$this->assertEquals('testing', $read->getClaim('user')->name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Rsa
|
||||
* @covers Lcobucci\JWT\Signer\Rsa\Sha256
|
||||
*/
|
||||
public function verifyShouldReturnFalseWhenKeyIsNotRight(Token $token)
|
||||
{
|
||||
$this->assertFalse($token->verify($this->signer, self::$rsaKeys['encrypted-public']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Rsa
|
||||
* @covers Lcobucci\JWT\Signer\Rsa\Sha256
|
||||
* @covers Lcobucci\JWT\Signer\Rsa\Sha512
|
||||
*/
|
||||
public function verifyShouldReturnFalseWhenAlgorithmIsDifferent(Token $token)
|
||||
{
|
||||
$this->assertFalse($token->verify(new Sha512(), self::$rsaKeys['public']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @expectedException \InvalidArgumentException
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Rsa
|
||||
* @covers Lcobucci\JWT\Signer\Rsa\Sha256
|
||||
*/
|
||||
public function verifyShouldRaiseExceptionWhenKeyIsNotRsaCompatible(Token $token)
|
||||
{
|
||||
$this->assertFalse($token->verify($this->signer, self::$ecdsaKeys['public1']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Rsa
|
||||
* @covers Lcobucci\JWT\Signer\Rsa\Sha256
|
||||
*/
|
||||
public function verifyShouldReturnTrueWhenKeyIsRight(Token $token)
|
||||
{
|
||||
$this->assertTrue($token->verify($this->signer, self::$rsaKeys['public']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Signature
|
||||
* @covers Lcobucci\JWT\Signer\Key
|
||||
* @covers Lcobucci\JWT\Signer\BaseSigner
|
||||
* @covers Lcobucci\JWT\Signer\Rsa
|
||||
* @covers Lcobucci\JWT\Signer\Rsa\Sha256
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Parsing\Decoder
|
||||
*/
|
||||
public function everythingShouldWorkWhenUsingATokenGeneratedByOtherLibs()
|
||||
{
|
||||
$data = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXUyJ9.eyJoZWxsbyI6IndvcmxkIn0.s'
|
||||
. 'GYbB1KrmnESNfJ4D9hOe1Zad_BMyxdb8G4p4LNP7StYlOyBWck6q7XPpPj_6gB'
|
||||
. 'Bo1ohD3MA2o0HY42lNIrAStaVhfsFKGdIou8TarwMGZBPcif_3ThUV1pGS3fZc'
|
||||
. 'lFwF2SP7rqCngQis_xcUVCyqa8E1Wa_v28grnl1QZrnmQFO8B5JGGLqcrfUHJO'
|
||||
. 'nJCupP-Lqh4TmIhftIimSCgLNmJg80wyrpUEfZYReE7hPuEmY0ClTqAGIMQoNS'
|
||||
. '98ljwDxwhfbSuL2tAdbV4DekbTpWzspe3dOJ7RSzmPKVZ6NoezaIazKqyqkmHZfcMaHI1lQeGia6LTbHU1bp0gINi74Vw';
|
||||
|
||||
$token = (new Parser())->parse((string) $data);
|
||||
|
||||
$this->assertEquals('world', $token->getClaim('hello'));
|
||||
$this->assertTrue($token->verify($this->signer, self::$rsaKeys['public']));
|
||||
}
|
||||
}
|
||||
137
vendor/lcobucci/jwt/test/functional/UnsignedTokenTest.php
vendored
Normal file
137
vendor/lcobucci/jwt/test/functional/UnsignedTokenTest.php
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
<?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\FunctionalTests;
|
||||
|
||||
use Lcobucci\JWT\Builder;
|
||||
use Lcobucci\JWT\Parser;
|
||||
use Lcobucci\JWT\Token;
|
||||
use Lcobucci\JWT\ValidationData;
|
||||
|
||||
/**
|
||||
* @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
|
||||
* @since 2.1.0
|
||||
*/
|
||||
class UnsignedTokenTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
const CURRENT_TIME = 100000;
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
*/
|
||||
public function builderCanGenerateAToken()
|
||||
{
|
||||
$user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
|
||||
|
||||
$token = (new Builder())->setId(1)
|
||||
->setAudience('http://client.abc.com')
|
||||
->setIssuer('http://api.abc.com')
|
||||
->setExpiration(self::CURRENT_TIME + 3000)
|
||||
->set('user', $user)
|
||||
->getToken();
|
||||
|
||||
$this->assertAttributeEquals(null, 'signature', $token);
|
||||
$this->assertEquals('http://client.abc.com', $token->getClaim('aud'));
|
||||
$this->assertEquals('http://api.abc.com', $token->getClaim('iss'));
|
||||
$this->assertEquals(self::CURRENT_TIME + 3000, $token->getClaim('exp'));
|
||||
$this->assertEquals($user, $token->getClaim('user'));
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Parsing\Decoder
|
||||
*/
|
||||
public function parserCanReadAToken(Token $generated)
|
||||
{
|
||||
$read = (new Parser())->parse((string) $generated);
|
||||
|
||||
$this->assertEquals($generated, $read);
|
||||
$this->assertEquals('testing', $read->getClaim('user')->name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\ValidationData
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Claim\EqualsTo
|
||||
* @covers Lcobucci\JWT\Claim\GreaterOrEqualsTo
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Parsing\Decoder
|
||||
*/
|
||||
public function tokenValidationShouldReturnWhenEverythingIsFine(Token $generated)
|
||||
{
|
||||
$data = new ValidationData(self::CURRENT_TIME - 10);
|
||||
$data->setAudience('http://client.abc.com');
|
||||
$data->setIssuer('http://api.abc.com');
|
||||
|
||||
$this->assertTrue($generated->validate($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @dataProvider invalidValidationData
|
||||
*
|
||||
* @depends builderCanGenerateAToken
|
||||
*
|
||||
* @covers Lcobucci\JWT\Builder
|
||||
* @covers Lcobucci\JWT\Parser
|
||||
* @covers Lcobucci\JWT\Token
|
||||
* @covers Lcobucci\JWT\ValidationData
|
||||
* @covers Lcobucci\JWT\Claim\Factory
|
||||
* @covers Lcobucci\JWT\Claim\Basic
|
||||
* @covers Lcobucci\JWT\Claim\EqualsTo
|
||||
* @covers Lcobucci\JWT\Claim\GreaterOrEqualsTo
|
||||
* @covers Lcobucci\JWT\Parsing\Encoder
|
||||
* @covers Lcobucci\JWT\Parsing\Decoder
|
||||
*/
|
||||
public function tokenValidationShouldReturnFalseWhenExpectedDataDontMatch(ValidationData $data, Token $generated)
|
||||
{
|
||||
$this->assertFalse($generated->validate($data));
|
||||
}
|
||||
|
||||
public function invalidValidationData()
|
||||
{
|
||||
$expired = new ValidationData(self::CURRENT_TIME + 3020);
|
||||
$expired->setAudience('http://client.abc.com');
|
||||
$expired->setIssuer('http://api.abc.com');
|
||||
|
||||
$invalidAudience = new ValidationData(self::CURRENT_TIME - 10);
|
||||
$invalidAudience->setAudience('http://cclient.abc.com');
|
||||
$invalidAudience->setIssuer('http://api.abc.com');
|
||||
|
||||
$invalidIssuer = new ValidationData(self::CURRENT_TIME - 10);
|
||||
$invalidIssuer->setAudience('http://client.abc.com');
|
||||
$invalidIssuer->setIssuer('http://aapi.abc.com');
|
||||
|
||||
return [[$expired], [$invalidAudience], [$invalidIssuer]];
|
||||
}
|
||||
}
|
||||
5
vendor/lcobucci/jwt/test/functional/ecdsa/private.key
vendored
Normal file
5
vendor/lcobucci/jwt/test/functional/ecdsa/private.key
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
-----BEGIN EC PRIVATE KEY-----
|
||||
MHcCAQEEIBGpMoZJ64MMSzuo5JbmXpf9V4qSWdLIl/8RmJLcfn/qoAoGCCqGSM49
|
||||
AwEHoUQDQgAE7it/EKmcv9bfpcV1fBreLMRXxWpnd0wxa2iFruiI2tsEdGFTLTsy
|
||||
U+GeRqC7zN0aTnTQajarUylKJ3UWr/r1kg==
|
||||
-----END EC PRIVATE KEY-----
|
||||
8
vendor/lcobucci/jwt/test/functional/ecdsa/private2.key
vendored
Normal file
8
vendor/lcobucci/jwt/test/functional/ecdsa/private2.key
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
-----BEGIN EC PARAMETERS-----
|
||||
BggqhkjOPQMBBw==
|
||||
-----END EC PARAMETERS-----
|
||||
-----BEGIN EC PRIVATE KEY-----
|
||||
MHcCAQEEIM6G7WZ6SqoPwrHwGXhOJkYD+ErT8dfRvrNifgBQvSb7oAoGCCqGSM49
|
||||
AwEHoUQDQgAE09Hkp/u0tIGdzlQ99R/sXCOr9DTZAfLex4D4Po0C1L3qUqHrzZ0m
|
||||
B3bAhe+pwEDQ/jqVqdzxhA9i4PqT7F4Aew==
|
||||
-----END EC PRIVATE KEY-----
|
||||
4
vendor/lcobucci/jwt/test/functional/ecdsa/public1.key
vendored
Normal file
4
vendor/lcobucci/jwt/test/functional/ecdsa/public1.key
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7it/EKmcv9bfpcV1fBreLMRXxWpn
|
||||
d0wxa2iFruiI2tsEdGFTLTsyU+GeRqC7zN0aTnTQajarUylKJ3UWr/r1kg==
|
||||
-----END PUBLIC KEY-----
|
||||
4
vendor/lcobucci/jwt/test/functional/ecdsa/public2.key
vendored
Normal file
4
vendor/lcobucci/jwt/test/functional/ecdsa/public2.key
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEdgxRxlhzhHGj+v6S2ikp+33LoGp5
|
||||
QWbEWv8BORsr2Ayg6C7deDDRM/s/f0R++4zZqXro1gDTVF5VDv7nE+EfEw==
|
||||
-----END PUBLIC KEY-----
|
||||
4
vendor/lcobucci/jwt/test/functional/ecdsa/public3.key
vendored
Normal file
4
vendor/lcobucci/jwt/test/functional/ecdsa/public3.key
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE09Hkp/u0tIGdzlQ99R/sXCOr9DTZ
|
||||
AfLex4D4Po0C1L3qUqHrzZ0mB3bAhe+pwEDQ/jqVqdzxhA9i4PqT7F4Aew==
|
||||
-----END PUBLIC KEY-----
|
||||
30
vendor/lcobucci/jwt/test/functional/rsa/encrypted-private.key
vendored
Normal file
30
vendor/lcobucci/jwt/test/functional/rsa/encrypted-private.key
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Proc-Type: 4,ENCRYPTED
|
||||
DEK-Info: AES-128-CBC,0D71668CE71033CB9150ED82FC87F4A1
|
||||
|
||||
uLzPNDdlHnZ77tAGMHyPYERDMBcdV4SsQJYcSjiHhR2o0dLGTdgOpQrXTHPX4GJF
|
||||
LlEWLhAAV9wx2mM/2kHDWB4uZwThtT9/v+RFoW1WbVO/d3lhI9fg4/73/DWAH/7/
|
||||
afMRc7ZOVoAmVCESotPx4khCHoE97RdY/JtkLTzc3+peqmL53AbYXrg9rTN1B+ZV
|
||||
U3w4ciQS8Uki87zDYIBjYtaOCyMUTvug25CvdssvUMBoc/Jc0xps6/vAyXrnzlGT
|
||||
pZD0Tst8idswfDi613BhAaxJspeY0AErWA59qJ3eGzbiQq5RDWcbJe/Tz5r/6+NN
|
||||
DkvNQ7DaEZ6LpeWX0MUq6/QWfrM8yE95XhjyC1d3LYn32lXHUygbgTFWIgLDoOE6
|
||||
nBhu34SWtbLAnqYGewaJFxhlYVS9rb/uvYQg70r5X9Sx6alCQPiPyIv39IItezn2
|
||||
HF2GRfE91MPZUeDhdqdvvOlSZVM5KnYc1fhamGAwM48gdDDXe8Czu/JEGoANNvC3
|
||||
l/Z1p5RtGF4hrel9WpeX9zQq3pvtfVcVIiWuRUwCOSQytXlieRK37sMuYeggvmjV
|
||||
VvaCods3mS/panWg9T/D/deIXjhzNJLvyiJg8+3sY5H4yNe0XpbaAc/ySwt9Rcxy
|
||||
FzFQ+5pghLSZgR1uV3AhdcnzXBU2GkYhdGKt2tUsH0UeVQ2BXxTlBFsCOh2dWqcj
|
||||
y3suIG65bukDAAWidQ4q3S6ZIMpXBhhCj7nwB5jQ7wSlU3U9So0ndr7zxdUILiMm
|
||||
chHi3q5apVZnMGcwv2B33rt4nD7HgGEmRKkCelrSrBATY1ut+T4rCDzKDqDs3jpv
|
||||
hYIWrlNPTkJyQz3eWly6Db+FJEfdYGadYJusc7/nOxCh/QmUu8Sh3NhKT6TH0bS7
|
||||
1AAqd8H+2hJ9I32Dhd2qwAF7PkNe2LGi+P8tbAtepKGim5w65wnsPePMnrfxumsG
|
||||
PeDnMrqeCKy+fME7a/MS5kmEBpmD4BMhVC6/OhFVz8gBty1f8yIEZggHNQN2QK7m
|
||||
NIrG+PwqW2w8HoxOlAi2Ix4LTPifrdfsH02U7aM1pgo1rZzD4AOzqvzCaK43H2VB
|
||||
BHLeTBGoLEUxXA9C+iGbeQlKXkMC00QKkjK5+nvkvnvePFfsrTQIpuyGufD/MoPb
|
||||
6fpwsyHZDxhxMN1PJk1b1lPq2Ui4hXpVNOYd4Q6OQz7bwxTMRX9XQromUlKMMgAT
|
||||
edX8v2NdM7Ssy1IwHuGVbDEpZdjoeaWZ1iNRV17i/EaJAqwYDQLfsuHBlzZL1ov1
|
||||
xkKVJdL8Y3q80oRAzTQDVdzL/rI44LLAfv609YByCnw29feYJY2W6gV0O7ZSw413
|
||||
XUkc5CaEbR1LuG8NtnOOPJV4Tb/hNsIDtvVm7Hl5npBKBe4iVgQ2LNuC2eT69d/z
|
||||
uvzgjISlumPiO5ivuYe0QtLPuJSc+/Bl8bPL8gcNQEtqkzj7IftHPPZNs+bJC2uY
|
||||
bPjq5KoDNAMF6VHuKHwu48MBYpnXDIg3ZenmJwGRULRBhK6324hDS6NJ7ULTBU2M
|
||||
TZCHmg89ySLBfCAspVeo63o/R7bs9a7BP9x2h5uwCBogSvkEwhhPKnboVN45bp9c
|
||||
-----END RSA PRIVATE KEY-----
|
||||
9
vendor/lcobucci/jwt/test/functional/rsa/encrypted-public.key
vendored
Normal file
9
vendor/lcobucci/jwt/test/functional/rsa/encrypted-public.key
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwLpbUP8a9yflt5LKUUS3
|
||||
NPuRM7yEouPWg0VKeY5AURu4i8bqQ20K5jwfRJ+w05FvlywG4EuxpnpTFTVS2/do
|
||||
q3xufzTf/C3KIDOAHEifkdx4140btKxxm4mD9Eu2CQ32adZyScha50KUFlfnAAic
|
||||
Hb8wYxjFyWo3PAbGYmCQCn2z97Ab0Ar6NR1e+V9f8EL9Orr2f04puKJfQTZdWVDF
|
||||
UJR4w7QZ/CPY0LEsiFLW3QQCNraka1mtrLJwPqreBtDEkj8IoISNkrguu/97RQZz
|
||||
miJgBQkVjr6OfqG5WIFr0MzbRZc1/aK9g8ft88nhhQm0E3GqkCxBKTwgA03HtK07
|
||||
qQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
28
vendor/lcobucci/jwt/test/functional/rsa/private.key
vendored
Normal file
28
vendor/lcobucci/jwt/test/functional/rsa/private.key
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDTvwE87MtgREYL
|
||||
TL4aHhQo3ZzogmxxvMUsKnPzyxRs1YrXOSOpwN0npsXarBKKVIUMNLfFODp/vnQn
|
||||
2Zp06N8XG59WAOKwvC4MfxLDQkA+JXggzHlkbVoTN+dUkdYIFqSKuAPGwiWToRK2
|
||||
SxEhij3rE2FON8jQZvDxZkiP9a4vxJO3OTPQwKredXFiObsXD/c3RtLFhKctjCyH
|
||||
OIrP0bQEsee/m7JNtG4ry6BPusN6wb+vJo5ieBYPa3c19akNq6q/nYWhplhkkJSu
|
||||
aOrL5xXEFzI5TvcvnXR568GVcxK8YLfFkdxpsXGt5rAbeh0h/U5kILEAqv8P9PGT
|
||||
ZpicKbrnAgMBAAECggEAd3yTQEQHR91/ASVfKPHMQns77eCbPVtekFusbugsMHYY
|
||||
EPdHbqVMpvFvOMRc+f5Tzd15ziq6qBdbCJm8lThLm4iU0z1QrpaiDZ8vgUvDYM5Y
|
||||
CXoZDli+uZWUTp60/n94fmb0ipZIChScsI2PrzOJWTvobvD/uso8MJydWc8zafQm
|
||||
uqYzygOfjFZvU4lSfgzpefhpquy0JUy5TiKRmGUnwLb3TtcsVavjsn4QmNwLYgOF
|
||||
2OE+R12ex3pAKTiRE6FcnE1xFIo1GKhBa2Otgw3MDO6Gg+kn8Q4alKz6C6RRlgaH
|
||||
R7sYzEfJhsk/GGFTYOzXKQz2lSaStKt9wKCor04RcQKBgQDzPOu5jCTfayUo7xY2
|
||||
jHtiogHyKLLObt9l3qbwgXnaD6rnxYNvCrA0OMvT+iZXsFZKJkYzJr8ZOxOpPROk
|
||||
10WdOaefiwUyL5dypueSwlIDwVm+hI4Bs82MajHtzOozh+73wA+aw5rPs84Uix9w
|
||||
VbbwaVR6qP/BV09yJYS5kQ7fmwKBgQDe2xjywX2d2MC+qzRr+LfU+1+gq0jjhBCX
|
||||
WHqRN6IECB0xTnXUf9WL/VCoI1/55BhdbbEja+4btYgcXSPmlXBIRKQ4VtFfVmYB
|
||||
kPXeD8oZ7LyuNdCsbKNe+x1IHXDe6Wfs3L9ulCfXxeIE84wy3fd66mQahyXV9iD9
|
||||
CkuifMqUpQKBgQCiydHlY1LGJ/o9tA2Ewm5Na6mrvOs2V2Ox1NqbObwoYbX62eiF
|
||||
53xX5u8bVl5U75JAm+79it/4bd5RtKux9dUETbLOhwcaOFm+hM+VG/IxyzRZ2nMD
|
||||
1qcpY2U5BpxzknUvYF3RMTop6edxPk7zKpp9ubCtSu+oINvtxAhY/SkcIwKBgGP1
|
||||
upcImyO2GZ5shLL5eNubdSVILwV+M0LveOqyHYXZbd6z5r5OKKcGFKuWUnJwEU22
|
||||
6gGNY9wh7M9sJ7JBzX9c6pwqtPcidda2AtJ8GpbOTUOG9/afNBhiYpv6OKqD3w2r
|
||||
ZmJfKg/qvpqh83zNezgy8nvDqwDxyZI2j/5uIx/RAoGBAMWRmxtv6H2cKhibI/aI
|
||||
MTJM4QRjyPNxQqvAQsv+oHUbid06VK3JE+9iQyithjcfNOwnCaoO7I7qAj9QEfJS
|
||||
MZQc/W/4DHJebo2kd11yoXPVTXXOuEwLSKCejBXABBY0MPNuPUmiXeU0O3Tyi37J
|
||||
TUKzrgcd7NvlA41Y4xKcOqEA
|
||||
-----END PRIVATE KEY-----
|
||||
9
vendor/lcobucci/jwt/test/functional/rsa/public.key
vendored
Normal file
9
vendor/lcobucci/jwt/test/functional/rsa/public.key
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA078BPOzLYERGC0y+Gh4U
|
||||
KN2c6IJscbzFLCpz88sUbNWK1zkjqcDdJ6bF2qwSilSFDDS3xTg6f750J9madOjf
|
||||
FxufVgDisLwuDH8Sw0JAPiV4IMx5ZG1aEzfnVJHWCBakirgDxsIlk6EStksRIYo9
|
||||
6xNhTjfI0Gbw8WZIj/WuL8STtzkz0MCq3nVxYjm7Fw/3N0bSxYSnLYwshziKz9G0
|
||||
BLHnv5uyTbRuK8ugT7rDesG/ryaOYngWD2t3NfWpDauqv52FoaZYZJCUrmjqy+cV
|
||||
xBcyOU73L510eevBlXMSvGC3xZHcabFxreawG3odIf1OZCCxAKr/D/Txk2aYnCm6
|
||||
5wIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
Reference in New Issue
Block a user