Esempio n. 1
0
File: JWS.php Progetto: sop/jwx
 /**
  * Validate the signature using the given JWK.
  *
  * Signature algorithm is determined from the header.
  *
  * @param JWK $jwk JSON Web Key
  * @throws \RuntimeException If algorithm initialization fails
  * @return bool True if signature is valid
  */
 public function validateWithJWK(JWK $jwk)
 {
     $algo = SignatureAlgorithm::fromJWK($jwk, $this->header());
     return $this->validate($algo);
 }
Esempio n. 2
0
 /**
  *
  * @see \JWX\JWS\SignatureAlgorithm::headerParameters()
  * @return JWTParameter[]
  */
 public function headerParameters()
 {
     return array_merge(parent::headerParameters(), array(AlgorithmParameter::fromAlgorithm($this)));
 }