fix:attachedVerifyAndGetAll call detachedVerify set flag$option=1 whitch check cert usefull always
This commit is contained in:
parent
c516397ad6
commit
c90bb3ea0f
@ -1049,11 +1049,9 @@ public class SydApi4j implements SydApi {
|
||||
|
||||
}
|
||||
|
||||
// 测试通过
|
||||
@Override
|
||||
public boolean detachedVerify(int dataType, byte[] orgData, String sign) {
|
||||
public boolean detachedVerify(int dataType, byte[] orgData, String sign, Boolean checkCert) {
|
||||
Proto8006 proto = new Proto8006();
|
||||
// 填充数据
|
||||
// 填充数据
|
||||
HashMap<String, Object> packet = new HashMap<String, Object>();
|
||||
PacketSN sn = PacketSN.gen();
|
||||
|
||||
@ -1071,7 +1069,7 @@ public class SydApi4j implements SydApi {
|
||||
|
||||
|
||||
data.put("signData", sign.getBytes());
|
||||
data.put("flag$option", 0);
|
||||
data.put("flag$option", checkCert ? 1 : 0);
|
||||
// 渲染发送
|
||||
ByteBuffer bb = proto.rend(packet);
|
||||
|
||||
@ -1102,6 +1100,12 @@ public class SydApi4j implements SydApi {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 测试通过
|
||||
@Override
|
||||
public boolean detachedVerify(int dataType, byte[] orgData, String sign) {
|
||||
return detachedVerify(dataType, orgData, sign, false);
|
||||
}
|
||||
|
||||
public boolean detachedVerifyAll(int rFlag,byte[] orgData, String sign){
|
||||
try {
|
||||
boolean sm2Cert = CertUtil.isSignedBySM2Cert(sign);
|
||||
@ -12120,7 +12124,7 @@ public class SydApi4j implements SydApi {
|
||||
byte[] pk = (byte[]) ret.get("pk");
|
||||
byte[] hash = this.SM3Hash(Util.bytes2HexString(pk), orgData);
|
||||
String sign2 = (String) ret.get("sign");
|
||||
boolean pass = this.detachedVerify(0, hash, sign2);
|
||||
boolean pass = this.detachedVerify(0, hash, sign2, true);
|
||||
if (pass) {
|
||||
ret.put("oData", orgData);
|
||||
String certInfo = (String) ret.get("cert");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user