Namshi\JOSE\JWS::verify PHP Method

verify() public method

Verifies that the internal signin input corresponds to the encoded signature previously stored (@see JWS::load).
public verify ( resource | string $key, string $algo = null ) : boolean
$key resource | string
$algo string The algorithms this JWS should be signed with. Use it if you want to restrict which algorithms you want to allow to be validated.
return boolean
    public function verify($key, $algo = null)
    {
        if (empty($key) || $algo && $this->header['alg'] !== $algo) {
            return false;
        }
        $decodedSignature = $this->encoder->decode($this->getEncodedSignature());
        $signinInput = $this->generateSigninInput();
        return $this->getSigner()->verify($key, $decodedSignature, $signinInput);
    }