001    package jsp;
002    
003    import javax.servlet.*;
004    import javax.servlet.http.*;
005    import javax.servlet.jsp.*;
006    import java.security.cert.Certificate;
007    import java.security.cert.X509Certificate;
008    import org.apache.geronimo.ca.helper.util.CAHelperUtils;
009    
010    public final class verifyCertificate_jsp extends org.apache.jasper.runtime.HttpJspBase
011        implements org.apache.jasper.runtime.JspSourceDependent {
012    
013      private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
014    
015      private static java.util.List _jspx_dependants;
016    
017      private javax.el.ExpressionFactory _el_expressionfactory;
018      private org.apache.InstanceManager _jsp_instancemanager;
019    
020      public Object getDependants() {
021        return _jspx_dependants;
022      }
023    
024      public void _jspInit() {
025        _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
026        _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
027      }
028    
029      public void _jspDestroy() {
030      }
031    
032      public void _jspService(HttpServletRequest request, HttpServletResponse response)
033            throws java.io.IOException, ServletException {
034    
035        PageContext pageContext = null;
036        HttpSession session = null;
037        ServletContext application = null;
038        ServletConfig config = null;
039        JspWriter out = null;
040        Object page = this;
041        JspWriter _jspx_out = null;
042        PageContext _jspx_page_context = null;
043    
044    
045        try {
046          response.setContentType("text/html; charset=ISO-8859-1");
047          pageContext = _jspxFactory.getPageContext(this, request, response,
048                            null, true, 8192, true);
049          _jspx_page_context = pageContext;
050          application = pageContext.getServletContext();
051          config = pageContext.getServletConfig();
052          session = pageContext.getSession();
053          out = pageContext.getOut();
054          _jspx_out = out;
055    
056    
057        X509Certificate cert = (X509Certificate)((Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate"))[0];
058        request.setAttribute("cert", cert);
059        CAHelperUtils.removeRequest(request.getParameter("csrId"), cert.getSerialNumber());
060    
061          out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\r\n<title>Verify Certificate Download</title>\r\n</head>\r\n<body>\r\n<h2>Verify Certificate Download</h2>\r\n<p>If you are seeing this page, it means you have successfully downloaded and installed your certificate into your\r\nweb browser. The details of the certificate you used to authenticate with the web server are given below.</p>\r\n\r\n    <table border=\"0\">\r\n        <tr>\r\n            <th colspan=\"2\" align=\"left\">Certificate Details</th>\r\n        </tr>\r\n        <tr>\r\n            <th align=\"right\">Version:</th>\r\n            <td>");
062          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.version}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
063          out.write("</td>\r\n        </tr>\r\n        <tr>\r\n            <th align=\"right\">Subject:</th>\r\n            <td>");
064          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.subjectDN.name}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
065          out.write("</td>\r\n        </tr>\r\n        <tr>\r\n            <th align=\"right\">Issuer:</th>\r\n            <td>");
066          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.issuerDN.name}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
067          out.write("</td>\r\n        </tr>\r\n        <tr>\r\n            <th align=\"right\">Serial Number:</th>\r\n            <td>");
068          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.serialNumber}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
069          out.write("</td>\r\n        </tr>\r\n        <tr>\r\n            <th align=\"right\">Valid From:</th>\r\n            <td>");
070          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.notBefore}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
071          out.write("</td>\r\n        </tr>\r\n        <tr>\r\n            <th align=\"right\">Valid To:</th>\r\n            <td>");
072          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.notAfter}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
073          out.write("</td>\r\n        </tr>\r\n        <tr>\r\n            <th align=\"right\">Signature Alg:</th>\r\n            <td>");
074          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.sigAlgName}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
075          out.write("</td>\r\n        </tr>\r\n        <tr>\r\n            <th align=\"right\">Public Key Alg:</th>\r\n            <td>");
076          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.publicKey.algorithm}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
077          out.write("</td>\r\n        </tr>\r\n        <tr>\r\n            <th align=\"right\" valign=\"top\">cert.toString()</th>\r\n            <td><pre>");
078          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
079          out.write("</pre></td>\r\n        </tr>\r\n    </table>\r\n<a href=\"");
080          out.print(request.getContextPath());
081          out.write("\">Back to CA Helper home</a>\r\n</body>\r\n</html>\r\n");
082        } catch (Throwable t) {
083          if (!(t instanceof SkipPageException)){
084            out = _jspx_out;
085            if (out != null && out.getBufferSize() != 0)
086              try { out.clearBuffer(); } catch (java.io.IOException e) {}
087            if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
088          }
089        } finally {
090          _jspxFactory.releasePageContext(_jspx_page_context);
091        }
092      }
093    }