import java.io.IOException;
import java.io.PrintWriter;
-import java.security.GeneralSecurityException;
import java.sql.SQLException;
import java.util.HashMap;
}
@Override
- public void doGet(HttpServletRequest req, HttpServletResponse resp)
- throws IOException {
+ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
HashMap<String, Object> vars = new HashMap<String, Object>();
- vars.put("CCA",
- "<a href='/policy/CAcertCommunityAgreement.html'>CCA</a>");
+ vars.put("CCA", "<a href='/policy/CAcertCommunityAgreement.html'>CCA</a>");
getDefaultTemplate().output(resp.getWriter(), getLanguage(req), vars);
}
+
@Override
- public void doPost(HttpServletRequest req, HttpServletResponse resp)
- throws IOException {
+ public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
PrintWriter out = resp.getWriter();
- if (req.getParameter("optionalCSR") == null
- || req.getParameter("optionalCSR").equals("")) {
+ if (req.getParameter("optionalCSR") == null || req.getParameter("optionalCSR").equals("")) {
out.println("csr missing");
ClientCSRGenerate.output(req, resp);
}
// Error.
return;
}
- Certificate c = new Certificate("/commonName=felix@dogcraft.de",
- "sha256", csr);
+ Certificate c = new Certificate("/commonName=CAcert WoT User", "sha256", csr);
c.issue();
try {
c.waitFor(60000);
- out.println(c.getStatus());
- out.println(c.cert());
- } catch (SQLException e1) {
- e1.printStackTrace();
- } catch (GeneralSecurityException e) {
+ resp.sendRedirect(MailCertificates.PATH + "/" + c.getId());
+ } catch (SQLException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
+
}
}