WXPayConfig 获取配置数据
private byte[] certData;
@PostConstruct
public void init() throws Exception {
Resource resource = new ClassPathResource("cert/weixin/apiclient_cert.p12");
try (InputStream certStream = resource.getInputStream()){
this.certData = new byte[(int) resource.contentLength()];
certStream.read(this.certData);
}
}
@Override
protected InputStream getCertStream() {
ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
return certBis;
}
支付的时候报错:
DerInputStream.getLength(): lengthTag=111, too big.
调用sdk: