Lcobucci\JWT\Signer\Ecdsa\KeyParser::create PHP Method

create() public static method

public static create ( Mdanter\Ecc\Math\GmpMathInterface $adapter ) : KeyParser
$adapter Mdanter\Ecc\Math\GmpMathInterface
return KeyParser
    public static function create(GmpMathInterface $adapter) : KeyParser
    {
        $publicKeySerializer = new PemPublicKeySerializer(new DerPublicKeySerializer($adapter));
        return new self(new PemPrivateKeySerializer(new DerPrivateKeySerializer($adapter, $publicKeySerializer)), $publicKeySerializer);
    }

Usage Example

Esempio 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);
 }
All Usage Examples Of Lcobucci\JWT\Signer\Ecdsa\KeyParser::create