+ this.csr = csr;
+ this.csrType = CSRType.CSR;
+ } else if (spkac != null) {
+ this.csr = "SPKAC=" + spkac.replaceAll("[\r\n]", "");
+ this.csrType = CSRType.SPKAC;
+ } else {
+ login = "1".equals(req.getParameter("login"));
+ String hashAlg = req.getParameter("hash_alg");
+ if (hashAlg != null) {
+ selectedDigest = Digest.valueOf(hashAlg);
+ }
+ if (req.getParameter("CCA") == null) {
+ outputError(out, req, "You need to accept the CCA.");
+ return false;
+ }
+ System.out.println("issuing " + selectedDigest);
+ result = new Certificate(LoginPage.getUser(req).getId(), "/commonName=CAcert WoT User",
+ selectedDigest.toString(), this.csr, this.csrType);
+ try {
+ result.issue().waitFor(60000);
+ return true;
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ return false;