function params type byte[] string

This commit is contained in:
cheney
2022-06-22 09:58:51 +08:00
parent 080c705d72
commit b5332438f4
4 changed files with 37 additions and 16 deletions
+4 -1
View File
@@ -177,7 +177,7 @@ interface SydAttachedSVApi {
* @return
* 符合PKCS7标准的签名结果
*/
byte[] attachedSign(byte[] orgData, String sCertDN);
String attachedSign(byte[] orgData, String sCertDN);
/**
* 带公钥证书与原始数据的数字签名验签(遵循 PKCS#7)
@@ -186,6 +186,7 @@ interface SydAttachedSVApi {
* @param sign 已签名数据
* @return true 验签通过 false 验签失败
*/
boolean attachedVerify(String sign);
boolean attachedVerify(byte[] sign);
/**
@@ -196,6 +197,7 @@ interface SydAttachedSVApi {
* @return 成功返回签名的原数据,失败则报错
*/
byte[] attachedVerifyRD(byte[] sign);
byte[] attachedVerifyRD(String sign);
/**
* 带公钥证书与原始数据的数字签名验签(遵循 PKCS#7)
@@ -207,6 +209,7 @@ interface SydAttachedSVApi {
* 若发送报文返回证书信息标志位为1,则返回CERT_INFO结构的证书数据
*/
X509 attachedVerifyAndGetX509(byte[] sign);
X509 attachedVerifyAndGetX509(String sign);
/**
* 带公钥证书与原始数据的数字签名验签(遵循 PKCS#7)
+21 -3
View File
@@ -10415,7 +10415,7 @@ public class SydApi4j implements SydApi {
* @return 符合PKCS7标准的签名结果
*/
@Override
public byte[] attachedSign(byte[] orgData, String sCertDN) {
public String attachedSign(byte[] orgData, String sCertDN) {
sCertDN = DnUtil.verifyDn( sCertDN );
Proto8018 proto = new Proto8018();
@@ -10462,7 +10462,12 @@ public class SydApi4j implements SydApi {
throw new SydApiException(error.getInfo(), error.autoInt());
}
return ((PacketSection) ret.get("signature")).getString().getBytes();
return ((PacketSection) ret.get("signature")).getString();
}
@Override
public boolean attachedVerify(String sign) {
return attachedVerify( sign.getBytes() );
}
@Override
@@ -10476,7 +10481,7 @@ public class SydApi4j implements SydApi {
PacketSN sn = PacketSN.gen();
packet.put("header", sn.getSn().array());
data.put("signData", sign);
data.put("signData", sign );
data.put("flag$option", 0);
// 渲染发送
@@ -10508,6 +10513,11 @@ public class SydApi4j implements SydApi {
return true;
}
@Override
public byte[] attachedVerifyRD(String sign) {
return attachedVerifyRD( sign.getBytes() );
}
@Override
public byte[] attachedVerifyRD(byte[] sign) {
RetWrap retWrap = attachedVerifyAndGetAll(sign);
@@ -10524,6 +10534,10 @@ public class SydApi4j implements SydApi {
* @param sign 已签名数据
* @return 返回CERT_INFO结构的证书数据
*/
public X509 attachedVerifyAndGetX509(String sign) {
return attachedVerifyAndGetX509( sign.getBytes() );
}
public X509 attachedVerifyAndGetX509(byte[] sign) {
RetWrap retWrap = attachedVerifyAndGetAll( sign);
if (retWrap == null)
@@ -10532,6 +10546,10 @@ public class SydApi4j implements SydApi {
return (X509) retWrap.get("x509");
}
public RetWrap attachedVerifyAndGetAll(String sign) {
return attachedVerifyAndGetAll( sign.getBytes() );
}
public RetWrap attachedVerifyAndGetAll(byte[] sign) {
Proto8019 proto = new Proto8019();