+ PrintWriter out = resp.getWriter();
+ String pi = req.getPathInfo().substring(PATH.length());
+ if (pi.length() != 0) {
+ pi = pi.substring(1);
+ int id = Integer.parseInt(pi);
+ Certificate c = new Certificate(id);
+ // TODO check ownership
+ out.println("<pre>");
+ try {
+ out.print(c.cert());
+ } catch (GeneralSecurityException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ out.println("</pre>");
+ return;
+ }
+