Namshi\JOSE\Signer\OpenSSL\PublicKey::verify PHP Method

verify() public method

public verify ( $key, $signature, $input )
    public function verify($key, $signature, $input)
    {
        $keyResource = $this->getKeyResource($key);
        if (!$this->supportsKey($keyResource)) {
            throw new InvalidArgumentException('Invalid key supplied.');
        }
        $result = openssl_verify($input, $signature, $keyResource, $this->getHashingAlgorithm());
        if ($result === -1) {
            throw new RuntimeException('Unknown error during verification.');
        }
        return (bool) $result;
    }