public static synchronized List<SignatureVerification> getVerifyListInfo(byte[] b) { List<SignatureVerification> signatureVerifications = new ArrayList<SignatureVerification>(); SignatureVerification sv = new SignatureVerification(); byte[] cert = null; SPDocument doc = new SPDocument(); cert = doc.VerifySignature(b); int i = doc.getVerifyResult(); logger.info("VerifyService---getVerifyResult:"+i); if (i == 0) { sv.setModified(false); } if (i == 1) { sv.setModified(true); } if (i == 2 || i == 3) { sv.setModified(true); } if (cert != null) { sv.setX509Base64(com.itrus.util.Base64.encode(cert)); signatureVerifications.add(sv); } return signatureVerifications; }
静态方法内调用的SO库,SO库里释放内存报错,所以加锁,多线程测试故障消除
原创文章,作者:carmelaweatherly,如若转载,请注明出处:https://blog.ytso.com/190656.html