create() public static method

public static create ( Mdanter\Ecc\Math\GmpMathInterface $adapter ) : KeyParser
$adapter Mdanter\Ecc\Math\GmpMathInterface
return KeyParser
Ejemplo n.º 1
0
 /**
  * @test
  *
  * @covers \Lcobucci\JWT\Signer\Ecdsa\KeyParser::create
  *
  * @uses \Lcobucci\JWT\Signer\Ecdsa\KeyParser::__construct
  */
 public function createShouldReturnAValidInstanceBasedOnTheMathAdapter()
 {
     $parser = KeyParser::create($this->adapter);
     self::assertAttributeInstanceOf(PrivateKeySerializerInterface::class, 'privateKeySerializer', $parser);
     self::assertAttributeInstanceOf(PublicKeySerializerInterface::class, 'publicKeySerializer', $parser);
 }
Ejemplo n.º 2
0
 public static function create() : Ecdsa
 {
     $mathInterface = EccFactory::getAdapter();
     return new static(EccAdapter::create($mathInterface), KeyParser::create($mathInterface));
 }