/** * 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); }
/** * * @see \JWX\JWS\SignatureAlgorithm::headerParameters() * @return JWTParameter[] */ public function headerParameters() { return array_merge(parent::headerParameters(), array(AlgorithmParameter::fromAlgorithm($this))); }