InputStream is = request.getInputStream();
byte[] data = new byte[request.getContentLength()];
is.read(data, 0, data.length);
Authority.init(this);
Authority CA = new Authority();
if (! CA.createCertificate(data)) {
Status = CA.getStatus();
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
Status);
return;
}
Status = "<pre><code>" + CA.getStatus() + "</pre></code>";
response.setContentType("application/octet-stream");
OutputStream os = response.getOutputStream();
data = CA.getPkiPath();
os.write((byte) (data.length >> 8));
os.write((byte) data.length);
os.write(data);
data = CA.getIssuerAndSerialNumber();
os.write((byte) (data.length >> 8));
os.write((byte) data.length);
os.write(data);
os.flush();