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;
}