/**
* 微信证书内容
*/
private byte [] certData;
@Override
public InputStream getCertStream() {
try {
// 读取绝对路径
InputStream certStream = new FileInputStream("D:\\apiclient_cert.p12");
ByteArrayOutputStream output = new ByteArrayOutputStream();
byte[] buffer = new byte[4096];
int n = 0;
while (-1 != (n = certStream.read(buffer))) {
output.write(buffer, 0, n);
}
certStream.close();
this.certData = output.toByteArray();
System.err.println(JSONObject.toJSONString(this.certData));
} catch (Exception e) {
e.printStackTrace();
}
return new ByteArrayInputStream(this.certData);
}
