修改6A、6B接口的参数byte[]为String

This commit is contained in:
zb
2022-04-13 14:34:22 +08:00
parent b4bdf191de
commit 8bb86fdb95
5 changed files with 56 additions and 14 deletions
+2 -2
View File
@@ -226,7 +226,7 @@ public interface SydGenApi {
* SessionKey 本地LMK 加密的会话密钥,HEX 格式, 本地 LMK 加密的会话密钥长度,HEX 格式(不包括第 1 个字符),一般为 33 个 Bytes。默认输入值为缓冲区的大小。
* KCV 会话密钥的检验值,HEX 格式,长度为 32H。
*/
RetWrap generateDEByDn(byte[] certSerial, String oData);
RetWrap generateDEByDn(String certSerial, String oData);
/**
* 产生对称密钥,通过公钥加密生成网联格式的数字信封。
@@ -308,7 +308,7 @@ public interface SydGenApi {
* KCV 会话密钥的检验值,HEX 格式,长度为 36H。
* orgCode 如果有机构码的话会返回机构码
*/
RetWrap decryptDEByDN(byte[] certSerial, String pCipherKey);
RetWrap decryptDEByDN(String certSerial, String pCipherKey);
/**
* 接收用私钥解密数字信封,还原对称密钥。
+16 -4
View File
@@ -2194,8 +2194,14 @@ public class SydApi4j implements SydApi {
}
@Override
public RetWrap generateDEByDn(byte[] certSerial, String oData) {
return generateDE(certSerial, 3, 1, oData);
public RetWrap generateDEByDn(String certSerial, String oData) {
byte[] dnBytes = null;
try {
dnBytes = certSerial.getBytes("gbk");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return generateDE(dnBytes, 3, 1, oData);
}
@Override
@@ -2308,8 +2314,14 @@ public class SydApi4j implements SydApi {
}
@Override
public RetWrap decryptDEByDN(byte[] certSerial, String pCipherKey) {
return decryptDE(true, 1, certSerial, pCipherKey);
public RetWrap decryptDEByDN(String certSerial, String pCipherKey) {
byte[] dnBytes = null;
try {
dnBytes = certSerial.getBytes("gbk");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return decryptDE(true, 1, dnBytes, pCipherKey);
}
// 测试通过