您当前的位置: 首页 >  ar

漏刻有时

暂无认证

  • 0浏览

    0关注

    717博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

工银e生活开发脱坑日志(7)Missing argument 6 for IcbcSignature::verify()

漏刻有时 发布时间:2019-03-26 09:15:42 ,浏览量:0

工行沙箱环境测试过程中,出现参数错误,解决如下:

Warning: Missing argument 6 for IcbcSignature::verify(), called in 

原verify类函数

	public static function verify($strToSign, $signType, $publicKey, $charset, $signedStr, $password)//原静态参数;
	{
		if (IcbcConstants::$SIGN_TYPE_CA == $signType) {
			return IcbcCa::verify($strToSign, $publicKey, $password);
		} elseif (IcbcConstants::$SIGN_TYPE_RSA == $signType) {
			return RSA::verify($strToSign, $signedStr, $publicKey, IcbcConstants::$SIGN_SHA1RSA_ALGORITHMS);
		} elseif (IcbcConstants::$SIGN_TYPE_RSA2 == $signType) {
			return RSA::verify($strToSign, $signedStr, $publicKey, IcbcConstants::$SIGN_SHA256RSA_ALGORITHMS);
		} else {
			throw new Exception("Only support CA or RSA signature verify!");
		}
	}

原因在于第六个参数$password,用于CA证书的验证;对于RSA\RSA2中,根本没有用到,导致的。

最直接的解决方式:IcbcSignature.php文件头部添加代码

ini_set("display_errors", "off");
error_reporting(E_ALL | E_STRICT);

只是关闭错误信息提醒,如果要彻底解决该问题,将该类拆分成两个即可,一个专门用于CA证书的验证即可。

关注
打赏
1661217259
查看更多评论
立即登录/注册

微信扫码登录

0.0377s