增加大数据裸签功能,完善RSA签名功能接口(修改counthash使用)

This commit is contained in:
yihzhou
2022-12-15 17:26:22 +08:00
parent 85ef86ee49
commit 54e636dd4f
8 changed files with 393 additions and 283 deletions
@@ -124,6 +124,17 @@ public class SydApiException extends RuntimeException{
}
}
public SydApiException(String msg, int ret, Throwable e) {
super("SydApiException(code =" + String.format(" %04x", ret) + " : " + "msg =" + (msg == null ? "未定义的错误" : msg) + ")", e);
this.retCode = ret;
if (msg != null && !"".equals(msg)) {
this.msg = msg;
} else {
this.transMsg();
}
}
public static SydApiException fromBin( byte[] b , String msg){
int code = null != b && b[0] >= 48 && b[0] <= 57 ? Util.a2i( b , 10) : Util.b2i( b );
return new SydApiException(msg, code);
@@ -72,4 +72,6 @@ public interface SydHashApi {
public String calcPBOCMAC(int mode, int keyType, String key, byte[] data, int block, byte[] iv);
public RetWrap countHash(int hashType, int packSn, byte[] msg, byte[] filterData);
public byte[] RSAHash(int hashType, byte[] orgData);
}
+4 -1
View File
@@ -11,7 +11,10 @@ import java.io.IOException;
public class ASN1Util {
public static byte[] alignSignDer(byte[] der) {
String base64 = Util.encodeBase64(der);
return SYMUtil.base64SignAsDerSign(base64);
}
public static RetWrap takeOutOriginDataFromPKCS7Sign(String sign) throws IOException {
RetWrap ret = new RetWrap();