修改部分xml文档,java类合并其他库中的接口
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package com.sunyard.inf;
|
||||
|
||||
|
||||
import com.sunyard.RetWrap;
|
||||
import com.sunyard.cert.X509;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* 证书操作相关接口
|
||||
*/
|
||||
@@ -29,6 +32,11 @@ public interface SydCertApi {
|
||||
byte[] dn
|
||||
);
|
||||
|
||||
String RSAGetPublicKeyC(
|
||||
String userId,
|
||||
int nKeyTypes
|
||||
);
|
||||
|
||||
/**
|
||||
* 通过使用者 ID 获得使用者的 SM2 公钥(DER 编码)。
|
||||
* @param userId 使用者的 ID,最大长度为 16 位数字,右对齐。
|
||||
@@ -79,4 +87,19 @@ public interface SydCertApi {
|
||||
String sign
|
||||
);
|
||||
|
||||
/**
|
||||
* 查询所有证书
|
||||
* @param dataFlag 数据包标志 0:起始包 1:中间包 2:结束包
|
||||
* @return
|
||||
*/
|
||||
RetWrap getAllCert(int dataFlag) throws UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* 上传指定证书到加密设备
|
||||
* @param certData 证书的字节数组
|
||||
* @param organizationId 机构号的字节数组
|
||||
* @return
|
||||
*/
|
||||
RetWrap importCert(byte[] certData, byte[] organizationId);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.sunyard.inf;
|
||||
|
||||
import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException;
|
||||
import com.sunyard.RetWrap;
|
||||
|
||||
/**
|
||||
@@ -94,6 +95,77 @@ interface SydASYMApi {
|
||||
String userId,
|
||||
String pEnData
|
||||
);
|
||||
|
||||
/**
|
||||
* 使用外部私钥解密
|
||||
* @param sk
|
||||
* @param enData
|
||||
* @return
|
||||
*/
|
||||
byte[] SM2Decrypt(byte[] sk, String enData);
|
||||
|
||||
/**
|
||||
* 用指定的 RSA 私钥对指定的密文数据进行加密。
|
||||
*
|
||||
* @param publicKey 私钥串,DER 编码,HEX 格式。
|
||||
* @param pOrgData 加密的数据。
|
||||
* @return 加密的数据 base64 编码。
|
||||
*/
|
||||
String RSAEncrypt(
|
||||
String publicKey,
|
||||
byte[] pOrgData
|
||||
);
|
||||
|
||||
/**
|
||||
* 通过使用者 ID 所对应的私钥对指定的密文数据进行解密。
|
||||
*
|
||||
* @param userId 使用者的 ID,最大长度为 16 位数字,右对齐。
|
||||
* @param pEnData 加密的数据,base64 编码。
|
||||
* @return 明文数据。
|
||||
*/
|
||||
byte[] RSADecryptC(
|
||||
String userId,
|
||||
String pEnData
|
||||
) throws Base64DecodingException;
|
||||
|
||||
|
||||
/**
|
||||
* 使用外部私钥解密
|
||||
* @param sk
|
||||
* @param enData
|
||||
* @return
|
||||
*/
|
||||
public byte[] RSADecrypt(String sk, String enData) throws Base64DecodingException;
|
||||
|
||||
|
||||
/**
|
||||
* 非对称公钥加密
|
||||
* @param alg
|
||||
* @param pk
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public byte[] encryptByPk(int alg, String pk, byte[] data);
|
||||
|
||||
|
||||
/**
|
||||
* 非对称私钥解密
|
||||
* @param alg
|
||||
* @param sk 私钥值
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public byte[] decryptBySk(int alg, String sk, byte[] data);
|
||||
|
||||
|
||||
/**
|
||||
* 非对称私钥解密
|
||||
* @param alg
|
||||
* @param user
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public byte[] decryptBySkC(int alg, String user, byte[] data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,19 @@ public interface SydPledge {
|
||||
* @param Data 原始数据
|
||||
* @return MAC 长度为 8 的 HEX字符串
|
||||
*/
|
||||
public String GenerateMIYA(String AreaCode, int Version, int Alg, byte[] Data);
|
||||
String GenerateMIYA(String AreaCode, int Version, int Alg, byte[] Data);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param AreaCode 地区代码 6 位
|
||||
* @param Version 版本号
|
||||
* @param Alg SydApi.NALG_3DES/SydApi.NALG_SM4
|
||||
* @param Data 原始数据
|
||||
* @param fullFlag 填充类型
|
||||
* @param macLenFlag MAC 长度标识
|
||||
* @return
|
||||
*/
|
||||
String GenerateMIYA(String AreaCode, int Version, int Alg, byte[] Data, byte fullFlag, byte macLenFlag);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -21,6 +33,19 @@ public interface SydPledge {
|
||||
* @param Data 原始数据
|
||||
* @return true=核押通过 false=核押不通过
|
||||
*/
|
||||
public boolean VerifyMIYA(String AreaCode, int Version, int Alg, String MAC, byte[] Data);
|
||||
boolean VerifyMIYA(String AreaCode, int Version, int Alg, String MAC, byte[] Data);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param AreaCode 地区代码 6 位
|
||||
* @param Version 版本号
|
||||
* @param Alg SydApi.NALG_3DES/SydApi.NALG_SM4
|
||||
* @param mac 长度为 8 的 HEX字符串
|
||||
* @param Data 原始数据
|
||||
* @param fullFlag 填充类型
|
||||
* @param macLenFlag MAC 长度标识
|
||||
* @return
|
||||
*/
|
||||
boolean VerifyMIYA(String AreaCode, int Version, int Alg, String mac, byte[] Data, byte fullFlag, byte macLenFlag);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user