public function sign($input, $key, $password = null)
{
$keyResource = $this->getKeyResource($key, $password);
if (!$this->supportsKey($keyResource)) {
throw new InvalidArgumentException('Invalid key supplied.');
}
$signature = null;
openssl_sign($input, $signature, $keyResource, $this->getHashingAlgorithm());
return $signature;
}