verify() 공개 정적인 메소드

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
리턴 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());
     }
 }