verify() public static method

Verifies a signature.
public static verify ( RSAKey $key, string $message, string $signature, string $hash ) : boolean
$key Jose\KeyConverter\RSAKey
$message string
$signature string
$hash string
return boolean
示例#1
0
文件: RSA.php 项目: spomky-labs/jose
 /**
  * {@inheritdoc}
  */
 public function verify(JWKInterface $key, $input, $signature)
 {
     $this->checkKey($key);
     $pub = RSAKey::toPublic(new RSAKey($key));
     if ($this->getSignatureMethod() === self::SIGNATURE_PSS) {
         return JoseRSA::verify($pub, $input, $signature, $this->getAlgorithm());
     } else {
         return 1 === openssl_verify($input, $signature, $pub->toPEM(), $this->getAlgorithm());
     }
 }