src/PublicKey.php
/**
     * Verify the signature of some data
     *
     * @param string $data
     * @param string $signature
     * @param int $algorithm
     *
     * @return bool
     *
     * @throws RuntimeException when openssl report an error on verify
     */
Verify the signature of some data
@param string $data
@param string $signature
@param int $algorithm

@return bool

@throws RuntimeException when openssl report an error on verify
Verify the signature of some data @param string $data @param string $signature @param int $algorithm @return bool @throws RuntimeException when openssl report an error on verify
public function verify(string $data, string $signature, int $algorithm = OPENSSL_ALGO_SHA256): bool
    {
        return $this->callOnPublicKey(
            function ($publicKey) use ($data, $signature, $algorithm): bool {
                $verify = $this->openSslVerify($data, $signature, $publicKey, $algorithm);
                if (-1 === $verify) {
                    throw new RuntimeException('Verify error: ' . openssl_error_string());
                }
                return (1 === $verify);
            }
        );
    }
public function verify ( string $ data , string $ signature , int $ algorithm = OPENSSL_ALGO_SHA256 ) : bool { return $ this -> callOnPublicKey ( function ( $ publicKey ) use ( $ data , $ signature , $ algorithm ) : bool { $ verify = $ this -> openSslVerify ( $ data , $ signature , $ publicKey , $ algorithm ) ; if ( - 1 === $ verify ) { throw new RuntimeException ( 'Verify error: ' . openssl_error_string ( ) ) ; } return ( 1 === $ verify ) ; } ) ; }
Verify the signature of some data
 @param string $data
 @param string $signature
 @param int $algorithm
Verify the signature of some data @param string $data @param string $signature @param int $algorithm
/** @codeCoverageIgnore Don't know how make openssl_verify returns -1 */