+ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
+ 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);
+ if (LoginPage.getUser(req).getId() != c.getOwnerId()) {
+ out.println(translate(req, "You do not own this certificate."));
+ return;
+ }
+ out.println("<pre>");
+ try {
+ out.print(c.cert());
+ } catch (GeneralSecurityException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ out.println("</pre>");
+ return;
+ }
+