hmac 接口编写完成未调试

This commit is contained in:
Cheney 2024-09-23 18:16:46 +08:00
parent 25803c9d4f
commit e299efe782
2 changed files with 17 additions and 86 deletions

87
pom.xml
View File

@ -4,7 +4,7 @@
<groupId>com.sunyard</groupId> <groupId>com.sunyard</groupId>
<artifactId>sydapi4j</artifactId> <artifactId>sydapi4j</artifactId>
<version>1.0.2022-SNAPSHOT</version> <version>1.13.20220909-1</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>sydapi4j</name> <name>sydapi4j</name>
@ -26,59 +26,11 @@
<version>4.12</version> <version>4.12</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>junitperf</artifactId>
<version>1.0.3</version>
<scope>test</scope>
</dependency>
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/org.apache.commons/commons-pool2 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.apache.commons</groupId>-->
<!-- <artifactId>commons-pool2</artifactId>-->
<!-- <version>2.11.1</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.jetbrains.kotlin</groupId>-->
<!-- <artifactId>kotlin-test</artifactId>-->
<!-- <version>${kotlin.version}</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/dom4j/dom4j &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>dom4j</groupId>-->
<!-- <artifactId>dom4j</artifactId>-->
<!-- <version>1.6.1</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/com.alibaba/fastjson &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>fastjson</artifactId>-->
<!-- <version>1.2.80</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.jetbrains.kotlin</groupId>-->
<!-- <artifactId>kotlin-stdlib-jdk8</artifactId>-->
<!-- <version>${kotlin.version}</version>-->
<!-- </dependency>-->
<!--<dependency>-->
<!--<groupId>com.sunyard</groupId>-->
<!--<artifactId>Converter</artifactId>-->
<!--<version>[1.0.201807251700, 1.1-SNAPSHOT)</version>-->
<!--</dependency>-->
<dependency> <dependency>
<groupId>com.sunyard</groupId> <groupId>com.sunyard</groupId>
<artifactId>proto</artifactId> <artifactId>proto</artifactId>
<version>1.1.20221215</version> <version>1.0.20221215</version>
</dependency> </dependency>
<dependency> <dependency>
@ -87,35 +39,6 @@
<version>5.4.3</version> <version>5.4.3</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.65</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.65</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.4.M1</version>
</dependency>
<!--<dependency>-->
<!--<groupId>club.fullstack</groupId>-->
<!--<artifactId>serialize</artifactId>-->
<!--<version>[1.0.201806051035, 1.1.SNAPSHOT)</version>-->
<!--</dependency>-->
<!-- https://mvnrepository.com/artifact/com.github.wvengen/proguard-maven-plugin -->
<!-- https://mvnrepository.com/artifact/com.github.wvengen/proguard-maven-plugin -->
</dependencies> </dependencies>
<build> <build>
<finalName>sydapi4j</finalName> <finalName>sydapi4j</finalName>
@ -149,8 +72,8 @@
</execution> </execution>
</executions> </executions>
<configuration> <configuration>
<source>6</source> <source>1.6</source>
<target>6</target> <target>1.6</target>
<compilerId>groovy-eclipse-compiler</compilerId> <compilerId>groovy-eclipse-compiler</compilerId>
<verbose>true</verbose> <verbose>true</verbose>
<fork>true</fork> <fork>true</fork>
@ -243,7 +166,7 @@
<configuration> <configuration>
<archive> <archive>
<manifest> <manifest>
<mainClass>com.Sample.TestDemo</mainClass> <mainClass>racal.sunyard.main.Version</mainClass>
</manifest> </manifest>
</archive> </archive>
<descriptorRefs> <descriptorRefs>

View File

@ -12409,11 +12409,13 @@ public class SydApi4j implements SydApi {
@Override @Override
public byte[] attachedVerifyRD(byte[] sign) { public byte[] attachedVerifyRD(byte[] sign) {
RetWrap retWrap = attachedVerifyAndGetAll(sign); RetWrap retWrap = attachedVerifyAndGetAll(sign);
if (retWrap == null) if (retWrap == null) {
return null; return null;
return (byte[]) retWrap.get("oData"); return (byte[]) retWrap.get("oData");
} }
return (String) retWrap.get("oData");
}
/** /**
* 带公钥证书与原始数据的数字签名验签遵循 PKCS#7 * 带公钥证书与原始数据的数字签名验签遵循 PKCS#7
@ -12422,23 +12424,29 @@ public class SydApi4j implements SydApi {
* @param sign 已签名数据 * @param sign 已签名数据
* @return 返回CERT_INFO结构的证书数据 * @return 返回CERT_INFO结构的证书数据
*/ */
@Override
public X509 attachedVerifyAndGetX509(String sign) { public X509 attachedVerifyAndGetX509(String sign) {
return attachedVerifyAndGetX509( sign.getBytes() ); return attachedVerifyAndGetX509( sign.getBytes() );
} }
@Override
public X509 attachedVerifyAndGetX509(byte[] sign) { public X509 attachedVerifyAndGetX509(byte[] sign) {
RetWrap retWrap = attachedVerifyAndGetAll( sign); RetWrap retWrap = attachedVerifyAndGetAll( sign);
if (retWrap == null)
if (retWrap == null) {
return null; return null;
}
return (X509) retWrap.get("x509"); return (X509) retWrap.get("x509");
} }
public RetWrap attachedVerifyAndGetAll(String sign) { public RetWrap attachedVerifyAndGetAll(String sign) {
return attachedVerifyAndGetAll( sign.getBytes() ); return attachedVerifyAndGetAll( sign.getBytes() );
} }
// 大数据兼容处理 // 大数据兼容处理
@Override
public RetWrap attachedVerifyAndGetAll(byte[] sign) { public RetWrap attachedVerifyAndGetAll(byte[] sign) {
if( sign.length > 4096 ) { if( sign.length > 4096 ) {