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 java.util.List _jspx_dependants;
013    
014      public Object getDependants() {
015        return _jspx_dependants;
016      }
017    
018      public void _jspService(HttpServletRequest request, HttpServletResponse response)
019            throws java.io.IOException, ServletException {
020    
021        JspFactory _jspxFactory = null;
022        PageContext pageContext = null;
023        HttpSession session = null;
024        ServletContext application = null;
025        ServletConfig config = null;
026        JspWriter out = null;
027        Object page = this;
028        JspWriter _jspx_out = null;
029        PageContext _jspx_page_context = null;
030    
031    
032        try {
033          _jspxFactory = JspFactory.getDefaultFactory();
034          response.setContentType("text/html; charset=ISO-8859-1");
035          pageContext = _jspxFactory.getPageContext(this, request, response,
036                            null, true, 8192, true);
037          _jspx_page_context = pageContext;
038          application = pageContext.getServletContext();
039          config = pageContext.getServletConfig();
040          session = pageContext.getSession();
041          out = pageContext.getOut();
042          _jspx_out = out;
043    
044          out.write("\n\n\n\n");
045    
046        X509Certificate cert = (X509Certificate) CAHelperUtils.getCertificateStore().getCACertificate();
047        request.setAttribute("cert", cert);
048    
049          out.write("\n<!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=\"");
050          out.print(request.getContextPath());
051          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>");
052          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.version}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
053          out.write("</td>\n        </tr>\n        <tr>\n            <th align=\"right\">Subject:</th>\n            <td>");
054          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.subjectDN.name}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
055          out.write("</td>\n        </tr>\n        <tr>\n            <th align=\"right\">Issuer:</th>\n            <td>");
056          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.issuerDN.name}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
057          out.write("</td>\n        </tr>\n        <tr>\n            <th align=\"right\">Serial Number:</th>\n            <td>");
058          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.serialNumber}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
059          out.write("</td>\n        </tr>\n        <tr>\n            <th align=\"right\">Valid From:</th>\n            <td>");
060          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.notBefore}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
061          out.write("</td>\n        </tr>\n        <tr>\n            <th align=\"right\">Valid To:</th>\n            <td>");
062          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.notAfter}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
063          out.write("</td>\n        </tr>\n        <tr>\n            <th align=\"right\">Signature Alg:</th>\n            <td>");
064          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.sigAlgName}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
065          out.write("</td>\n        </tr>\n        <tr>\n            <th align=\"right\">Public Key Alg:</th>\n            <td>");
066          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert.publicKey.algorithm}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
067          out.write("</td>\n        </tr>\n        <tr>\n            <th align=\"right\" valign=\"top\">cert.toString()</th>\n            <td><pre>");
068          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${cert}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
069          out.write("</pre></td>\n        </tr>\n    </table>\n\n</body>\n</html>\n");
070        } catch (Throwable t) {
071          if (!(t instanceof SkipPageException)){
072            out = _jspx_out;
073            if (out != null && out.getBufferSize() != 0)
074              out.clearBuffer();
075            if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
076          }
077        } finally {
078          if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
079        }
080      }
081    }