public static function opensslVerify(
        $str,
        $sinature,
        $publicKeyPath,
        $algo = OPENSSL_ALGO_SHA1,
        $format = self::FORMAT_HEX
    )
    {
        $publicKey = openssl_pkey_get_public(file_get_contents($publicKeyPath));

        $sinature = trim($sinature);

        switch ($format) {
            case self::FORMAT_HEX:
                $sinature = hex2bin($sinature);
                break;
            case self::FORMAT_BASE64:
                $sinature = EncodeHelper::base64Decode($sinature);
                break;
            default:
                $sinature = hex2bin($sinature);
        }

        $res = openssl_verify(trim($str), $sinature, $publicKey, $algo);

        openssl_free_key($publicKey);

        if ($res == 1) {
            return true;
        }

        return false;
    }