增加大数据裸签功能,完善RSA签名功能接口(修改counthash使用)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user