getPublicKey() public méthode

Parses a public key from the given PEM content
public getPublicKey ( Lcobucci\JWT\Signer\Key $key ) : Mdanter\Ecc\Crypto\Key\PublicKeyInterface
$key Lcobucci\JWT\Signer\Key
Résultat Mdanter\Ecc\Crypto\Key\PublicKeyInterface
Exemple #1
0
 /**
  * @test
  *
  * @expectedException \InvalidArgumentException
  *
  * @uses \Lcobucci\JWT\Signer\Ecdsa\KeyParser::__construct
  * @uses \Lcobucci\JWT\Signer\Key
  *
  * @covers \Lcobucci\JWT\Signer\Ecdsa\KeyParser::getPublicKey
  * @covers \Lcobucci\JWT\Signer\Ecdsa\KeyParser::getKeyContent
  */
 public function getPublicKeyShouldRaiseExceptionWhenAWrongKeyWasGiven()
 {
     $this->publicKeySerializer->expects($this->never())->method('parse');
     $parser = new KeyParser($this->privateKeySerializer, $this->publicKeySerializer);
     $parser->getPublicKey($this->getPrivateKey());
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 public function doVerify(string $expected, string $payload, Key $key) : bool
 {
     return $this->signer->verify($this->parser->getPublicKey($key), $this->extractSignature($expected), $this->createSigningHash($payload));
 }
Exemple #3
0
 /**
  * {@inheritdoc}
  */
 public function doVerify(string $expected, string $payload, Key $key) : bool
 {
     return $this->adapter->verifyHash($expected, $this->keyParser->getPublicKey($key), $this->adapter->createSigningHash($payload, $this->getAlgorithm()), $this->getAlgorithm());
 }