001    package jsp;
002    
003    import javax.servlet.*;
004    import javax.servlet.http.*;
005    import javax.servlet.jsp.*;
006    import java.security.cert.X509Certificate;
007    import org.apache.geronimo.ca.helper.util.CAHelperUtils;
008    
009    public final class downloadCACertificate_jsp extends org.apache.jasper.runtime.HttpJspBase
010        implements org.apache.jasper.runtime.JspSourceDependent {
011    
012      private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
013    
014      private static java.util.List _jspx_dependants;
015    
016      private javax.el.ExpressionFactory _el_expressionfactory;
017      private org.apache.InstanceManager _jsp_instancemanager;
018    
019      public Object getDependants() {
020        return _jspx_dependants;
021      }
022    
023      public void _jspInit() {
024        _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
025        _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
026      }
027    
028      public void _jspDestroy() {
029      }
030    
031      public void _jspService(HttpServletRequest request, HttpServletResponse response)
032            throws java.io.IOException, ServletException {
033    
034        PageContext pageContext = null;
035        HttpSession session = null;
036        ServletContext application = null;
037        ServletConfig config = null;
038        JspWriter out = null;
039        Object page = this;
040        JspWriter _jspx_out = null;
041        PageContext _jspx_page_context = null;
042    
043    
044        try {
045          response.setContentType("text/html; charset=ISO-8859-1");
046          pageContext = _jspxFactory.getPageContext(this, request, response,
047                            null, true, 8192, true);
048          _jspx_page_context = pageContext;
049          application = pageContext.getServletContext();
050          config = pageContext.getServletConfig();
051          session = pageContext.getSession();
052          out = pageContext.getOut();
053          _jspx_out = out;
054    
055    
056        X509Certificate cert = (X509Certificate) CAHelperUtils.getCertificateStore().getCACertificate();
057        request.setAttribute("cert", cert);
058    
059          out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n<title>Download CA's Certificate</title>\n</head>\n<body>\n<h2>Download CA's Certificate</h2>\n<p>This page enables you to download and install CA's certificate into your web browser. Click on the link below to\ndownload and install CA's certificate.</p>\n\n<a href=\"DownloadCertificateServlet?type=ca\">Download CA's Certificate</a> &nbsp; <a href=\"");
060          out.print(request.getContextPath());
061          out.write("\">Back to CA Helper home</a>\n\n    <table border=\"0\">\n        <tr>\n            <th colspan=\"2\" align=\"left\">Certificate Details</th>\n        </tr>\n        <tr>\n            <th align=\"right\">Version:</th>\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>\n        </tr>\n        <tr>\n            <th align=\"right\">Subject:</th>\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>\n        </tr>\n        <tr>\n            <th align=\"right\">Issuer:</th>\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>\n        </tr>\n        <tr>\n            <th align=\"right\">Serial Number:</th>\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>\n        </tr>\n        <tr>\n            <th align=\"right\">Valid From:</th>\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>\n        </tr>\n        <tr>\n            <th align=\"right\">Valid To:</th>\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>\n        </tr>\n        <tr>\n            <th align=\"right\">Signature Alg:</th>\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>\n        </tr>\n        <tr>\n            <th align=\"right\">Public Key Alg:</th>\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>\n        </tr>\n        <tr>\n            <th align=\"right\" valign=\"top\">cert.toString()</th>\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>\n        </tr>\n    </table>\n\n</body>\n</html>\n");
080        } catch (Throwable t) {
081          if (!(t instanceof SkipPageException)){
082            out = _jspx_out;
083            if (out != null && out.getBufferSize() != 0)
084              try { out.clearBuffer(); } catch (java.io.IOException e) {}
085            if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
086          }
087        } finally {
088          _jspxFactory.releasePageContext(_jspx_page_context);
089        }
090      }
091    }