去除sun.misc.BASE64Encoder依赖
This commit is contained in:
parent
881e3f6445
commit
73ad09279e
@ -4,11 +4,11 @@ import com.sunyard.cert.X509;
|
|||||||
import com.sunyard.proto.Util;
|
import com.sunyard.proto.Util;
|
||||||
import racal.sunyard.main.SydApi4j;
|
import racal.sunyard.main.SydApi4j;
|
||||||
import racal.sunyard.main.SydApiBuilder;
|
import racal.sunyard.main.SydApiBuilder;
|
||||||
import sun.misc.BASE64Encoder;
|
|
||||||
import sun.security.provider.X509Factory;
|
import sun.security.provider.X509Factory;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
import java.util.Base64;
|
||||||
|
|
||||||
public class RSAP1SignVerify {
|
public class RSAP1SignVerify {
|
||||||
private static byte[] createBlock(byte type, byte[] in) {
|
private static byte[] createBlock(byte type, byte[] in) {
|
||||||
@ -106,8 +106,8 @@ public class RSAP1SignVerify {
|
|||||||
byte[] bSource = source.getBytes();
|
byte[] bSource = source.getBytes();
|
||||||
|
|
||||||
byte[] derCert = Util.decodeBase64(signCert);
|
byte[] derCert = Util.decodeBase64(signCert);
|
||||||
BASE64Encoder encoder = new BASE64Encoder();
|
Base64.Encoder encoder = Base64.getEncoder();
|
||||||
cert = X509Factory.BEGIN_CERT + "\n" + encoder.encodeBuffer(derCert) + X509Factory.END_CERT;
|
cert = X509Factory.BEGIN_CERT + "\n" + encoder.encodeToString(derCert) + X509Factory.END_CERT;
|
||||||
X509 X509Cert = api.GetX509CertInfo(cert);
|
X509 X509Cert = api.GetX509CertInfo(cert);
|
||||||
|
|
||||||
byte[] signature = Util.decodeBase64(signatureBase64);
|
byte[] signature = Util.decodeBase64(signatureBase64);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user