summaryrefslogtreecommitdiffstats
path: root/base/ra/apache
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-11-21 13:28:22 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-12-03 11:40:25 -0500
commit538dee3554b0a84497afa78770706a5ad4a8ff52 (patch)
tree239fa83c28241f3d4d8b6ba27214db539fc9cb19 /base/ra/apache
parent35dc1009494453803d22573ef876c8b418a609d3 (diff)
downloadpki-538dee3554b0a84497afa78770706a5ad4a8ff52.tar.gz
pki-538dee3554b0a84497afa78770706a5ad4a8ff52.tar.xz
pki-538dee3554b0a84497afa78770706a5ad4a8ff52.zip
Reorganized RA templates and scripts.
The templates, JS, and CGI scripts for RA have been moved into the RA core package. Ticket #407
Diffstat (limited to 'base/ra/apache')
-rwxr-xr-xbase/ra/apache/docroot/404.html146
-rwxr-xr-xbase/ra/apache/docroot/500.html139
-rwxr-xr-xbase/ra/apache/docroot/admin/group/add.cgi86
-rwxr-xr-xbase/ra/apache/docroot/admin/group/add_member.cgi80
-rwxr-xr-xbase/ra/apache/docroot/admin/group/add_new.cgi86
-rw-r--r--base/ra/apache/docroot/admin/group/add_new.vm83
-rwxr-xr-xbase/ra/apache/docroot/admin/group/delete.cgi79
-rwxr-xr-xbase/ra/apache/docroot/admin/group/delete_member.cgi79
-rwxr-xr-xbase/ra/apache/docroot/admin/group/index.cgi115
-rw-r--r--base/ra/apache/docroot/admin/group/index.vm81
-rwxr-xr-xbase/ra/apache/docroot/admin/group/read.cgi125
-rw-r--r--base/ra/apache/docroot/admin/group/read.vm104
-rwxr-xr-xbase/ra/apache/docroot/admin/index.cgi80
-rw-r--r--base/ra/apache/docroot/admin/index.vm95
-rwxr-xr-xbase/ra/apache/docroot/admin/user/add.cgi99
-rwxr-xr-xbase/ra/apache/docroot/admin/user/add_new.cgi87
-rw-r--r--base/ra/apache/docroot/admin/user/add_new.vm95
-rwxr-xr-xbase/ra/apache/docroot/admin/user/delete.cgi79
-rwxr-xr-xbase/ra/apache/docroot/admin/user/index.cgi118
-rw-r--r--base/ra/apache/docroot/admin/user/index.vm83
-rwxr-xr-xbase/ra/apache/docroot/admin/user/read.cgi97
-rw-r--r--base/ra/apache/docroot/admin/user/read.vm88
-rwxr-xr-xbase/ra/apache/docroot/agent/cert/index.cgi119
-rw-r--r--base/ra/apache/docroot/agent/cert/index.vm86
-rwxr-xr-xbase/ra/apache/docroot/agent/cert/read.cgi104
-rw-r--r--base/ra/apache/docroot/agent/cert/read.vm96
-rwxr-xr-xbase/ra/apache/docroot/agent/cert/revoke.cgi89
-rw-r--r--base/ra/apache/docroot/agent/cert/revoke.vm111
-rwxr-xr-xbase/ra/apache/docroot/agent/cert/submit.cgi104
-rw-r--r--base/ra/apache/docroot/agent/cert/submit.vm91
-rwxr-xr-xbase/ra/apache/docroot/agent/error.cgi81
-rw-r--r--base/ra/apache/docroot/agent/error.vm72
-rwxr-xr-xbase/ra/apache/docroot/agent/index.cgi83
-rw-r--r--base/ra/apache/docroot/agent/index.vm81
-rwxr-xr-xbase/ra/apache/docroot/agent/request/add_note.cgi93
-rwxr-xr-xbase/ra/apache/docroot/agent/request/index.cgi146
-rw-r--r--base/ra/apache/docroot/agent/request/index.vm95
-rwxr-xr-xbase/ra/apache/docroot/agent/request/op.cgi153
-rw-r--r--base/ra/apache/docroot/agent/request/op.vm127
-rwxr-xr-xbase/ra/apache/docroot/agent/request/read.cgi119
-rw-r--r--base/ra/apache/docroot/agent/request/read.vm149
-rwxr-xr-xbase/ra/apache/docroot/ee/agent/enroll.cgi127
-rw-r--r--base/ra/apache/docroot/ee/agent/enroll.vm74
-rwxr-xr-xbase/ra/apache/docroot/ee/agent/index.cgi68
-rw-r--r--base/ra/apache/docroot/ee/agent/index.vm83
-rwxr-xr-xbase/ra/apache/docroot/ee/agent/new.cgi68
-rw-r--r--base/ra/apache/docroot/ee/agent/new.vm88
-rwxr-xr-xbase/ra/apache/docroot/ee/agent/start.cgi69
-rw-r--r--base/ra/apache/docroot/ee/agent/start.vm114
-rwxr-xr-xbase/ra/apache/docroot/ee/agent/submit.cgi88
-rw-r--r--base/ra/apache/docroot/ee/agent/submit.vm73
-rwxr-xr-xbase/ra/apache/docroot/ee/error.cgi81
-rw-r--r--base/ra/apache/docroot/ee/error.vm71
-rwxr-xr-xbase/ra/apache/docroot/ee/index.cgi68
-rw-r--r--base/ra/apache/docroot/ee/index.vm102
-rwxr-xr-xbase/ra/apache/docroot/ee/request/getcert.cgi93
-rw-r--r--base/ra/apache/docroot/ee/request/getcert.vm72
-rwxr-xr-xbase/ra/apache/docroot/ee/request/importcert.cgi82
-rwxr-xr-xbase/ra/apache/docroot/ee/request/index.cgi68
-rw-r--r--base/ra/apache/docroot/ee/request/index.vm67
-rwxr-xr-xbase/ra/apache/docroot/ee/request/status.cgi94
-rw-r--r--base/ra/apache/docroot/ee/request/status.vm91
-rwxr-xr-xbase/ra/apache/docroot/ee/scep/enroll.cgi112
-rw-r--r--base/ra/apache/docroot/ee/scep/enroll.vm74
-rwxr-xr-xbase/ra/apache/docroot/ee/scep/index.cgi68
-rw-r--r--base/ra/apache/docroot/ee/scep/index.vm83
-rwxr-xr-xbase/ra/apache/docroot/ee/scep/installer.cgi74
-rw-r--r--base/ra/apache/docroot/ee/scep/installer.vm73
-rwxr-xr-xbase/ra/apache/docroot/ee/scep/manager.cgi68
-rw-r--r--base/ra/apache/docroot/ee/scep/manager.vm123
-rwxr-xr-xbase/ra/apache/docroot/ee/scep/pkiclient.cgi113
-rwxr-xr-xbase/ra/apache/docroot/ee/scep/submit.cgi91
-rw-r--r--base/ra/apache/docroot/ee/scep/submit.vm76
-rwxr-xr-xbase/ra/apache/docroot/ee/server/admin.cgi68
-rw-r--r--base/ra/apache/docroot/ee/server/admin.vm132
-rwxr-xr-xbase/ra/apache/docroot/ee/server/index.cgi68
-rw-r--r--base/ra/apache/docroot/ee/server/index.vm76
-rwxr-xr-xbase/ra/apache/docroot/ee/server/submit.cgi93
-rw-r--r--base/ra/apache/docroot/ee/server/submit.vm75
-rwxr-xr-xbase/ra/apache/docroot/ee/user/index.cgi68
-rw-r--r--base/ra/apache/docroot/ee/user/index.vm83
-rwxr-xr-xbase/ra/apache/docroot/ee/user/renew.cgi165
-rw-r--r--base/ra/apache/docroot/ee/user/renew.vm86
-rwxr-xr-xbase/ra/apache/docroot/ee/user/renewal.cgi74
-rw-r--r--base/ra/apache/docroot/ee/user/renewal.vm73
-rwxr-xr-xbase/ra/apache/docroot/ee/user/submit.cgi112
-rw-r--r--base/ra/apache/docroot/ee/user/submit.vm75
-rwxr-xr-xbase/ra/apache/docroot/ee/user/user.cgi68
-rw-r--r--base/ra/apache/docroot/ee/user/user.vm435
-rw-r--r--base/ra/apache/docroot/footer.vm19
-rw-r--r--base/ra/apache/docroot/header.vm26
-rwxr-xr-xbase/ra/apache/docroot/index.cgi76
-rw-r--r--base/ra/apache/docroot/index.vm90
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/adminauthenticatepanel.vm52
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/adminpanel.vm237
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/agentauthenticatepanel.vm48
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/authdbpanel.vm66
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/cainfopanel.vm55
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/certchainpanel.vm49
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/certprettyprintpanel.vm49
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/certrequestpanel.vm225
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/config_addhsm.vm96
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/config_db.vm126
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/config_hsm.vm176
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/config_hsmloginpanel.vm83
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/config_join.vm125
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/config_rootca.vm113
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/createsubsystempanel.vm95
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/databasepanel.vm53
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/displaycertchain2panel.vm41
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/displaycertchainpanel.vm41
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/donepanel.vm42
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/drminfopanel.vm56
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/footer.vm20
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/header.vm26
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/hierarchypanel.vm80
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/importadmincertpanel.vm56
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/login.vm110
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/modulepanel.vm158
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/namepanel.vm91
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/securitydomainloginpanel.vm109
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/securitydomainpanel.vm115
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/sidemenu.vm30
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/sizepanel.vm235
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/tksinfopanel.vm51
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/topmenu.vm21
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/welcomepanel.vm57
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/wizard.vm144
-rw-r--r--base/ra/apache/docroot/ra/admin/console/config/xml.vm4
-rw-r--r--base/ra/apache/docroot/ra/admin/console/js/misc.js30
130 files changed, 11946 insertions, 0 deletions
diff --git a/base/ra/apache/docroot/404.html b/base/ra/apache/docroot/404.html
new file mode 100755
index 000000000..39997a669
--- /dev/null
+++ b/base/ra/apache/docroot/404.html
@@ -0,0 +1,146 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2009 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<script language=javascript>
+var url = document.URL;
+var protocol = location.protocol;
+var hostname = location.hostname;
+var port = location.port;
+</script>
+
+<head>
+<title>RA 404 Error!</title>
+<!-- always expand ALL relative paths -->
+<script language=javascript>
+document.write('<link rel="shortcut icon" href="');
+document.write(protocol);
+document.write('//');
+document.write(hostname);
+document.write(':');
+document.write(port);
+document.write('/pki/images/favicon.ico');
+document.write('" />');
+document.write('<link rel="stylesheet" href="');
+document.write(protocol);
+document.write('//');
+document.write(hostname);
+document.write(':');
+document.write(port);
+document.write('/pki/css/pki-base.css');
+document.write('" type="text/css" />');
+document.write('<META http-equiv=Content-Type content="text/html; charset=UTF-8">');
+</script>
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+<div id="header">
+<!-- always expand ALL relative paths -->
+<script language=javascript>
+document.write('<a href="http://pki.fedoraproject.org/" title="Visit pki.fedoraproject.org for more information about Dogtag products and services"><img src="');
+document.write(protocol);
+document.write('//');
+document.write(hostname);
+document.write(':');
+document.write(port);
+document.write('/pki/images/logo_header.gif');
+document.write('" alt="Dogtag" id="myLogo" /></a>');
+</script>
+ <div id="headertitle">
+ <a href="/" title="Dogtag Network homepage">Dogtag<sup><font size="-2">&reg;</font></sup> Certificate System</a>
+ </div>
+ <div id="account">
+ <dl><dt><span></span></dt><dd></dd></dl>
+ </div>
+</div>
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+Certificate System RA Error Page
+</font><br>
+<p>
+</font>
+<p>
+<script language=javascript>
+document.write('<center>');
+document.write('<table border="1" cellspacing="0" cellpadding="0">');
+document.write('<tr valign="TOP">');
+document.write('<td bgcolor="grey" align="center"><b><font color="BLACK">HTTP STATUS</font></b></td>');
+document.write('<td bgcolor="grey" align="center"><b><font color="BLACK">DESCRIPTION</font></b></td>');
+document.write('</tr>');
+document.write('<tr valign="TOP">');
+document.write('<td align="center"><b><font size="+3" color="red">');
+document.write('404');
+document.write('</font></b></td>');
+document.write('<td><b><font size="+1" color="RED">');
+document.write('The requested resource could not be found but may be available again in the future.');
+document.write('</font></b><br><b><font size="+1" color="RED">');
+document.write('Please check the validity of the URL listed below:');
+document.write('</font></b><br><br>');
+document.write('<center><b><font size="+1"><a href="');
+document.write(url);
+document.write('">');
+document.write(url);
+document.write('</a>');
+document.write('</font></b></center><br></td>');
+document.write('</tr>');
+document.write('</table>');
+document.write('</center>');
+</script>
+<div id="footer">
+</div>
+<!--
+To prevent Internet Explorer from overriding the display of this custom error
+page by displaying it's own "Friendly HTTP Error Message", always include the
+following 'padding' to ensure that the text size exceeds 512 bytes:
+
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+-->
+</body>
+</html>
+
diff --git a/base/ra/apache/docroot/500.html b/base/ra/apache/docroot/500.html
new file mode 100755
index 000000000..2d560a684
--- /dev/null
+++ b/base/ra/apache/docroot/500.html
@@ -0,0 +1,139 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2009 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<script language=javascript>
+var url = document.URL;
+var protocol = location.protocol;
+var hostname = location.hostname;
+var port = location.port;
+</script>
+
+<head>
+<title>RA 500 Error!</title>
+<!-- always expand ALL relative paths -->
+<script language=javascript>
+document.write('<link rel="shortcut icon" href="');
+document.write(protocol);
+document.write('//');
+document.write(hostname);
+document.write(':');
+document.write(port);
+document.write('/pki/images/favicon.ico');
+document.write('" />');
+document.write('<link rel="stylesheet" href="');
+document.write(protocol);
+document.write('//');
+document.write(hostname);
+document.write(':');
+document.write(port);
+document.write('/pki/css/pki-base.css');
+document.write('" type="text/css" />');
+document.write('<META http-equiv=Content-Type content="text/html; charset=UTF-8">');
+</script>
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+<div id="header">
+<!-- always expand ALL relative paths -->
+<script language=javascript>
+document.write('<a href="http://pki.fedoraproject.org/" title="Visit pki.fedoraproject.org for more information about Dogtag products and services"><img src="');
+document.write(protocol);
+document.write('//');
+document.write(hostname);
+document.write(':');
+document.write(port);
+document.write('/pki/images/logo_header.gif');
+document.write('" alt="Dogtag" id="myLogo" /></a>');
+</script>
+ <div id="headertitle">
+ <a href="/" title="Dogtag Network homepage">Dogtag<sup><font size="-2">&reg;</font></sup> Certificate System</a>
+ </div>
+ <div id="account">
+ <dl><dt><span></span></dt><dd></dd></dl>
+ </div>
+</div>
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+Certificate System RA Error Page
+</font><br>
+<p>
+</font>
+<p>
+<script language=javascript>
+document.write('<center>');
+document.write('<table border="1" cellspacing="0" cellpadding="0">');
+document.write('<tr valign="TOP">');
+document.write('<td bgcolor="grey" align="center"><b><font color="BLACK">HTTP STATUS</font></b></td>');
+document.write('<td bgcolor="grey" align="center"><b><font color="BLACK">DESCRIPTION</font></b></td>');
+document.write('</tr>');
+document.write('<tr valign="TOP">');
+document.write('<td align="center"><b><font size="+3" color="red">');
+document.write('500');
+document.write('</font></b></td>');
+document.write('<td><b><font size="+1" color="RED">');
+document.write('The server encountered an unexpected condition which prevented it from fulfilling the request.<br>');
+document.write('Please consult your local administrator for further assistance. The Certificate System logs may provide further information.');
+document.write('</font></b><br></td>');
+document.write('</tr>');
+document.write('</table>');
+document.write('</center>');
+</script>
+<div id="footer">
+</div>
+<!--
+To prevent Internet Explorer from overriding the display of this custom error
+page by displaying it's own "Friendly HTTP Error Message", always include the
+following 'padding' to ensure that the text size exceeds 512 bytes:
+
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+[IE padding][IE padding][IE padding][IE padding][IE padding][IE padding]
+-->
+</body>
+</html>
+
diff --git a/base/ra/apache/docroot/admin/group/add.cgi b/base/ra/apache/docroot/admin/group/add.cgi
new file mode 100755
index 000000000..212330d0d
--- /dev/null
+++ b/base/ra/apache/docroot/admin/group/add.cgi
@@ -0,0 +1,86 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Request::Queue;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->admin_auth($cfg)) {
+ print $q->redirect("/admin/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my $gid = $util->get_val($q->param('gid'));
+ my $name = $util->get_val($q->param('name'));
+
+ my $store = PKI::Base::UserStore->new();
+ $store->open($cfg);
+ my $ref = $store->read_group($gid);
+ if (defined($ref)) {
+ # gid used
+ print $q->redirect("/admin/group/add_new.cgi?error=exist");
+ return;
+ }
+ my $ref = $store->add_group($gid, $name);
+ $store->close();
+
+ print $q->redirect("/admin/group/index.cgi");
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/admin/group/add_member.cgi b/base/ra/apache/docroot/admin/group/add_member.cgi
new file mode 100755
index 000000000..d60fe965e
--- /dev/null
+++ b/base/ra/apache/docroot/admin/group/add_member.cgi
@@ -0,0 +1,80 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+use PKI::Request::Queue;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->admin_auth($cfg)) {
+ print $q->redirect("/admin/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my $gid = $util->get_val($q->param('gid'));
+ my $userid = $util->get_val($q->param('uid'));
+
+ my $store = PKI::Base::UserStore->new();
+ $store->open($cfg);
+ $store->add_user_to_group($gid, $userid);
+ $store->close();
+
+ print $q->redirect("/admin/group/read.cgi?gid=" . $gid);
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/admin/group/add_new.cgi b/base/ra/apache/docroot/admin/group/add_new.cgi
new file mode 100755
index 000000000..5a1ca7eda
--- /dev/null
+++ b/base/ra/apache/docroot/admin/group/add_new.cgi
@@ -0,0 +1,86 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Request::Queue;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->admin_auth($cfg)) {
+ print $q->redirect("/admin/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+ my $error = $q->param('error');
+ $context{error} = $util->html_encode($error);
+
+ my $result = $parser->execute_file_with_context("admin/group/add_new.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/admin/group/add_new.vm b/base/ra/apache/docroot/admin/group/add_new.vm
new file mode 100644
index 000000000..e9fac77b8
--- /dev/null
+++ b/base/ra/apache/docroot/admin/group/add_new.vm
@@ -0,0 +1,83 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Add New Group</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/admin/index.cgi">Administrator Interface</a>
+</font><br>
+<p>
+#if ($error == 'exist')
+<font color=red>Group already exists</font>
+<p>
+#end
+<center>
+<form name="add_new_form" method=post action="add.cgi">
+<table>
+<tr>
+ <td><b>GID</b></td>
+ <td><input type=text name="gid" value=""></td>
+</tr>
+<tr>
+ <td><b>Name</b></td>
+ <td><input type=text name="name" value=""></td>
+</tr>
+</table>
+</form>
+<a href="#" onclick="document.add_new_form.submit();">Add Group</a>
+</center>
+<p>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/admin/group/delete.cgi b/base/ra/apache/docroot/admin/group/delete.cgi
new file mode 100755
index 000000000..5fb1f22ce
--- /dev/null
+++ b/base/ra/apache/docroot/admin/group/delete.cgi
@@ -0,0 +1,79 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Request::Queue;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->admin_auth($cfg)) {
+ print $q->redirect("/admin/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my $gid = $util->get_val($q->param('gid'));
+
+ my $store = PKI::Base::UserStore->new();
+ $store->open($cfg);
+ $store->delete_group($gid);
+ $store->close();
+
+ print $q->redirect("/admin/group/index.cgi");
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/admin/group/delete_member.cgi b/base/ra/apache/docroot/admin/group/delete_member.cgi
new file mode 100755
index 000000000..2e516eeee
--- /dev/null
+++ b/base/ra/apache/docroot/admin/group/delete_member.cgi
@@ -0,0 +1,79 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Request::Queue;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->admin_auth($cfg)) {
+ print $q->redirect("/admin/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my $gid = $util->get_val($q->param('gid'));
+ my $userid = $util->get_val($q->param('uid'));
+
+ my $store = PKI::Base::UserStore->new();
+ $store->open($cfg);
+ $store->delete_user_from_group($gid, $userid);
+ $store->close();
+
+ print $q->redirect("/admin/group/read.cgi?gid=" . $gid);
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/admin/group/index.cgi b/base/ra/apache/docroot/admin/group/index.cgi
new file mode 100755
index 000000000..07dc653e6
--- /dev/null
+++ b/base/ra/apache/docroot/admin/group/index.cgi
@@ -0,0 +1,115 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Request::Queue;
+use PKI::Base::Registry;
+use Encode;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+
+ my $util = PKI::Base::Util->new();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->admin_auth($cfg)) {
+ print $q->redirect("/admin/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my $sp = $util->get_alphanum_val($q->param('sp'));
+ if ($sp eq "") {
+ $sp = "0";
+ }
+ $context{sp} = $sp;
+ my $mc = $util->get_alphanum_val($q->param('mc'));
+ if ($mc eq "") {
+ $mc = "20";
+ }
+ $context{mc} = $mc;
+ $context{pp} = $sp - $mc; # previous pos (for paging)
+ $context{np} = $sp + $mc; # next pos (for paging)
+
+ my $store = PKI::Base::UserStore->new();
+ $store->open($cfg);
+ my @groups = $store->list_groups($sp, $mc);
+ $store->close();
+
+ my @r;
+ my $i = 0;
+ foreach my $group (@groups) {
+ $r[$i] = new PKI::RA::GlobalVar(
+ getGID => sub { return $util->html_encode(Encode::decode('UTF-8', $group->{'gid'})) },
+ getName => sub { return $util->html_encode(Encode::decode('UTF-8', $group->{'name'})) },
+ );
+ $i++;
+ }
+ $context{rows} = \@r;
+
+ my $result = $parser->execute_file_with_context("admin/group/index.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/admin/group/index.vm b/base/ra/apache/docroot/admin/group/index.vm
new file mode 100644
index 000000000..d19cacd2d
--- /dev/null
+++ b/base/ra/apache/docroot/admin/group/index.vm
@@ -0,0 +1,81 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA Admin</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/admin/index.cgi">Administrator Interface</a>
+</font><br>
+<p>
+<a href="add_new.cgi">Add New Group</a>
+<p>
+<center>
+<table border="1" cellspacing="1" cellpadding="1">
+<tr valign="TOP">
+<td><b>GID</b></td>
+<td><b>Name</b></td>
+</tr>
+#foreach($r in $rows)
+<tr valign="TOP">
+<td><a href="read.cgi?gid=$r.getGID()">$r.getGID()</a></td>
+<td>$r.getName()</td>
+</tr>
+#end
+</table>
+</center>
+<p>
+<a href="index.cgi?sp=$pp&mc=$mc">Previous</a> | <a href="index.cgi?sp=$np&mc=$mc">Next</a>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/admin/group/read.cgi b/base/ra/apache/docroot/admin/group/read.cgi
new file mode 100755
index 000000000..9ede3aa53
--- /dev/null
+++ b/base/ra/apache/docroot/admin/group/read.cgi
@@ -0,0 +1,125 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Request::Queue;
+use PKI::Base::Registry;
+use Encode;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->admin_auth($cfg)) {
+ print $q->redirect("/admin/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my $gid = $util->get_val($q->param('gid'));
+
+ my $store = PKI::Base::UserStore->new();
+ $store->open($cfg);
+ my $ref = $store->read_group($gid);
+
+ $context{gid} = $util->html_encode(Encode::decode('UTF-8', $ref->{'gid'}));
+ $context{name} = $util->html_encode(Encode::decode('UTF-8', $ref->{'name'}));
+
+ my @members = $store->list_all_members($gid);
+ my @users = $store->list_all_non_members($gid);
+ $store->close();
+
+ # new member in the group
+ my @r;
+ my $i = 0;
+ foreach my $member (@members) {
+ $r[$i] = new PKI::RA::GlobalVar(
+ getUID => sub { return $util->html_encode($member->{'uid'}) },
+ );
+ $i++;
+ }
+ $context{members} = \@r;
+
+ # read users
+ my @u;
+ $i = 0;
+ foreach my $user (@users) {
+ $u[$i] = new PKI::RA::GlobalVar(
+ getUID => sub { return $util->html_encode($user->{'uid'}) },
+ );
+ $i++;
+ }
+ if ($i == 0) {
+ $context{non_member_exists} = 0;
+ } else {
+ $context{non_member_exists} = 1;
+ }
+ $context{users} = \@u;
+
+ my $result = $parser->execute_file_with_context("admin/group/read.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/admin/group/read.vm b/base/ra/apache/docroot/admin/group/read.vm
new file mode 100644
index 000000000..9aa8c8e1f
--- /dev/null
+++ b/base/ra/apache/docroot/admin/group/read.vm
@@ -0,0 +1,104 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Groups</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/admin/index.cgi">Administrator Interface</a>
+</font><br>
+<p>
+<center>
+<table border="1" cellspacing="1" cellpadding="1">
+<tr valign="TOP">
+ <td><b>GID</b></td>
+ <td>$gid</td>
+</tr>
+<tr valign="TOP">
+ <td><b>Name</b></td>
+ <td>$name</td>
+</tr>
+</table>
+</center>
+<p>
+<a href="delete.cgi?gid=$gid">Delete This Group</a>
+<p>
+-----------------------------------------------
+<br/>
+<b>Members</b>
+<center>
+<table border="0" cellspacing="1" cellpadding="1">
+#foreach($r in $members)
+<tr valign="TOP">
+<td><a href="../user/read.cgi?uid=$r.getUID()">$r.getUID()</a> <a href="delete_member.cgi?gid=$gid&uid=$r.getUID()">[Delete]</a></td>
+</tr>
+#end
+</table>
+</center>
+<br/>
+-----------------------------------------------
+<br/>
+#if ($non_member_exists)
+<b>New Member</b>
+<form name=new_member_form method=post action="add_member.cgi">
+<input type=hidden name=gid value="$gid">
+<select name=uid>
+#foreach ($u in $users)
+ <option value="$u.getUID()">$u.getUID()</option>
+#end
+</select> <a href="#" onclick="document.new_member_form.submit();">Add</a>
+</form>
+#end
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/admin/index.cgi b/base/ra/apache/docroot/admin/index.cgi
new file mode 100755
index 000000000..2db7b2500
--- /dev/null
+++ b/base/ra/apache/docroot/admin/index.cgi
@@ -0,0 +1,80 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::UserStore;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->admin_auth($cfg)) {
+ print $q->redirect("/agent/error.cgi?error=Authentication%20Error");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $uid;
+
+ my $result = $parser->execute_file_with_context("admin/index.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/admin/index.vm b/base/ra/apache/docroot/admin/index.vm
new file mode 100644
index 000000000..c6add6e6a
--- /dev/null
+++ b/base/ra/apache/docroot/admin/index.vm
@@ -0,0 +1,95 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA Admin</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+RA Admin Services
+</font><br>
+<p>
+<center>
+<table border="0" cellspacing="0" cellpadding="0">
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="/admin/user/index.cgi">List Users</a></li>
+</font>
+</td>
+</tr>
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="/admin/user/add_new.cgi">Add New User</a></li>
+</font>
+</td>
+</tr>
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="/admin/group/index.cgi">List Groups</a></li>
+</font>
+</td>
+</tr>
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="/admin/group/add_new.cgi">Add New Group</a></li>
+</font>
+</td>
+</tr>
+</table>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/admin/user/add.cgi b/base/ra/apache/docroot/admin/user/add.cgi
new file mode 100755
index 000000000..94c4bae81
--- /dev/null
+++ b/base/ra/apache/docroot/admin/user/add.cgi
@@ -0,0 +1,99 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Request::Queue;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->admin_auth($cfg)) {
+ print $q->redirect("/admin/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $uid;
+
+ my $userid = $util->get_val($q->param('uid'));
+ my $name = $util->get_val($q->param('name'));
+ my $email = $util->get_val($q->param('email'));
+ my $certificate = $util->get_val($q->param('certificate'));
+
+ if ($certificate =~ /BEGIN CERTIFICATE/ ||
+ $certificate =~ /END CERTIFICATE/) {
+ # do nothing
+ } else {
+ print $q->redirect("/admin/user/add_new.cgi?error=cert_header");
+ return;
+ }
+ $certificate =~ s/-----BEGIN CERTIFICATE-----//g;
+ $certificate =~ s/-----END CERTIFICATE-----//g;
+ $certificate =~ s/[\r\n]//g;
+
+ my $store = PKI::Base::UserStore->new();
+ $store->open($cfg);
+ my $ref = $store->read_user($userid);
+ if (defined($ref)) {
+ # uid used
+ print $q->redirect("/admin/user/add_new.cgi?error=exist");
+ return;
+ }
+ my $ref = $store->add_user($userid, $name, $email, $certificate);
+ $store->close();
+
+ print $q->redirect("/admin/user/index.cgi");
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/admin/user/add_new.cgi b/base/ra/apache/docroot/admin/user/add_new.cgi
new file mode 100755
index 000000000..8bfbd0e9e
--- /dev/null
+++ b/base/ra/apache/docroot/admin/user/add_new.cgi
@@ -0,0 +1,87 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Request::Queue;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->admin_auth($cfg)) {
+ print $q->redirect("/admin/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $uid;
+
+ my $error = $util->get_val($q->param('error'));
+ $context{error} = $error;
+
+ my $result = $parser->execute_file_with_context("admin/user/add_new.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/admin/user/add_new.vm b/base/ra/apache/docroot/admin/user/add_new.vm
new file mode 100644
index 000000000..4d90d4840
--- /dev/null
+++ b/base/ra/apache/docroot/admin/user/add_new.vm
@@ -0,0 +1,95 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Add New User</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/admin/index.cgi">Administrator Interface</a>
+</font><br>
+<p>
+#if ($error == 'exist')
+<font color=red>User already exists</font>
+<p>
+#end
+#if ($error == 'cert_header')
+<font color=red>Invalid Certificate header</font>
+<p>
+#end
+<center>
+<form name="add_new_form" method=post action="add.cgi">
+<table>
+<tr>
+ <td><b>UID</b></td>
+ <td><input type=text name="uid" value=""></td>
+</tr>
+<tr>
+ <td><b>Name</b></td>
+ <td><input type=text name="name" value=""></td>
+</tr>
+<tr>
+ <td><b>Email</b></td>
+ <td><input type=text name="email" value=""></td>
+</tr>
+<tr>
+ <td><b>Certificate</b></td>
+ <td><textarea name=certificate></textarea></td>
+</tr>
+</table>
+</form>
+<a href="#" onclick="document.add_new_form.submit();">Add User</a>
+</center>
+<p>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/admin/user/delete.cgi b/base/ra/apache/docroot/admin/user/delete.cgi
new file mode 100755
index 000000000..707035edb
--- /dev/null
+++ b/base/ra/apache/docroot/admin/user/delete.cgi
@@ -0,0 +1,79 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Request::Queue;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my $util = PKI::Base::Util->new();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->admin_auth($cfg)) {
+ print $q->redirect("/admin/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $uid;
+
+ my $userid = $util->get_val($q->param('uid'));
+
+ my $store = PKI::Base::UserStore->new();
+ $store->open($cfg);
+ $store->delete_user($userid);
+ $store->close();
+
+ print $q->redirect("/admin/user/index.cgi");
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/admin/user/index.cgi b/base/ra/apache/docroot/admin/user/index.cgi
new file mode 100755
index 000000000..c845ae1dc
--- /dev/null
+++ b/base/ra/apache/docroot/admin/user/index.cgi
@@ -0,0 +1,118 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Request::Queue;
+use PKI::Base::Registry;
+use Encode;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my $util = PKI::Base::Util->new();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->admin_auth($cfg)) {
+ print $q->redirect("/admin/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $uid;
+
+ my $status = $util->get_alphanum_val($q->param('status'));
+ $context{status} = $status;
+
+ my $sp = $util->get_alphanum_val($q->param('sp'));
+ if ($sp eq "") {
+ $sp = "0";
+ }
+ $context{sp} = $sp;
+ my $mc = $util->get_alphanum_val($q->param('mc'));
+ if ($mc eq "") {
+ $mc = "20";
+ }
+ $context{mc} = $mc;
+ $context{pp} = $sp - $mc; # previous pos (for paging)
+ $context{np} = $sp + $mc; # next pos (for paging)
+
+ my $store = PKI::Base::UserStore->new();
+ $store->open($cfg);
+ my @users = $store->list_users($sp, $mc);
+ $store->close();
+
+ my @r;
+ my $i = 0;
+ foreach my $user (@users) {
+ $r[$i] = new PKI::RA::GlobalVar(
+ getUID => sub { return $util->html_encode($user->{'uid'}) },
+ getName => sub { return $util->html_encode(Encode::decode('UTF-8',$user->{'name'})) },
+ getEmail => sub { return $util->html_encode($user->{'email'}) },
+ );
+ $i++;
+ }
+ $context{rows} = \@r;
+
+ my $result = $parser->execute_file_with_context("admin/user/index.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/admin/user/index.vm b/base/ra/apache/docroot/admin/user/index.vm
new file mode 100644
index 000000000..7262561f6
--- /dev/null
+++ b/base/ra/apache/docroot/admin/user/index.vm
@@ -0,0 +1,83 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA Admin</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/admin/index.cgi">Administrator Interface</a>
+</font><br>
+<p>
+<a href="add_new.cgi">Add New User</a>
+<p>
+<center>
+<table border="1" cellspacing="1" cellpadding="1">
+<tr valign="TOP">
+<td><b>UID</b></td>
+<td><b>Name</b></td>
+<td><b>Email</b></td>
+</tr>
+#foreach($r in $rows)
+<tr valign="TOP">
+<td><a href="read.cgi?uid=$r.getUID()">$r.getUID()</a></td>
+<td>$r.getName()</td>
+<td>$r.getEmail()</td>
+</tr>
+#end
+</table>
+</center>
+<p>
+<a href="index.cgi?status=$status&sp=$pp&mc=$mc">Previous</a> | <a href="index.cgi?status=$status&sp=$np&mc=$mc">Next</a>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/admin/user/read.cgi b/base/ra/apache/docroot/admin/user/read.cgi
new file mode 100755
index 000000000..08d2fd3f7
--- /dev/null
+++ b/base/ra/apache/docroot/admin/user/read.cgi
@@ -0,0 +1,97 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+use PKI::Request::Queue;
+use Encode;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->admin_auth($cfg)) {
+ print $q->redirect("/admin/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $uid;
+
+ my $userid = $util->get_val($q->param('uid'));
+
+ my $store = PKI::Base::UserStore->new();
+ $store->open($cfg);
+ my $ref = $store->read_user($userid);
+ $store->close();
+
+ $context{userid} = $util->html_encode($ref->{'uid'});
+ $context{name} = $util->html_encode(Encode::decode('UTF-8', $ref->{'name'}));
+ $context{email} = $util->html_encode($ref->{'email'});
+ $context{certificate} = $util->breakline($util->html_encode($ref->{'certificate'}),40);
+
+ my $result = $parser->execute_file_with_context("admin/user/read.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/admin/user/read.vm b/base/ra/apache/docroot/admin/user/read.vm
new file mode 100644
index 000000000..354d9881f
--- /dev/null
+++ b/base/ra/apache/docroot/admin/user/read.vm
@@ -0,0 +1,88 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Users</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/admin/index.cgi">Administrator Interface</a>
+</font><br>
+<p>
+</font>
+<p>
+<center>
+<table border="1" cellspacing="1" cellpadding="1">
+<tr valign="TOP">
+ <td><b>UID</b></td>
+ <td>$userid</td>
+</tr>
+<tr valign="TOP">
+ <td><b>Name</b></td>
+ <td>$name</td>
+</tr>
+<tr valign="TOP">
+ <td><b>Email</b></td>
+ <td>$email</td>
+</tr>
+<tr valign="TOP">
+ <td><b>Certificate</b></td>
+ <td>$certificate</td>
+</tr>
+</table>
+</center>
+<p>
+<a href="delete.cgi?uid=$userid">[Delete]</a>
+<p>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/agent/cert/index.cgi b/base/ra/apache/docroot/agent/cert/index.cgi
new file mode 100755
index 000000000..46e5b8c2c
--- /dev/null
+++ b/base/ra/apache/docroot/agent/cert/index.cgi
@@ -0,0 +1,119 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+use PKI::Base::CertStore;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->agent_auth($cfg)) {
+ print $q->redirect("/agent/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my @roles = $self->get_current_roles($cfg);
+ my $r = join(",",@roles);
+
+ my $sp = $util->get_alphanum_val($q->param('sp'));
+ if ($sp eq "") {
+ $sp = "0";
+ }
+ $context{sp} = $sp;
+ my $mc = $util->get_alphanum_val($q->param('mc'));
+ if ($mc eq "") {
+ $mc = "20";
+ }
+ $context{mc} = $mc;
+ $context{pp} = $sp - $mc; # previous pos (for paging)
+ $context{np} = $sp + $mc; # next pos (for paging)
+
+ my $cs = PKI::Base::CertStore->new();
+ $cs->open($cfg);
+ my @certs = $cs->list_certs_by_approver($uid, $sp, $mc);
+ $cs->close();
+
+ my @r;
+ my $i = 0;
+ foreach my $cert (@certs) {
+ $r[$i] = new PKI::RA::GlobalVar(
+ getReqId => sub { return $util->html_encode($cert->{'rid'}) },
+ getSerialno => sub { return $util->html_encode($cert->{'serialno'}) },
+ getSubjectDN => sub { return $util->html_encode($cert->{'subject_dn'}) },
+ getCertificate => sub { return $util->html_encode($cert->{'certificate'}) },
+ getApprovedBy => sub { return $util->html_encode($cert->{'approved_by'}) },
+ getCreatedAt => sub { return $util->html_encode($cert->{'created_at'}); },
+ );
+ $i++;
+ }
+ $context{rows} = \@r;
+
+ my $result = $parser->execute_file_with_context("agent/cert/index.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/agent/cert/index.vm b/base/ra/apache/docroot/agent/cert/index.vm
new file mode 100644
index 000000000..f9229b0f9
--- /dev/null
+++ b/base/ra/apache/docroot/agent/cert/index.vm
@@ -0,0 +1,86 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA Agent</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/agent/index.cgi">Agent Interface</a>
+<br>List Certificates Approved by: $uid
+</font><br>
+<p>
+<center>
+<table border="1" cellspacing="1" cellpadding="1">
+<tr valign="TOP">
+<td><b>Serial#</b></td>
+<td><b>Request ID</b></td>
+<td><b>Subject DN</b></td>
+<td><b>Approved By</b></td>
+<td><b>Created At</b></td>
+</tr>
+#foreach($r in $rows)
+<tr valign="TOP">
+<td><a href="read.cgi?serialno=$r.getSerialno()">$r.getSerialno()</a></td>
+<td><a href="/agent/request/read.cgi?id=$r.getReqId()">$r.getReqId()</a></td>
+<td>$r.getSubjectDN()</td>
+<td>$r.getApprovedBy()</td>
+<td>$r.getCreatedAt()</td>
+</tr>
+#end
+</table>
+</center>
+<p>
+<a href="index.cgi?sp=$pp&mc=$mc">Previous</a> | <a href="index.cgi?sp=$np&mc=$mc">Next</a>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/agent/cert/read.cgi b/base/ra/apache/docroot/agent/cert/read.cgi
new file mode 100755
index 000000000..f434baedb
--- /dev/null
+++ b/base/ra/apache/docroot/agent/cert/read.cgi
@@ -0,0 +1,104 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+use PKI::Conn::CA;
+use Encode;
+use vars qw (@ISA);
+use PKI::Service::Op;
+
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+ $self->debug_params($cfg, $q);
+
+ if (!$self->agent_auth($cfg)) {
+ print $q->redirect("/agent/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my $serialno = $util->get_alphanum_val($q->param('serialno'));
+
+ my $cs = PKI::Base::CertStore->new();
+ $cs->open($cfg);
+ my $ref = $cs->read_certificate_by_approver($uid, $serialno);
+ $cs->close();
+
+ my $ca = PKI::Conn::CA->new();
+ $ca->open($cfg);
+ my $certStatus = $ca->getCertStatus("ca1", $serialno);
+ $ca->close();
+
+
+ $context{certificate} = $util->breakline($util->html_encode($ref->{'certificate'}), 40);
+
+ $context{serialno} = $util->html_encode($ref->{'serialno'});
+ $context{subject_dn} = $util->html_encode(Encode::decode('UTF-8', $ref->{'subject_dn'}));
+ $context{created_at} = $util->html_encode($ref->{'created_at'});
+ $context{approved_by} = $util->html_encode($ref->{'approved_by'});
+ $context{rid} = $util->html_encode($ref->{'rid'});
+ $context{certStatus} = $util->html_encode($certStatus);
+
+ my $result = $parser->execute_file_with_context("agent/cert/read.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/agent/cert/read.vm b/base/ra/apache/docroot/agent/cert/read.vm
new file mode 100644
index 000000000..43c78ffa4
--- /dev/null
+++ b/base/ra/apache/docroot/agent/cert/read.vm
@@ -0,0 +1,96 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Certificates</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/agent/index.cgi">Agent Interface</a>
+<br>Certificate Information
+</font><br>
+<p>
+</font>
+<center>
+<table border="1" cellspacing="1" cellpadding="1">
+<tr valign="TOP">
+<td><b>Serial Number</b></td>
+<td><a href="read.cgi?serialno=$serialno">$serialno</a></td>
+</tr>
+<tr valign="TOP">
+<td><b>Subject DN</b></td>
+<td>$subject_dn</td>
+</tr>
+<tr valign="TOP">
+<td><b>Certificate</b></td>
+<td>$certificate</td>
+</tr>
+<tr valign="TOP">
+<td><b>Approved By</b></td>
+<td>$approved_by</td>
+</tr>
+<tr valign="TOP">
+<td><b>Created At</b></td>
+<td>$created_at</td>
+</tr>
+<tr valign="TOP">
+<td><b>Revocation Status</b></td>
+<td>$certStatus</td>
+</tr>
+</table>
+</center>
+<br/>
+<a href="/agent/cert/revoke.cgi?rid=$rid&serialno=$serialno&subject_dn=$subject_dn">Revoke</a>
+<br/>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/agent/cert/revoke.cgi b/base/ra/apache/docroot/agent/cert/revoke.cgi
new file mode 100755
index 000000000..1e483aea0
--- /dev/null
+++ b/base/ra/apache/docroot/agent/cert/revoke.cgi
@@ -0,0 +1,89 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::Registry;
+use PKI::Base::Util;
+use Encode;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+ $self->debug_params($cfg, $q);
+
+ if (!$self->agent_auth($cfg)) {
+ print $q->redirect("/agent/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my $serialno = $util->get_alphanum_val($q->param('serialno'));
+ my $subject_dn = $util->get_val($q->param('subject_dn'));
+ my $rid = $util->get_alphanum_val($q->param('rid'));
+
+ $context{serialno} = $util->html_encode($serialno);
+ $context{subject_dn} = $util->html_encode(Encode::decode('UTF-8',$subject_dn));
+ $context{rid} = $util->html_encode($rid);
+
+ my $result = $parser->execute_file_with_context("agent/cert/revoke.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/agent/cert/revoke.vm b/base/ra/apache/docroot/agent/cert/revoke.vm
new file mode 100644
index 000000000..626bbed42
--- /dev/null
+++ b/base/ra/apache/docroot/agent/cert/revoke.vm
@@ -0,0 +1,111 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Certificate Revocation</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/agent/index.cgi">Agent Interface</a>
+<br>Revoking Certificate:
+</font><br>
+<p>
+</font>
+<center>
+<table border="0" cellspacing="1" cellpadding="1">
+<tr valign="TOP">
+<td><b>Serial Number:</b></td>
+<td>$serialno</td>
+</tr>
+<tr valign="TOP">
+<td><b>Subject DN:</b></td>
+<td>$subject_dn</td>
+</tr>
+</table>
+<br>
+<b>Select A Reason:</b>
+</br>
+<table>
+<form name=reason_form method=post action=submit.cgi>
+<input type=hidden name=serialno value="$serialno">
+<input type=hidden name=subject_dn value="$subject_dn">
+<input type=hidden name=rid value="$rid">
+<tr>
+<td><input checked type=radio name="reason" value="0">Unspecified</td>
+</tr>
+<tr>
+<td><input type=radio name="reason" value="1">Key compromised</td>
+</tr>
+<tr>
+<td><input type=radio name="reason" value="2">CA key compromised</td>
+</tr>
+<tr>
+<td><input type=radio name="reason" value="3">Affiliation changed</td>
+</tr>
+<tr>
+<td><input type=radio name="reason" value="4">Certificate superseded</td>
+</tr>
+<tr>
+<td><input type=radio name="reason" value="5">Cessation of operation</td>
+</tr>
+<tr>
+<td><input type=radio name="reason" value="6">Certificate is on hold</td>
+</tr>
+</form>
+</table>
+</center>
+<br/>
+<a href="#" onclick="document.reason_form.submit();">Submit</a>
+<br/>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/agent/cert/submit.cgi b/base/ra/apache/docroot/agent/cert/submit.cgi
new file mode 100755
index 000000000..571385f3a
--- /dev/null
+++ b/base/ra/apache/docroot/agent/cert/submit.cgi
@@ -0,0 +1,104 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+use PKI::Conn::CA;
+use Encode;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->agent_auth($cfg)) {
+ print $q->redirect("/agent/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my $serialno = $util->get_alphanum_val($q->param('serialno'));
+ my $subject_dn = $util->get_val($q->param('subject_dn'));
+ my $reason = $util->get_alphanum_val($q->param('reason'));
+ my $rid = $util->get_alphanum_val($q->param('rid'));
+
+ my $ca = PKI::Conn::CA->new();
+ $ca->open($cfg);
+ $ca->revoke($rid, "ca1", $serialno, $reason);
+ $ca->close();
+
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+
+ my $ref = $queue->read_request($rid);
+ $context{errorString} = $util->html_encode($ref->{'errorString'});
+ $queue->close();
+
+ $context{rid} = $util->html_encode($rid);
+ $context{serialno} = $util->html_encode($serialno);
+ $context{subject_dn} = $util->html_encode(Encode::decode('UTF-8', $subject_dn));
+
+ my $result = $parser->execute_file_with_context("agent/cert/submit.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/agent/cert/submit.vm b/base/ra/apache/docroot/agent/cert/submit.vm
new file mode 100644
index 000000000..730228715
--- /dev/null
+++ b/base/ra/apache/docroot/agent/cert/submit.vm
@@ -0,0 +1,91 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Certificate Revocation Submission</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/agent/index.cgi">Agent Interface</a>
+<br>Revocation of Certificate:
+</font><br>
+<p>
+</font>
+<center>
+<table border="0" cellspacing="1" cellpadding="1">
+<tr valign="TOP">
+<td><b>Serial Number:</b></td>
+<td>$serialno</td>
+</tr>
+<tr valign="TOP">
+<td><b>Subject DN:</b></td>
+<td>$subject_dn</td>
+</tr>
+<tr>
+<td><b>Result:</b></td>
+#if ($errorString == "0")
+<td>Revoked</td>
+#else
+<td>Failed: $errorString</td>
+#end
+</tr>
+<tr>
+<td><b>Request ID:</b></td>
+<td><a href="/agent/request/read.cgi?id=$rid">$rid</a></td>
+</tr>
+</table>
+<br>
+</center>
+<br/>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/agent/error.cgi b/base/ra/apache/docroot/agent/error.cgi
new file mode 100755
index 000000000..fa13365a7
--- /dev/null
+++ b/base/ra/apache/docroot/agent/error.cgi
@@ -0,0 +1,81 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::UserStore;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ my $util = PKI::Base::Util->new();
+
+ my $error = $util->get_val($q->param('error'));
+
+ my %context;
+ if ($error ne "") {
+ $context{has_error} = 1;
+ $context{'error'} = $util->html_encode($error);
+ }
+
+ my $result = $parser->execute_file_with_context("agent/error.vm", \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/agent/error.vm b/base/ra/apache/docroot/agent/error.vm
new file mode 100644
index 000000000..dbe65cb58
--- /dev/null
+++ b/base/ra/apache/docroot/agent/error.vm
@@ -0,0 +1,72 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA Agent Error!</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+Agent Interface
+</font><br>
+<p>
+</font>
+<p>
+<center>
+You are not authorized to access the requested page.
+<br>
+#if ($has_error)
+ Error: $error
+#end
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/agent/index.cgi b/base/ra/apache/docroot/agent/index.cgi
new file mode 100755
index 000000000..c8f2040fe
--- /dev/null
+++ b/base/ra/apache/docroot/agent/index.cgi
@@ -0,0 +1,83 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::UserStore;
+use PKI::Base::Registry;
+use PKI::Base::Util;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->agent_auth($cfg)) {
+ print $q->redirect("/agent/error.cgi?error=Authentication%20Error");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my $result = $parser->execute_file_with_context("agent/index.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/agent/index.vm b/base/ra/apache/docroot/agent/index.vm
new file mode 100644
index 000000000..5bd952ba2
--- /dev/null
+++ b/base/ra/apache/docroot/agent/index.vm
@@ -0,0 +1,81 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA Agent</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+RA Agent Services
+</font><br>
+<p>
+<center>
+<table border="0" cellspacing="0" cellpadding="0">
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="/agent/request/index.cgi">List Requests</a></li>
+</font>
+</td>
+</tr>
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="/agent/cert/index.cgi">List Certificates</a></li>
+</font>
+</td>
+</tr>
+</table>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/agent/request/add_note.cgi b/base/ra/apache/docroot/agent/request/add_note.cgi
new file mode 100755
index 000000000..0ffac91c7
--- /dev/null
+++ b/base/ra/apache/docroot/agent/request/add_note.cgi
@@ -0,0 +1,93 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+use PKI::Request::Queue;
+use PKI::Base::TimeTool;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->agent_auth($cfg)) {
+ print $q->redirect("/agent/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my $id = $util->get_alphanum_val($q->param('id'));
+ my $note = $util->get_val($q->param('note'));
+
+ if ($note eq "") {
+ # dont add anything
+ print $q->redirect("/agent/request/read.cgi?id=" . $id);
+ return;
+ }
+
+ my $timet = PKI::Base::TimeTool->new();
+ my $now = $timet->get_time();
+ my $new_note = "==== Note created by $uid at $now ====\n" .
+ $note . "\n";
+
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+ my $ref = $queue->read_request($id);
+ $queue->set_request($id, "note", $ref->{'note'} . $new_note);
+ $queue->close();
+
+ print $q->redirect("/agent/request/read.cgi?id=" . $id);
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/agent/request/index.cgi b/base/ra/apache/docroot/agent/request/index.cgi
new file mode 100755
index 000000000..81b25977a
--- /dev/null
+++ b/base/ra/apache/docroot/agent/request/index.cgi
@@ -0,0 +1,146 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::RA::GlobalVar;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+use PKI::Request::Queue;
+use PKI::Service::Op;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->agent_auth($cfg)) {
+ print $q->redirect("/agent/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+ $self->debug_log( $cfg, "in request/index.cgi, uid == $uid");
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my @roles = $self->get_current_roles($cfg);
+# my $r = join(",",@roles);
+
+ my $status = $util->get_alphanum_val($q->param('status'));
+ if ($status eq "") {
+ $context{status} = "";
+ } else {
+ $context{status} = $util->html_encode($status);
+ }
+
+ my $sp = $util->get_alphanum_val($q->param('sp'));
+ if ($sp eq "") {
+ $sp = "0";
+ }
+ $context{sp} = $sp;
+ my $mc = $util->get_alphanum_val($q->param('mc'));
+ if ($mc eq "") {
+ $mc = "20";
+ }
+ $context{mc} = $mc;
+ $context{pp} = $sp - $mc; # previous pos (for paging)
+ $context{np} = $sp + $mc; # next pos (for paging)
+
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+ my $total = $queue->count_requests_by_roles(\@roles, $status);
+ $context{total} = $util->html_encode($total);
+
+ my @reqs = $queue->list_requests_by_roles(\@roles, $status, $sp, $mc);
+# my @reqs = $queue->list_requests_by_roles($r, $status, $sp, $mc);
+ $queue->close();
+
+ my @r;
+ my $i = 0;
+ foreach my $req (@reqs) {
+ $r[$i] = new PKI::RA::GlobalVar(
+ getId => sub { return $util->html_encode($req->{'rowid'}) },
+ getType => sub { return $util->html_encode($req->{'type'}) },
+ getStatus => sub { return $util->html_encode($req->{'status'}) },
+ getError => sub { return $util->html_encode($req->{'errorString'}) },
+ getAssignedTo => sub { return $util->html_encode($req->{'assigned_to'}) },
+ getData => sub { return $util->html_encode($req->{'data'}); },
+ getCreatedBy => sub { return $util->html_encode($req->{'created_by'}); },
+ getCreatedAt => sub { return $util->html_encode($req->{'created_at'}); },
+ );
+ $i++;
+ }
+ $context{rows} = \@r;
+
+ if ($sp - $mc < 0) {
+ $context{show_previous} = "no";
+ } else {
+ $context{show_previous} = "yes";
+ }
+
+ if ($i < 20) {
+ $context{show_next} = "no";
+ } else {
+ $context{show_next} = "yes";
+ }
+
+ my $result = $parser->execute_file_with_context("agent/request/index.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/agent/request/index.vm b/base/ra/apache/docroot/agent/request/index.vm
new file mode 100644
index 000000000..dd9901fdb
--- /dev/null
+++ b/base/ra/apache/docroot/agent/request/index.vm
@@ -0,0 +1,95 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA Agent</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/agent/index.cgi">Agent Interface</a>
+</font><br>
+<p>
+<a href="index.cgi">All</a> | <a href="index.cgi?status=OPEN">OPEN</a> | <a href="index.cgi?status=APPROVED">APPROVED</a> | <a href="index.cgi?status=REJECTED">REJECTED</a> | <a href="index.cgi?status=ERROR">FAILED</a>
+<p>
+<center>
+<table border="1" cellspacing="1" cellpadding="1">
+<tr valign="TOP">
+<td><b>Id</b></td>
+<td><b>Type</b></td>
+<td><b>Status</b></td>
+<td><b>Assigned To</b></td>
+<td><b>Created By</b></td>
+<td><b>Created At</b></td>
+<td><b>Error</b></td>
+</tr>
+#foreach($r in $rows)
+<tr valign="TOP">
+<td><a href="read.cgi?id=$r.getId()">$r.getId()</a></td>
+<td>$r.getType()</td>
+<td>$r.getStatus()</td>
+<td>$r.getAssignedTo()</td>
+<td>$r.getCreatedBy()</td>
+<td>$r.getCreatedAt()</td>
+<td>$r.getError()</td>
+</tr>
+#end
+</table>
+</center>
+<p>
+Total: $total
+<br/>
+<br/>
+<a href="index.cgi?status=$status&sp=$pp&mc=$mc">Previous</a> |
+<a href="index.cgi?status=$status&sp=$np&mc=$mc">Next</a>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/agent/request/op.cgi b/base/ra/apache/docroot/agent/request/op.cgi
new file mode 100755
index 000000000..363d7121b
--- /dev/null
+++ b/base/ra/apache/docroot/agent/request/op.cgi
@@ -0,0 +1,153 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use Benchmark;
+use CGI;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::Registry;
+use PKI::Request::Queue;
+use PKI::Base::Util;
+use Encode;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+
+ my $q = CGI->new();
+
+ my $st = new Benchmark;
+
+ my $util = PKI::Base::Util->new();
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->agent_auth($cfg)) {
+ print $q->redirect("/agent/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+ my $type = $util->get_alphanum_val($q->param('type'));
+ my $id = $util->get_alphanum_val($q->param('id'));
+
+ my $db_st = new Benchmark;
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+
+ my $ref;
+
+ my @roles = $self->get_current_roles($cfg);
+ my $pref = $queue->read_request_by_roles(\@roles, $id);
+
+ if (! defined $pref) {
+ $queue->close();
+ $self->debug_log($cfg, "Invalid attempt to process request id= " . $id .
+ " by userid= " . $uid);
+ print $q->redirect("/agent/error.cgi");
+ return;
+ }
+
+ my $curr_status = $pref->{'status'};
+ if ($type eq "approve") {
+ if (($curr_status ne "OPEN") && ($curr_status ne "ERROR")) {
+ $queue->close();
+ print $q->redirect("/agent/request/read.cgi?id=$id");
+ return;
+ }
+
+ $ref = $queue->approve_request($id, $uid);
+ } elsif ($type eq "reject") {
+ if (($curr_status ne "OPEN") && ($curr_status ne "ERROR")) {
+ $queue->close();
+ print $q->redirect("/agent/request/read.cgi?id=$id");
+ return;
+ }
+
+ $ref = $queue->reject_request($id, $uid);
+ }
+ $queue->close();
+ my $db_et = new Benchmark;
+
+ $context{data} = $util->breakline($util->html_encode(Encode::decode('UTF-8', $ref->{'data'})), 40);
+ $context{output} = $util->breakline($util->html_encode($ref->{'output'}), 40);
+ $context{serialno} = $util->html_encode($ref->{'serialno'});
+ $context{type} = $util->html_encode($ref->{'type'});
+ $context{ip} = $util->html_encode($ref->{'ip'});
+ $context{note} = $util->html_encode($ref->{'note'});
+ $context{note} =~ s/\n/<br\/>/g;
+ $context{created_at} = $util->html_encode($ref->{'created_at'});
+ $context{updated_at} = $util->html_encode($ref->{'updated_at'});
+ $context{assigned_to} = $util->html_encode($ref->{'assigned_to'});
+ $context{processed_by} = $util->html_encode($ref->{'processed_by'});
+ $context{created_by} = $util->html_encode($ref->{'created_by'});
+ $context{status} = $util->html_encode($ref->{'status'});
+ $context{errorString} = $util->html_encode($ref->{'errorString'});
+ $context{id} = $util->html_encode($ref->{'rowid'});
+
+ my $t_st = new Benchmark;
+ my $result = $parser->execute_file_with_context("agent/request/op.vm",
+ \%context);
+ my $t_et = new Benchmark;
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+
+ my $et = new Benchmark;
+
+ $self->debug_log($cfg, "benchmark " .
+ "total=" . timestr(timediff($et, $st)) . " " .
+ "db total=" . timestr(timediff($db_et, $db_st)) . " " .
+ "template total=" . timestr(timediff($t_et, $t_st)) . " "
+ );
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/agent/request/op.vm b/base/ra/apache/docroot/agent/request/op.vm
new file mode 100644
index 000000000..d5bc2dfe4
--- /dev/null
+++ b/base/ra/apache/docroot/agent/request/op.vm
@@ -0,0 +1,127 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Certificate Request Operations</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/agent/index.cgi">Agent Interface</a>
+</font><br>
+<p>
+<a href="index.cgi">All</a> | <a href="index.cgi?status=OPEN">OPEN</a> | <a href="index.cgi?status=APPROVED">APPROVED</a> | <a href="index.cgi?status=REJECTED">REJECTED</a> | <a href="index.cgi?status=ERROR">FAILED</a>
+<p>
+<center>
+<table border="1" cellspacing="1" cellpadding="1">
+<tr valign="TOP">
+<td><b>Request Id</b></td>
+<td><a href="read.cgi?id=$id">$id</a></td>
+</tr>
+<tr valign="TOP">
+<td><b>Type</b></td>
+<td>$type</td>
+</tr>
+<tr valign="TOP">
+<td><b>Data</b></td>
+<td>$data</td>
+</tr>
+<tr valign="TOP">
+<td><b>Output</b></td>
+<td>$output</td>
+</tr>
+<tr valign="TOP">
+<td><b>Serial Number</b></td>
+<td>$serialno</td>
+</tr>
+<tr valign="TOP">
+<td><b>Status</b></td>
+<td>$status</td>
+</tr>
+<tr valign="TOP">
+<td><b>Error</b></td>
+<td>$errorString</td>
+</tr>
+<tr valign="TOP">
+<td><b>Assigned To</b></td>
+<td>$assigned_to</td>
+</tr>
+<tr valign="TOP">
+<td><b>Created By</b></td>
+<td>$created_by</td>
+</tr>
+<tr valign="TOP">
+<td><b>Updated At</b></td>
+<td>$updated_at</td>
+</tr>
+<tr valign="TOP">
+<td><b>Processed By</b></td>
+<td>$processed_by</td>
+</tr>
+<tr valign="TOP">
+<td><b>Created At</b></td>
+<td>$created_at</td>
+</tr>
+<tr valign="TOP">
+<td><b>IP</b></td>
+<td>$ip</td>
+</tr>
+<tr valign="TOP">
+<td><b>Note</b></td>
+<td>$note</td>
+</tr>
+</table>
+</center>
+
+<br/>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/agent/request/read.cgi b/base/ra/apache/docroot/agent/request/read.cgi
new file mode 100755
index 000000000..d1633c164
--- /dev/null
+++ b/base/ra/apache/docroot/agent/request/read.cgi
@@ -0,0 +1,119 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::Registry;
+use PKI::Base::Util;
+use PKI::Request::Queue;
+use Encode;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ if (!$self->agent_auth($cfg)) {
+ print $q->redirect("/agent/error.cgi");
+ return;
+ }
+ my $uid = $self->get_current_uid($cfg);
+
+ my %context;
+ $context{uid} = $util->html_encode($uid);
+
+
+ my @roles = $self->get_current_roles($cfg);
+# my $r = join(",",@roles);
+
+ my $id = $util->get_alphanum_val($q->param('id'));
+
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+ my $ref = $queue->read_request_by_roles(\@roles, $id);
+ $queue->close();
+
+ $context{data} = $util->breakline($util->html_encode(Encode::decode('UTF-8',$ref->{'data'})), 40);
+ $context{output} = $util->breakline($util->html_encode($ref->{'output'}), 40);
+ $context{meta_info} = $util->breakline($util->html_encode($ref->{'meta_info'}), 40);
+
+ $context{serialno} = $util->html_encode($ref->{'serialno'});
+ $context{subject_dn} = $util->html_encode($ref->{'subject_dn'});
+ $context{type} = $util->html_encode($ref->{'type'});
+ $context{created_at} = $util->html_encode($ref->{'created_at'});
+ $context{created_by} = $util->html_encode($ref->{'created_by'});
+ $context{updated_at} = $util->html_encode($ref->{'updated_at'});
+ $context{ip} = $util->html_encode($ref->{'ip'});
+ $context{processed_by} = $util->html_encode($ref->{'processed_by'});
+ $context{note} = $util->html_encode($ref->{'note'});
+ $context{note} =~ s/\n/<br\/>/g;
+ $context{assigned_to} = $util->html_encode($ref->{'assigned_to'});
+ $context{status} = $util->html_encode($ref->{'status'});
+ if ($ref->{'status'} eq "OPEN") {
+ $context{is_open} = 1;
+ }
+ if ($ref->{'status'} eq "ERROR") {
+ $context{is_error} = 1;
+ }
+ $context{errorString} = $util->html_encode($ref->{'errorString'});
+ $context{id} = $util->html_encode($ref->{'rowid'});
+
+ my $result = $parser->execute_file_with_context("agent/request/read.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/agent/request/read.vm b/base/ra/apache/docroot/agent/request/read.vm
new file mode 100644
index 000000000..c583be021
--- /dev/null
+++ b/base/ra/apache/docroot/agent/request/read.vm
@@ -0,0 +1,149 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Certificate Requests</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+UID: $uid
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/agent/index.cgi">Agent Interface</a>
+</font><br>
+<p>
+<a href="index.cgi">All</a> | <a href="index.cgi?status=OPEN">OPEN</a> | <a href="index.cgi?status=APPROVED">APPROVED</a> | <a href="index.cgi?status=REJECTED">REJECTED</a>| <a href="index.cgi?status=ERROR">FAILED</a>
+<p>
+<center>
+<table border="1" cellspacing="1" cellpadding="1">
+<tr valign="TOP">
+<td><b>Request Id</b></td>
+<td><a href="read.cgi?id=$id">$id</a></td>
+</tr>
+<tr valign="TOP">
+<td><b>Type</b></td>
+<td>$type</td>
+</tr>
+<tr valign="TOP">
+<td><b>Data</b></td>
+<td>$data</td>
+</tr>
+<tr valign="TOP">
+<td><b>Output</b></td>
+<td>$output</td>
+</tr>
+<tr valign="TOP">
+<td><b>Serial Number</b></td>
+#if ($serialno == "unavailable")
+<td>$serialno</td>
+#else
+<td><a href="/agent/cert/read.cgi?serialno=$serialno">$serialno</a></td>
+#end
+</tr>
+<tr valign="TOP">
+<td><b>Subject DN</b></td>
+<td>$subject_dn</td>
+</tr>
+<tr valign="TOP">
+<td><b>Meta Info</b></td>
+<td>$meta_info</td>
+</tr>
+<tr valign="TOP">
+<td><b>Status</b></td>
+<td>$status</td>
+</tr>
+<tr valign="TOP">
+<td><b>Error</b></td>
+<td>$errorString</td>
+</tr>
+<tr valign="TOP">
+<td><b>Assigned To</b></td>
+<td>$assigned_to</td>
+</tr>
+<tr valign="TOP">
+<td><b>Created By</b></td>
+<td>$created_by</td>
+</tr>
+<tr valign="TOP">
+<td><b>Updated At</b></td>
+<td>$updated_at</td>
+</tr>
+<tr valign="TOP">
+<td><b>Processed By</b></td>
+<td>$processed_by</td>
+</tr>
+<tr valign="TOP">
+<td><b>Created At</b></td>
+<td>$created_at</td>
+</tr>
+<tr valign="TOP">
+<td><b>IP</b></td>
+<td>$ip</td>
+</tr>
+<tr valign="TOP">
+<td><b>Note</b></td>
+<td>$note</td>
+</tr>
+</table>
+</center>
+<br/>
+#if ($is_open || $is_error)
+<a href="op.cgi?type=approve&id=$id">Approve</a> | <a href="op.cgi?type=reject&id=$id">Reject</a>
+<br/>
+<br/>
+#end
+<form name=note_form method=post action=add_note.cgi>
+<input type=hidden name=id value="$id">
+<textarea name=note>
+</textarea>
+</form>
+<a href="#" onclick="document.note_form.submit();">Add Note</a>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/agent/enroll.cgi b/base/ra/apache/docroot/ee/agent/enroll.cgi
new file mode 100755
index 000000000..4f1af8f16
--- /dev/null
+++ b/base/ra/apache/docroot/ee/agent/enroll.cgi
@@ -0,0 +1,127 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use MIME::Base64;
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::Registry;
+use PKI::Request::Queue;
+use PKI::Conn::CA;
+use PKI::Base::PinStore;
+use PKI::Base::Util;
+
+use vars qw (@ISA);
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ my $uid = $util->get_val($q->param('uid'));
+ my $pin = $util->get_alphanum_val($q->param('pin'));
+ my $csr = $util->get_val($q->param('csr'));
+ $csr = $util->normalize_csr($csr);
+
+ my $key = $uid;
+
+ my $pin_store = PKI::Base::PinStore->new();
+ $pin_store->open($cfg);
+ my $pinref = $pin_store->read_pin($key);
+ if (defined($pinref) && $pinref->{'pin'} eq $pin) {
+ $pin_store->delete($key);
+ } else {
+ $pin_store->close();
+ print $q->redirect("/ee/error.cgi?error=Invalid Pin");
+ return;
+ }
+ my $rid = $pinref->{'rid'};
+ $pin_store->close();
+
+ my $profile_id = $cfg->get("request.agent.profileId");
+ my $cert_request_type = $cfg->get("request.agent.reqType");
+
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+ my $req = $queue->read_request($rid);
+ $queue->set_request($rid, "subject_dn", "uid=$uid, e=$req->{'created_by'}");
+
+ my $ca = PKI::Conn::CA->new();
+ $ca->open($cfg);
+ my $cert = $ca->enroll($rid, "ca1", $profile_id, $cert_request_type, $csr);
+ $ca->close();
+ $queue->set_request($rid, "output", $cert);
+
+ $req = $queue->read_request($rid);
+ if ($cert eq "") {
+ my $error = $req->{'errorString'};
+ $queue->close();
+ print $q->redirect("/ee/error.cgi?error=$error");
+ return;
+ }
+
+ my $decoded = decode_base64($cert);
+ my $encoded = encode_base64($decoded);
+
+ my %context;
+ $context{cert} = $encoded;
+ $context{rid} = $util->html_encode($rid);
+ $context{subject_dn} = $util->html_encode($req->{'subject_dn'});
+ $queue->close();
+
+ my $result = $parser->execute_file_with_context("ee/agent/enroll.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/agent/enroll.vm b/base/ra/apache/docroot/ee/agent/enroll.vm
new file mode 100644
index 000000000..203b02696
--- /dev/null
+++ b/base/ra/apache/docroot/ee/agent/enroll.vm
@@ -0,0 +1,74 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Agent Certificate Enrollment</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> : <a href="/ee/agent/index.cgi">Agent Enrollment</a><br />
+Enroll Interface
+</font><br>
+<p>
+<b>Your Certificate:</b>
+<br/>
+<b>Subject DN:</b> $subject_dn
+<br/>
+<pre>
+-----BEGIN CERTIFICATE-----
+$cert
+-----END CERTIFICATE-----
+</pre>
+<a href="/ee/request/importcert.cgi?id=$rid">import certificate</a>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/agent/index.cgi b/base/ra/apache/docroot/ee/agent/index.cgi
new file mode 100755
index 000000000..66fceb8ff
--- /dev/null
+++ b/base/ra/apache/docroot/ee/agent/index.cgi
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use PKI::Base::Registry;
+use Template::Velocity;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my %context;
+ my $result = $parser->execute_file_with_context("ee/agent/index.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/agent/index.vm b/base/ra/apache/docroot/ee/agent/index.vm
new file mode 100644
index 000000000..9fc991d6a
--- /dev/null
+++ b/base/ra/apache/docroot/ee/agent/index.vm
@@ -0,0 +1,83 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA End-Entity</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> : <a href="/ee/agent/index.cgi">Agent Enrollment</a><br />
+</font><br>
+<p>
+For RA agent enrollment, an agent must submit a pin creation request first before performing certificate enrollment.
+<p>
+<center>
+<table border="0" cellspacing="0" cellpadding="0">
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="new.cgi">Pin Creation Request</a></li>
+</font>
+</td>
+</tr>
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="start.cgi">Certificate Enrollment</a></li>
+</font>
+</td>
+</tr>
+</table>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/agent/new.cgi b/base/ra/apache/docroot/ee/agent/new.cgi
new file mode 100755
index 000000000..c209f5e74
--- /dev/null
+++ b/base/ra/apache/docroot/ee/agent/new.cgi
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use PKI::Base::Registry;
+use Template::Velocity;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my %context;
+ my $result = $parser->execute_file_with_context("ee/agent/new.vm", \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/agent/new.vm b/base/ra/apache/docroot/ee/agent/new.vm
new file mode 100644
index 000000000..bca0a37fc
--- /dev/null
+++ b/base/ra/apache/docroot/ee/agent/new.vm
@@ -0,0 +1,88 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Agent Certificate Request</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> : <a href="/ee/agent/index.cgi">Agent Enrollment</a><br />
+Agent Interface
+</font><br>
+<p>
+This form is for new agent to request for agent certificate.
+<p>
+<center>
+<form method=post action="submit.cgi">
+<table border="0" cellspacing="1" cellpadding="1">
+<tr>
+ <td width=20%>UID:</td>
+ <td><input type=text name=uid value="" ></td>
+</tr>
+<tr>
+ <td>Your Email:</td>
+ <td><input type=text name=email value=""></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><input type=submit name=Submit value="Submit"></td>
+ <td></td>
+</tr>
+</table>
+</form>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/agent/start.cgi b/base/ra/apache/docroot/ee/agent/start.cgi
new file mode 100755
index 000000000..27aedb546
--- /dev/null
+++ b/base/ra/apache/docroot/ee/agent/start.cgi
@@ -0,0 +1,69 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use PKI::Base::Registry;
+use Template::Velocity;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my %context;
+
+ my $result = $parser->execute_file_with_context("ee/agent/start.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/agent/start.vm b/base/ra/apache/docroot/ee/agent/start.vm
new file mode 100644
index 000000000..b2b21dc1b
--- /dev/null
+++ b/base/ra/apache/docroot/ee/agent/start.vm
@@ -0,0 +1,114 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Agent Certificate Request Using a One-Time Pin</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+<SCRIPT LANGUAGE="JavaScript">
+
+function validate()
+{
+ with (document.forms[0]) {
+ crmfObject = crypto.generateCRMFRequest(
+ "CN=x",
+ "regToken", "authenticator",
+ null,
+ "setCRMFRequest();",
+ 1024, null, "rsa-dual-use");
+ return false;
+ }
+}
+
+function setCRMFRequest()
+{
+ with (document.forms[0]) {
+ csr.value = crmfObject.request;
+ submit();
+ }
+}
+
+</SCRIPT>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> : <a href="/ee/agent/index.cgi">Agent Enrollment</a><br />
+Agent Interface
+</font><br>
+<p>
+This form is for new RA agent to request a certificate.
+<p>
+<center>
+<form onSubmit="return validate();" method=post action="enroll.cgi">
+<table border="0" cellspacing="1" cellpadding="1">
+<tr>
+ <td width=20%>UID:</td>
+ <td><input type=text name=uid value="" ></td>
+</tr>
+<tr>
+ <td>One-Time Pin:</td>
+ <td><input type=text name=pin value=""></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><input type=submit name=Submit value="Submit"></td>
+ <td></td>
+</tr>
+</table>
+<input type=hidden name="csr" value="">
+</form>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/agent/submit.cgi b/base/ra/apache/docroot/ee/agent/submit.cgi
new file mode 100755
index 000000000..a68242114
--- /dev/null
+++ b/base/ra/apache/docroot/ee/agent/submit.cgi
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+use PKI::Request::Queue;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my $uid = $util->get_val($q->param('uid'));
+ my $email = $util->get_val($q->param('email'));
+
+ $self->debug_params($cfg, $q);
+
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+ my $request_id = $queue->create_request("agent",
+ "uid=" . $uid,
+ "0",
+ $email);
+ my %context;
+ $context{request_id} = $util->html_encode($request_id);
+ $self->debug_log($cfg, "request $request_id created");
+ $queue->close();
+
+ my $result = $parser->execute_file_with_context("ee/agent/submit.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/agent/submit.vm b/base/ra/apache/docroot/ee/agent/submit.vm
new file mode 100644
index 000000000..aaabee929
--- /dev/null
+++ b/base/ra/apache/docroot/ee/agent/submit.vm
@@ -0,0 +1,73 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Agent Certificate Request Submission</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> : <a href="/ee/agent/index.cgi">Agent Enrollment</a><br />
+</font><br>
+<p>
+Your request has been successfully submitted.
+<p>
+<center>
+<table border="0" cellspacing="1" cellpadding="1">
+<tr>
+ <td width=20%>Request ID:</td>
+ <td><a href="/ee/request/status.cgi?id=$request_id">$request_id</td>
+</tr>
+</table>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/error.cgi b/base/ra/apache/docroot/ee/error.cgi
new file mode 100755
index 000000000..1417d4b61
--- /dev/null
+++ b/base/ra/apache/docroot/ee/error.cgi
@@ -0,0 +1,81 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::UserStore;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ my $util = PKI::Base::Util->new();
+
+ my %context;
+
+ my $error = $util->get_val($q->param('error'));
+ if ($error ne "") {
+ $context{has_error} = 1;
+ $context{'error'} = $util->html_encode($error);
+ }
+
+ my $result = $parser->execute_file_with_context("ee/error.vm", \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/error.vm b/base/ra/apache/docroot/ee/error.vm
new file mode 100644
index 000000000..0c4e7afcb
--- /dev/null
+++ b/base/ra/apache/docroot/ee/error.vm
@@ -0,0 +1,71 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA End-Entity Error!</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+EE Interface
+</font><br>
+<p>
+<center>
+Request process error
+<br>
+#if ($has_error)
+ Error: $error
+#end
+
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/index.cgi b/base/ra/apache/docroot/ee/index.cgi
new file mode 100755
index 000000000..453b2873b
--- /dev/null
+++ b/base/ra/apache/docroot/ee/index.cgi
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my %context;
+ my $result = $parser->execute_file_with_context("ee/index.vm", \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/index.vm b/base/ra/apache/docroot/ee/index.vm
new file mode 100644
index 000000000..70f3443ab
--- /dev/null
+++ b/base/ra/apache/docroot/ee/index.vm
@@ -0,0 +1,102 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA End-Entity</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+RA EE Services
+</font><br>
+<p>
+<center>
+<table border="0" cellspacing="0" cellpadding="0">
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="/ee/scep/index.cgi">SCEP Enrollment</a></li>
+</font>
+</td>
+</tr>
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="/ee/server/index.cgi">Server Enrollment</a></li>
+</font>
+</td>
+</tr>
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="/ee/user/index.cgi">User Enrollment</a></li>
+</font>
+</td>
+</tr>
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="/ee/agent/index.cgi">Agent Enrollment</a></li>
+</font>
+</td>
+</tr>
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="/ee/request/index.cgi">Request Status Check</a></li>
+</font>
+</td>
+</tr>
+</table>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/request/getcert.cgi b/base/ra/apache/docroot/ee/request/getcert.cgi
new file mode 100755
index 000000000..b22444dc1
--- /dev/null
+++ b/base/ra/apache/docroot/ee/request/getcert.cgi
@@ -0,0 +1,93 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use PKI::Service::Op;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+use PKI::Request::Queue;
+use Template::Velocity;
+use MIME::Base64;
+use Encode;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $id = $util->get_alphanum_val($q->param('id'));
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+ my $req = $queue->read_request($id);
+ $queue->close();
+
+ my %context;
+ $context{id} = $util->html_encode($req->{'rowid'});
+ $context{serialno} = $util->html_encode($req->{'serialno'});
+ $context{subject_dn} = $util->html_encode(Encode::decode('UTF-8', $req->{'subject_dn'}));
+ if ($req->{'serialno'} eq "unavailable") {
+ $context{output} = "";
+ } else {
+ $context{output} = "-----BEGIN CERTIFICATE-----\n".$util->breakline($util->html_encode($req->{'output'}), 40)."\n-----END CERTIFICATE-----";
+ }
+ my $result = $parser->execute_file_with_context("ee/request/getcert.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/request/getcert.vm b/base/ra/apache/docroot/ee/request/getcert.vm
new file mode 100644
index 000000000..40387a7ef
--- /dev/null
+++ b/base/ra/apache/docroot/ee/request/getcert.vm
@@ -0,0 +1,72 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Import Certificate</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> : <a href="/ee/request/index.cgi">Request Status Check</a>
+<br/>
+Certificate Import
+</font><br>
+<p>
+<p>
+<b>Serial Number:</b>$serialno<br>
+<b>Subject DN:</b>$subject_dn<br><br>
+<b>Base64 Encoding:</b><br>
+ <pre>$output</pre>
+<b>Import Certificate (click on the following link to import):</b><br>
+<a href="importcert.cgi?id=$id">import certificate</a>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/request/importcert.cgi b/base/ra/apache/docroot/ee/request/importcert.cgi
new file mode 100755
index 000000000..fdc309746
--- /dev/null
+++ b/base/ra/apache/docroot/ee/request/importcert.cgi
@@ -0,0 +1,82 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use PKI::Service::Op;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+use PKI::Request::Queue;
+use Template::Velocity;
+use MIME::Base64;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $id = $util->get_alphanum_val($q->param('id'));
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+ my $req = $queue->read_request($id);
+ $queue->close();
+
+ my %context;
+# $::symbol{id} = $req->{'rowid'};
+# $::symbol{status} = $req->{'status'};
+
+# my $result = $parser->execute_file("ee/request/status.vm");
+
+ my $cert = MIME::Base64::decode($req->{'output'});
+
+ print "Content-Type: application/x-x509-user-cert\n\n";
+ print $cert;
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/request/index.cgi b/base/ra/apache/docroot/ee/request/index.cgi
new file mode 100755
index 000000000..ef2a68b23
--- /dev/null
+++ b/base/ra/apache/docroot/ee/request/index.cgi
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my %context;
+ my $result = $parser->execute_file_with_context("ee/request/index.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/request/index.vm b/base/ra/apache/docroot/ee/request/index.vm
new file mode 100644
index 000000000..42dc259ac
--- /dev/null
+++ b/base/ra/apache/docroot/ee/request/index.vm
@@ -0,0 +1,67 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA End-Entity</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> : <a href="/ee/request/index.cgi">Request Status</a><br />
+</font><br>
+<p>
+<form name=form method=post action="status.cgi">
+Request Id: <input type=text name=id value="">
+</form>
+<a href="#" onclick="document.form.submit();">Check</a>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/request/status.cgi b/base/ra/apache/docroot/ee/request/status.cgi
new file mode 100755
index 000000000..6a3154716
--- /dev/null
+++ b/base/ra/apache/docroot/ee/request/status.cgi
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use PKI::Service::Op;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+use PKI::Request::Queue;
+use Template::Velocity;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+
+ my $util = PKI::Base::Util->new();
+
+ my $id = $util->get_alphanum_val($q->param('id'));
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+ my $req = $queue->read_request($id);
+ $queue->close();
+ if ($req == "") {
+ print $q->redirect("/ee/error.cgi?error=request%20not%20found");
+ return;
+ }
+
+ my %context;
+ $context{id} = $util->html_encode($req->{'rowid'});
+ $context{type} =$util->html_encode($req->{'type'});
+ $context{status} = $util->html_encode($req->{'status'});
+ $context{serialno} = $util->html_encode($req->{'serialno'});
+ $context{errorString} = $util->html_encode($req->{'errorString'});
+
+ my $result = $parser->execute_file_with_context("ee/request/status.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/request/status.vm b/base/ra/apache/docroot/ee/request/status.vm
new file mode 100644
index 000000000..ed61cdbe4
--- /dev/null
+++ b/base/ra/apache/docroot/ee/request/status.vm
@@ -0,0 +1,91 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Certificate Request Status</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> : <a href="/ee/request/index.cgi">Request Status Check</a>
+<br/>
+Request Status
+</font><br>
+<p>
+<p>
+<center>
+<table border="0" cellspacing="1" cellpadding="1">
+<tr>
+ <td width=20%><b>Request ID:</b></td>
+ <td><a href="status.cgi?id=$id">$id</a></td>
+</tr>
+<tr>
+ <td width=20%><b>Status:</b></td>
+ <td>$status</td>
+</tr>
+<tr>
+ <td width=20%><b>Error Message:</b></td>
+ <td>$errorString</td>
+</tr>
+#if ($status == "APPROVED")
+#if ($serialno != "unavailable")
+<tr>
+ <td width=20%><b>Import Certificate:</b></td>
+ <td><a href="getcert.cgi?id=$id">$id</td>
+</tr>
+#end
+#end
+</table>
+</form>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/scep/enroll.cgi b/base/ra/apache/docroot/ee/scep/enroll.cgi
new file mode 100755
index 000000000..53291636a
--- /dev/null
+++ b/base/ra/apache/docroot/ee/scep/enroll.cgi
@@ -0,0 +1,112 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use MIME::Base64;
+use URI::URL;
+use URI::Escape;
+use XML::Simple;
+use CGI;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Conn::CA;
+use PKI::Base::PinStore;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ my $client_id = $util->get_val($q->param('client_id'));
+ my $site_id = $util->get_val($q->param('site_id'));
+ my $pin = $util->get_alphanum_val($q->param('pin'));
+ my $csr = $util->get_val($q->param('csr'));
+
+ my $key = $client_id . "/" . $site_id;
+
+ my $pin_store = PKI::Base::PinStore->new();
+ $pin_store->open($cfg);
+ my $pinref = $pin_store->read_pin($key);
+ if (defined($pinref) && $pinref->{'pin'} eq $pin) {
+ $pin_store->delete($key);
+ } else {
+ $pin_store->close();
+ # error, redirect user back to the original enrollment page
+ print $q->redirect("/ee/scep/installer.cgi");
+ return;
+ }
+ $pin_store->close();
+
+ my $profile_id = $cfg->get("request.scep.profileId");
+ my $cert_request_type = $cfg->get("request.scep.reqType");
+
+ my $ca = PKI::Conn::CA->new();
+ $ca->open($cfg);
+ my $cert = $ca->enroll($pinref->{'rid'}, "ca1", $profile_id, $cert_request_type, $csr);
+ $ca->close();
+ my $decoded = decode_base64($cert);
+ my $encoded = encode_base64($decoded);
+
+ my %context;
+ $context{cert} = $encoded;
+
+ my $result = $parser->execute_file_with_context("ee/scep/enroll.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/scep/enroll.vm b/base/ra/apache/docroot/ee/scep/enroll.vm
new file mode 100644
index 000000000..2893eac1c
--- /dev/null
+++ b/base/ra/apache/docroot/ee/scep/enroll.vm
@@ -0,0 +1,74 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>SCEP Router Enrollment</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> :
+<a href="/ee/scep/index.cgi">SCEP Enrollment</a><br />
+Installer Interface
+</font><br>
+<p>
+This form is for router installer to retrieve the requested certificate.
+<p>
+ <b>Your Certificate:</b>
+<br/>
+<pre>
+-----BEGIN CERTIFICATE-----
+$cert
+-----END CERTIFICATE-----
+</pre>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/scep/index.cgi b/base/ra/apache/docroot/ee/scep/index.cgi
new file mode 100755
index 000000000..c73fc379a
--- /dev/null
+++ b/base/ra/apache/docroot/ee/scep/index.cgi
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my %context;
+ my $result = $parser->execute_file_with_context("ee/scep/index.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/scep/index.vm b/base/ra/apache/docroot/ee/scep/index.vm
new file mode 100644
index 000000000..3d75a8d40
--- /dev/null
+++ b/base/ra/apache/docroot/ee/scep/index.vm
@@ -0,0 +1,83 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA End-Entity</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> : <a href="/ee/scep/index.cgi">SCEP Enrollment</a><br />
+</font><br>
+<p>
+In the SCEP enrollment, a manager must firstly submit a one-time pin creation request to the RA. RA Agent will then approve and generate an one-time pin. The pin will be returned to the manager who will give the pin to a local router installer. The router installer visits the enrollment form where certificate request, one time pin and other necessary information are submitted. The system will issue the certificate immediately.
+<p>
+<center>
+<table border="0" cellspacing="0" cellpadding="0">
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="manager.cgi">Request Submission - Manager</a></li>
+</font>
+</td>
+</tr>
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="installer.cgi">SCEP Enrollment - Installer</a></li>
+</font>
+</td>
+</tr>
+</table>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/scep/installer.cgi b/base/ra/apache/docroot/ee/scep/installer.cgi
new file mode 100755
index 000000000..8453c2cc4
--- /dev/null
+++ b/base/ra/apache/docroot/ee/scep/installer.cgi
@@ -0,0 +1,74 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ my %context;
+ $context{machine} = $cfg->get("service.machineName");
+ $context{port} = $cfg->get("service.unsecurePort");
+
+ my $result = $parser->execute_file_with_context("ee/scep/installer.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/scep/installer.vm b/base/ra/apache/docroot/ee/scep/installer.vm
new file mode 100644
index 000000000..be9f969ac
--- /dev/null
+++ b/base/ra/apache/docroot/ee/scep/installer.vm
@@ -0,0 +1,73 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>SCEP Router Request Using a One-Time Pin</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> :
+<a href="/ee/scep/index.cgi">SCEP Enrollment</a><br />
+Installer Interface
+</font><br>
+<p>
+This form is for router installer to request a certificate with the given one time pin.
+<p>
+<center>
+The SCEP enrollment URL for the router is:
+<br/>
+<br/>
+http://$machine:$port/ee/scep/pkiclient.cgi
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/scep/manager.cgi b/base/ra/apache/docroot/ee/scep/manager.cgi
new file mode 100755
index 000000000..8b547a928
--- /dev/null
+++ b/base/ra/apache/docroot/ee/scep/manager.cgi
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my %context;
+ my $result = $parser->execute_file_with_context("ee/scep/manager.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/scep/manager.vm b/base/ra/apache/docroot/ee/scep/manager.vm
new file mode 100644
index 000000000..e5b6abed5
--- /dev/null
+++ b/base/ra/apache/docroot/ee/scep/manager.vm
@@ -0,0 +1,123 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>SCEP Router Manager Request for a One-Time Pin</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<SCRIPT LANGUAGE="JavaScript">
+
+function validate()
+{
+ var c = document.enrollment.client_id.value;
+ if (c == '') {
+ alert("client id is empty");
+ return false;
+ }
+ var s = document.enrollment.site_id.value;
+ if (s == '') {
+ alert("site id is empty");
+ return false;
+ }
+ var e = document.enrollment.email.value;
+ if (e == '') {
+ alert("email is empty");
+ return false;
+ }
+}
+
+</SCRIPT>
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> :
+<a href="/ee/scep/index.cgi">SCEP Enrollment</a><br />
+Manager Interface
+</font><br>
+<p>
+This form is for manager to request for a one time pin so that router installer can request for a certificate.
+<p>
+<script language=javascript>
+<!--
+ if (navigator.appName == "Microsoft Internet Explorer") {
+ document.writeln('<form name="enrollment" method=post action="submit.cgi">'); } else {
+ document.writeln('<form name="enrollment" onSubmit="return validate();" method=post action="submit.cgi">'); }
+-->
+</script>
+
+<center>
+<table border="0" cellspacing="1" cellpadding="1">
+<tr>
+ <td width=20%>Client ID:</td>
+ <td><input type=text name=client_id value="" ></td>
+</tr>
+<tr>
+ <td>Site ID (IP Address):</td>
+ <td><input type=text name=site_id value=""></td>
+</tr>
+<tr>
+ <td>Your Email:</td>
+ <td><input type=text name=email value=""></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><input type=submit name=Submit value="Submit"></td>
+ <td></td>
+</tr>
+</table>
+</form>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/scep/pkiclient.cgi b/base/ra/apache/docroot/ee/scep/pkiclient.cgi
new file mode 100755
index 000000000..a54558f37
--- /dev/null
+++ b/base/ra/apache/docroot/ee/scep/pkiclient.cgi
@@ -0,0 +1,113 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use MIME::Base64;
+use URI::URL;
+use URI::Escape;
+use XML::Simple;
+use CGI;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Conn::CA;
+use PKI::Base::PinStore;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ my $operation = $util->get_alphanum_val($q->param('operation'));
+ my $message = $util->get_val($q->param('message'));
+ $message = uri_escape($message);
+
+ my $ca = PKI::Conn::CA->new();
+ $ca->open($cfg);
+ if ($operation eq "GetCACert") {
+ my $content = $ca->scep_get_ca_cert("ca1", $operation, $message);
+
+ print "Content-Type: application/x-x509-ca-cert\n\n";
+ print $content;
+ } elsif ($operation eq "PKIOperation") {
+ my $decoded = $ca->scep_decode("ca1", $operation, $message);
+ $decoded =~ /(\<XMLResponse\>.*\<\/XMLResponse\>)/;
+ $decoded = $1;
+ my $parser = XML::Simple->new();
+ my $response = $parser->XMLin($decoded);
+
+ # one time pin
+ my $pin = $response->{'PKCS10'}->{'ChallengePassword'}->{'Password'} ;
+ # IP Address
+ my $key = $ENV{'REMOTE_ADDR'};
+
+ # check PIN
+ if (1) {
+ my $pin_store = PKI::Base::PinStore->new();
+ $pin_store->open($cfg);
+ my $pinref = $pin_store->read_pin($key);
+ if (defined($pinref) && $pinref->{'pin'} eq $pin) {
+ $pin_store->delete($key);
+ } else {
+ $pin_store->close();
+ # XXX - return SCEP error
+ print $q->redirect("/ee/scep/installer.cgi");
+ return;
+ }
+ $pin_store->close();
+ }
+
+ my $content = $ca->scep_pki_message("ca1", $operation, $message);
+
+ print "Content-Type: application/x-pki-message\n\n";
+ print $content;
+ }
+ $ca->close();
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/scep/submit.cgi b/base/ra/apache/docroot/ee/scep/submit.cgi
new file mode 100755
index 000000000..b3dfd7a5d
--- /dev/null
+++ b/base/ra/apache/docroot/ee/scep/submit.cgi
@@ -0,0 +1,91 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use DBI;
+use CGI;
+use PKI::Service::Op;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Request::Queue;
+use Template::Velocity;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $client_id = $util->get_val($q->param('client_id'));
+ my $site_id = $util->get_val($q->param('site_id'));
+ my $email = $util->get_val($q->param('email'));
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+ my $request_id = $queue->create_request("scep",
+ "client_id=" . $client_id . ";" .
+ "site_id=" . $site_id,
+ "0",
+ $email);
+ my %context;
+ $context{request_id} = $util->html_encode($request_id);
+ $self->debug_log($cfg, "request $request_id created");
+ $queue->close();
+
+ my $result = $parser->execute_file_with_context("ee/scep/submit.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/scep/submit.vm b/base/ra/apache/docroot/ee/scep/submit.vm
new file mode 100644
index 000000000..6786bf936
--- /dev/null
+++ b/base/ra/apache/docroot/ee/scep/submit.vm
@@ -0,0 +1,76 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>SCEP Router Request Submission</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> :
+<a href="/ee/scep/index.cgi">SCEP Enrollment</a><br />
+Manager Interface
+</font><br>
+<p>
+Your request has been successfully submitted.
+<p>
+<center>
+<table border="0" cellspacing="1" cellpadding="1">
+<tr>
+ <td width=20%>Request ID:</td>
+ <td><a href="/ee/request/status.cgi?id=$request_id">$request_id</a></td>
+</tr>
+</table>
+</form>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/server/admin.cgi b/base/ra/apache/docroot/ee/server/admin.cgi
new file mode 100755
index 000000000..18945da02
--- /dev/null
+++ b/base/ra/apache/docroot/ee/server/admin.cgi
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my %context;
+ my $result = $parser->execute_file_with_context("ee/server/admin.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/server/admin.vm b/base/ra/apache/docroot/ee/server/admin.vm
new file mode 100644
index 000000000..35af32ca8
--- /dev/null
+++ b/base/ra/apache/docroot/ee/server/admin.vm
@@ -0,0 +1,132 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Server Certificate Request</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+<SCRIPT LANGUAGE="JavaScript">
+
+function validate()
+{
+ var x = document.enrollment.server_id.value;
+ if (x == '') {
+ alert("server id is empty");
+ return false;
+ }
+ var s = document.enrollment.site_id.value;
+ if (s == '') {
+ alert("site id is empty");
+ return false;
+ }
+ var e = document.enrollment.email.value;
+ if (e == '') {
+ alert("email is empty");
+ return false;
+ }
+ var c = document.enrollment.csr.value;
+ if (c == '') {
+ alert("csr is empty");
+ return false;
+ }
+}
+</SCRIPT>
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> :
+<a href="/ee/server/index.cgi">Server Enrollment</a><br />
+Server Administrator Interface
+</font><br>
+<p>
+This form is for server administrator to request for a server certificate.
+<p>
+
+<script language=javascript>
+<!--
+ if (navigator.appName == "Microsoft Internet Explorer") {
+ document.writeln('<form name="enrollment" method=post action="submit.cgi">');
+ } else {
+ document.writeln('<form name="enrollment" onSubmit="return validate();" method=post action="submit.cgi">');
+ }
+-->
+</script>
+<center>
+<table border="0" cellspacing="1" cellpadding="1">
+<tr>
+ <td width=20%>Server ID:</td>
+ <td><input type=text name=server_id value="" ></td>
+</tr>
+<tr>
+ <td>Site ID:</td>
+ <td><input type=text name=site_id value=""></td>
+</tr>
+<tr>
+ <td>Your Email:</td>
+ <td><input type=text name=email value=""></td>
+</tr>
+<tr>
+ <td>CSR:</td>
+ <td><textarea cols=40 rows=5 name=csr></textarea></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><input type=submit name=Submit value="Submit"></td>
+ <td></td>
+</tr>
+</table>
+</form>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/server/index.cgi b/base/ra/apache/docroot/ee/server/index.cgi
new file mode 100755
index 000000000..830409a8b
--- /dev/null
+++ b/base/ra/apache/docroot/ee/server/index.cgi
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my %context;
+ my $result = $parser->execute_file_with_context("ee/server/index.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/server/index.vm b/base/ra/apache/docroot/ee/server/index.vm
new file mode 100644
index 000000000..04727ae41
--- /dev/null
+++ b/base/ra/apache/docroot/ee/server/index.vm
@@ -0,0 +1,76 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA End-Entity</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> : <a href="/ee/server/index.cgi">Server Enrollment</a><br />
+</font><br>
+<p>
+Server Administrator must use the following form to submit a request which will later be approved by a RA agent. Upon approval, the administrator will be notified by email and the server certificate can be retrieved.
+<p>
+<center>
+<table border="0" cellspacing="0" cellpadding="0">
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="admin.cgi">Request Submission - Administrator</a></li>
+</font>
+</td>
+</tr>
+</table>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/server/submit.cgi b/base/ra/apache/docroot/ee/server/submit.cgi
new file mode 100755
index 000000000..4916033ee
--- /dev/null
+++ b/base/ra/apache/docroot/ee/server/submit.cgi
@@ -0,0 +1,93 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Request::Queue;
+use Template::Velocity;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $util = PKI::Base::Util->new();
+
+ my $server_id = $util->get_val($q->param('server_id'));
+ my $site_id = $util->get_val($q->param('site_id'));
+ my $email = $util->get_val($q->param('email'));
+ my $csr = $util->get_val($q->param('csr'));
+
+ $csr = $util->normalize_csr($csr);
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+ my $request_id = $queue->create_request("server",
+ "server_id=" . $server_id . ";" .
+ "site_id=" . $site_id . ";" .
+ "csr=" . $csr,
+ "0",
+ $email);
+ my %context;
+ $context{request_id} = $util->html_encode($request_id);
+ $self->debug_log($cfg, "request $request_id created");
+ $queue->close();
+
+ my $result = $parser->execute_file_with_context("ee/server/submit.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/server/submit.vm b/base/ra/apache/docroot/ee/server/submit.vm
new file mode 100644
index 000000000..f08914583
--- /dev/null
+++ b/base/ra/apache/docroot/ee/server/submit.vm
@@ -0,0 +1,75 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>Server Certificate Request Submission</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> :
+<a href="/ee/server/index.cgi">Server Enrollment</a><br />
+Server Administrator Interface
+</font><br>
+<p>
+Your request has been successfully submitted.
+<p>
+<center>
+<table border="0" cellspacing="1" cellpadding="1">
+<tr>
+ <td width=20%>Request ID:</td>
+ <td><a href="/ee/request/status.cgi?id=$request_id">$request_id</a></td>
+</tr>
+</table>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/user/index.cgi b/base/ra/apache/docroot/ee/user/index.cgi
new file mode 100755
index 000000000..ef6b3aa47
--- /dev/null
+++ b/base/ra/apache/docroot/ee/user/index.cgi
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my %context;
+ my $result = $parser->execute_file_with_context("ee/user/index.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/user/index.vm b/base/ra/apache/docroot/ee/user/index.vm
new file mode 100644
index 000000000..76b06a91c
--- /dev/null
+++ b/base/ra/apache/docroot/ee/user/index.vm
@@ -0,0 +1,83 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA End-Entity</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> : <a href="/ee/user/index.cgi">User Enrollment</a><br />
+</font><br>
+<p>
+For user enrollment, user must access the following forms with appropriate client (i.e. browser) where key pair will be generated.
+<p>
+<center>
+<table border="0" cellspacing="0" cellpadding="0">
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="user.cgi">Request Submission - User</a></li>
+</font>
+</td>
+</tr>
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="renewal.cgi">Renewal - User</a></li>
+</font>
+</td>
+</tr>
+</table>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/user/renew.cgi b/base/ra/apache/docroot/ee/user/renew.cgi
new file mode 100755
index 000000000..63d646ec9
--- /dev/null
+++ b/base/ra/apache/docroot/ee/user/renew.cgi
@@ -0,0 +1,165 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Base::Conf;
+use PKI::Request::Queue;
+use Template::Velocity;
+use PKI::Service::Op;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my $util = PKI::Base::Util->new();
+ my $error = "";
+
+ my $host = $cfg->get("service.machineName");
+ my $port = $cfg->get("service.non_clientauth_securePort");
+
+ $self->debug_params($cfg, $q);
+
+ my $cert = $self->get_cert_record($cfg);
+ $self->debug_log( $cfg, "after get_cert_record");
+ if (!defined($cert) || ($cert eq "")) {
+ $self->debug_log( $cfg, "cert not defined");
+ $error = "certificate not found in database";
+ print $q->redirect("/ee/error.cgi?error=$error");
+ return;
+ }
+ $self->debug_log( $cfg, "got cert");
+
+ my $csr = $cert->{'csr'};
+ if ($csr eq "") {
+ $error = "csr not found in database";
+ print $q->redirect("/ee/error.cgi?error=$error");
+ return;
+ }
+ $self->debug_log( $cfg, "got csr");
+
+ my $req_id = $cert->{'rid'};
+ if ($req_id eq "") {
+ $error = "reqid not found in database";
+ print $q->redirect("/ee/error.cgi?error=$error");
+ return;
+ }
+ $self->debug_log( $cfg, "got req_id = $req_id");
+ $self->debug_log( $cfg, "before renewl read/create request");
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+ my $o_req = $queue->read_request($req_id);
+ if ($o_req eq "") {
+ $self->debug_log( $cfg, "got null o_req");
+ print $q->redirect("/ee/error.cgi?error=$error");
+ return;
+ }
+
+ my $uid = "";
+ my $site_id = "";
+ my $org_csr = "";
+ my $csr_type = "";
+
+ my $data = $o_req->{'data'};
+ foreach $nv (split(/;/, $data)) {
+ my ($n, $v) = split(/=/, $nv);
+ if ($n eq "uid") {
+ $uid = $v;
+ }
+ if ($n eq "site_id") {
+ $site_id = $v;
+ }
+ if ($n eq "csr") {
+ $org_csr = $v;
+ }
+ if ($n eq "csr_type") {
+ $csr_type = $v;
+ }
+ }
+
+ my $new_request = $queue->create_request("renewal",
+ "uid=" . $uid . ";" .
+ "site_id=" . $site_id . ";" .
+ "csr_type=" . $csr_type . ";" .
+ "csr=" . $csr,
+ "orig_reqid=" . $o_req->{'rowid'},
+ $o_req->{'created_by'});
+
+ #self-renewal is created and processed by the same user
+ $ref = $queue->approve_request($new_request, $o_req->{'created_by'});
+ my $nreq = $queue->read_request($new_request);
+ $error = $nreq->{'errorString'};
+ if ($error ne "0") {
+ $self->debug_log( $cfg, "after approve request, got error=$error");
+ print $q->redirect("/ee/error.cgi?error=$error");
+ return;
+ }
+
+ my %context;
+ $context{request_id} = $util->html_encode($new_request);
+ $self->debug_log($cfg, "request $new_request created");
+ $queue->close();
+ $self->debug_log( $cfg, "after renewl read/create request $new_request");
+
+ $context{data} = $util->breakline($util->html_encode($ref->{'data'}), 40);
+ $context{output} = $util->breakline($util->html_encode($ref->{'output'}), 40);
+ $context{serialno} = $util->html_encode($ref->{'serialno'});
+ $context{host} = $util->html_encode($host);
+ $context{port} = $util->html_encode($port);
+
+ #print $q->redirect("/ee/request/getcert.cgi?id=$new_request");
+ my $result = $parser->execute_file_with_context("ee/user/renew.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/user/renew.vm b/base/ra/apache/docroot/ee/user/renew.vm
new file mode 100644
index 000000000..dee119c65
--- /dev/null
+++ b/base/ra/apache/docroot/ee/user/renew.vm
@@ -0,0 +1,86 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>User Certificate Renewal Notification</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="https://$host:$port/ee/index.cgi">RA Services</a> :
+<a href="https://$host:$port/ee/user/index.cgi">User Enrollment</a><br />
+Renewal Interface
+</font><br>
+<p>
+Your certificate has been successfully renewed.
+<p>
+<center>
+<table border="0" cellspacing="1" cellpadding="1">
+<tr>
+ <td width=20%>Request ID:</td>
+ <td><a href="https://$host:$port/ee/request/status.cgi?id=$request_id">$request_id</a></td>
+<tr valign="TOP">
+<td><b>Data</b></td>
+<td>$data</td>
+</tr>
+<tr valign="TOP">
+<td><b>Output</b></td>
+<td>$output</td>
+</tr>
+<tr valign="TOP">
+<td><b>Serial Number</b></td>
+<td>$serialno</td>
+</tr>
+</table>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/user/renewal.cgi b/base/ra/apache/docroot/ee/user/renewal.cgi
new file mode 100755
index 000000000..63a211eff
--- /dev/null
+++ b/base/ra/apache/docroot/ee/user/renewal.cgi
@@ -0,0 +1,74 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ my $host = $cfg->get("service.machineName");
+ my $port = $cfg->get("service.securePort");
+
+ my %context;
+ $context{url} = "https://$host:$port/ee/user/renew.cgi";
+ my $result = $parser->execute_file_with_context("ee/user/renewal.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/user/renewal.vm b/base/ra/apache/docroot/ee/user/renewal.vm
new file mode 100644
index 000000000..1e2b438a1
--- /dev/null
+++ b/base/ra/apache/docroot/ee/user/renewal.vm
@@ -0,0 +1,73 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>User Certificate Renewal</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> :
+<a href="/ee/user/index.cgi">User Enrollment</a><br />
+User Renewal Interface
+</font><br>
+<p>
+This form is for end user to renew his/her certificates.<br>
+At popup, please select the user certificate to renew.
+<p>
+<center>
+<form method=post action=$url>
+<input type=submit name=Submit value="Renewal">
+</form>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/user/submit.cgi b/base/ra/apache/docroot/ee/user/submit.cgi
new file mode 100755
index 000000000..26c900e00
--- /dev/null
+++ b/base/ra/apache/docroot/ee/user/submit.cgi
@@ -0,0 +1,112 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use Benchmark;
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::Util;
+use PKI::Base::Registry;
+use PKI::Request::Queue;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $st = new Benchmark;
+
+ my $util = PKI::Base::Util->new();
+
+ my $userid = $util->get_val($q->param('uid'));
+ my $fullname = $util->get_val($q->param('cn'));
+ my $site_id = $util->get_val($q->param('site_id'));
+ my $email = $util->get_val($q->param('email'));
+ my $csr_type = $util->get_alphanum_val($q->param('csr_type'));
+ my $csr = $util->get_val($q->param('csr'));
+
+ $csr = $util->normalize_csr($csr);
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ my $db_st = new Benchmark;
+ my $queue = PKI::Request::Queue->new();
+ $queue->open($cfg);
+ my $request_id = $queue->create_request("user",
+ "uid=" . $userid . ";" .
+ "cn=" . $fullname . ";" .
+ "site_id=" . $site_id . ";" .
+ "csr_type=" . $csr_type . ";" .
+ "csr=" . $csr,
+ "0",
+ $email);
+ my %context;
+ $context{request_id} = $util->html_encode($request_id);
+ $self->debug_log($cfg, "request $request_id created");
+ $queue->close();
+ my $db_et = new Benchmark;
+
+ my $t_st = new Benchmark;
+ my $result = $parser->execute_file_with_context("ee/user/submit.vm",
+ \%context);
+ my $t_et = new Benchmark;
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+
+ my $et = new Benchmark;
+ $self->debug_log($cfg, "benchmark " .
+ "total=" . timestr(timediff($et, $st)) . " " .
+ "db total=" . timestr(timediff($db_et, $db_st)) . " " .
+ "template total=" . timestr(timediff($t_et, $t_st)) . " "
+ );
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/user/submit.vm b/base/ra/apache/docroot/ee/user/submit.vm
new file mode 100644
index 000000000..6c7a0cd44
--- /dev/null
+++ b/base/ra/apache/docroot/ee/user/submit.vm
@@ -0,0 +1,75 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>User Certificate Request Submission</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> :
+<a href="/ee/user/index.cgi">User Enrollment</a><br />
+Manager Interface
+</font><br>
+<p>
+Your request has been successfully submitted.
+<p>
+<center>
+<table border="0" cellspacing="1" cellpadding="1">
+<tr>
+ <td width=20%>Request ID:</td>
+ <td><a href="/ee/request/status.cgi?id=$request_id">$request_id</td>
+</tr>
+</table>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ee/user/user.cgi b/base/ra/apache/docroot/ee/user/user.cgi
new file mode 100755
index 000000000..2d58a532b
--- /dev/null
+++ b/base/ra/apache/docroot/ee/user/user.cgi
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ my %context;
+ my $result = $parser->execute_file_with_context("ee/user/user.vm",
+ \%context);
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%context);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/ee/user/user.vm b/base/ra/apache/docroot/ee/user/user.vm
new file mode 100644
index 000000000..04763d7cf
--- /dev/null
+++ b/base/ra/apache/docroot/ee/user/user.vm
@@ -0,0 +1,435 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<OBJECT
+ classid="clsid:127698e4-e730-4e5c-a2b1-21490a70c8a1"
+ CODEBASE="/ee/xenroll.dll"
+ id="Enroll">
+</OBJECT>
+
+<OBJECT id='g_objClassFactory' CLASSID='clsid:884e2049-217d-11da-b2a4-000e7bbb2b09'>
+</OBJECT>
+
+<title>User Certificate Request</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+<SCRIPT LANGUAGE="JavaScript">
+function encode_utf8( s )
+{
+ return unescape( encodeURIComponent( s ) );
+}
+
+function decode_utf8( s )
+{
+ return decodeURIComponent( escape( s ) );
+}
+
+function validate()
+{
+ var x = document.enrollment.uid.value;
+ if (x == '') {
+ alert("uid is empty");
+ return false;
+ }
+ var e = document.enrollment.email.value;
+ if (e == '') {
+ alert("email is empty");
+ return false;
+ }
+ var cn = document.enrollment.cn.value;
+ if (cn == '') {
+ alert("Full name is empty");
+ return false;
+ }
+ var dn = encode_utf8("uid="+x+",e="+e+",cn="+cn);
+ with (document.forms[0]) {
+ crmfObject = crypto.generateCRMFRequest(
+ dn,
+ "regToken", "authenticator",
+ null,
+ "setCRMFRequest();",
+ 1024, null, "rsa-dual-use");
+ return false;
+ }
+}
+
+function setCRMFRequest()
+{
+ with (document.forms[0]) {
+ csr.value = crmfObject.request;
+ submit();
+ }
+}
+
+</SCRIPT>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+<a href="/ee/index.cgi">RA Services</a> :
+<a href="/ee/user/index.cgi">User Enrollment</a><br />
+User Interface
+</font><br>
+<p>
+This form is for user to request for an end-user certificate.
+<p>
+<script language=javascript>
+<!--
+ if (navigator.appName == "Microsoft Internet Explorer") {
+ document.writeln('<form name="enrollment" method=post action="submit.cgi">');
+ } else {
+ document.writeln('<form name="enrollment" onSubmit="return validate();" method=post action="submit.cgi">');
+ }
+-->
+</script>
+<SCRIPT LANGUAGE=VBS>
+<!--
+'Get OS Version, works for Vista and below only
+Function GetOSVersion
+ dim agent
+ dim result
+ dim pos
+
+ agent = Navigator.appVersion
+ pos = InStr(agent,"NT 6.")
+
+ If pos > 0 Then
+ GetOSVersion = 6 ' Vista
+ Exit Function
+ End If
+
+ pos = InStr(agent,"NT 5.")
+
+ If pos > 0 Then
+ GetOSVersion = 5 ' XP etc
+ Exit Function
+ End If
+
+' Default
+ GetOSVersion = 5
+End Function
+
+Sub Send_OnClick
+ Dim TheForm
+ Dim szName
+ Dim options
+ Dim osVersion
+ Dim result
+ Set TheForm = Document.enrollment
+
+ osVersion = GetOSVersion()
+
+ If osVersion <> 6 Then 'Not Vista
+
+ ' Contruct the X500 distinguished name
+ szName = "0.9.2342.19200300.100.1.1=" & TheForm.uid.Value & ",E=" & TheForm.email.Value & ",CN=" & TheForm.cn.Value
+
+ On Error Resume Next
+ Enroll.HashAlgorithm = "MD5"
+ Enroll.KeySpec = 1
+
+ ' Pick the provider that is selected
+ set options = TheForm.all.cryptprovider.options
+ index = options.selectedIndex
+ Enroll.providerType = options(index).value
+ Enroll.providerName = options(index).text
+
+ ' adding 2 to "GenKeyFlags" will enable the 'High Security'
+ ' (USER_PROTECTED) mode, which means IE will pop up a dialog
+ ' asking what level of protection you would like to give
+ ' the key - this varies from 'none' to 'confirm password
+ ' every time the key is used'
+ Enroll.GenKeyFlags = 1 ' key PKCS12-exportable
+ szCertReq = Enroll.createPKCS10(szName, "1.3.6.1.5.5.7.3.2")
+ theError = Err.Number
+ On Error Goto 0
+ '
+ ' If the user has cancelled things the we simply ignore whatever
+ ' they were doing ... need to think what should be done here
+ '
+ If (szCertReq = Empty AND theError = 0) Then
+ Exit Sub
+ End If
+
+ If (szCertReq = Empty OR theError <> 0) Then
+ '
+ ' There was an error in the key pair generation. The error value
+ ' is found in the variable 'theError' which we snarfed above before
+ ' we did the 'On Error Goto 0' which cleared it again.
+ '
+ sz = "The error '" & Hex(theError) & "' occurred." & chr(13) & chr(10) & "Your credentials could not be generated."
+ result = MsgBox(sz, 0, "Credentials Enrollment")
+ Exit Sub
+ End If
+
+ TheForm.csr.Value = szCertReq
+
+ ' TheForm.Submit
+
+Else 'Vista
+ Dim enrollment
+ Dim privateKey
+ Dim request
+ Dim csr
+ Dim objDN
+
+ 'certUsage is "1.3.6.1.5.5.7.3.2"
+
+ On Error Resume Next
+ 'CreateObject("X509Enrollment.CX509EnrollmentWebClassFactory")
+
+ If IsObject(g_objClassFactory) = False Then
+ result = MsgBox("Can't create Factory Object " & " Error: " & Err.number & " :" & Err.description,0,"")
+ Exit Sub
+ End If
+
+ Set enrollment = g_objClassFactory.CreateObject("X509Enrollment.CX509Enrollment")
+
+ If IsObject(enrollment) = False Then
+ result = MsgBox("Can't create enroll Object! " & " Error: " & Err.number & " :" & Err.description,"")
+ Exit Sub
+ End If
+
+ Set privateKey = g_objClassFactory.CreateObject("X509Enrollment.CX509PrivateKey")
+
+ If IsObject(privateKey) = False Then
+ result = MsgBox("Can't create Key Object! " & " Error: " & Err.number & " :" & Err.description,0,"")
+ Exit Sub
+ End If
+
+ Set request = g_objClassFactory.CreateObject("X509Enrollment.CX509CertificateRequestPkcs10")
+
+ If IsObject(request) = False Then
+ result = MsgBox("Can't create Request Object. ! " & " Error: " & Err.number & " :" & Err.description,0,"")
+ Exit Sub
+ End If
+
+ privateKey.KeySpec= "1"
+
+ ' Pick the provider that is selected
+ set options = TheForm.all.cryptprovider.options
+ index = options.selectedIndex
+ privateKey.ProviderType= index
+ privateKey.ProviderName = options(index).text
+
+ szName = "0.9.2342.19200300.100.1.1=" & TheForm.uid.Value & ",E=" & TheForm.email.Value & ",CN=" & TheForm.cn.Value
+
+ Set objDN = g_objClassFactory.CreateObject("X509Enrollment.CX500DistinguishedName")
+
+ If IsObject(objDN) = False Then
+ result = MsgBox("Can't create DN Object. ! " & " Error: " & Err.number & " :" & Err.description,0,"")
+ Exit Sub
+ End If
+
+ objDN.Encode szName,0
+
+ request.InitializeFromPrivateKey 1,privateKey,""
+ request.Subject = objDN
+
+ enrollment.InitializeFromRequest(request)
+ csr=enrollment.CreateRequest(1)
+
+ If len(csr) = 0 Then
+ result = MsgBox("Error Creating Request! "& " Error: " & Err.number & " :" & Err.description,0,"")
+ Exit Sub
+ End If
+
+ TheForm.csr.Value = csr
+
+ End If
+ Exit Sub
+
+End Sub
+
+-->
+</SCRIPT>
+<center>
+<table border="0" cellspacing="1" cellpadding="1">
+<tr>
+ <td>UID:</td>
+ <td><input type=text name=uid value=""></td>
+</tr>
+<tr>
+ <td>Full Name:</td>
+ <td><input type=text name=cn value=""></td>
+</tr>
+<tr>
+ <td>Site ID:</td>
+ <td><input type=text name=site_id value=""></td>
+</tr>
+<tr>
+ <td>Your Email:</td>
+ <td><input type=text name=email value=""></td>
+</tr>
+<tr>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+<script language=javascript>
+<!--
+ if (navigator.appName == "Microsoft Internet Explorer") {
+ document.writeln('<SELECT NAME=\"cryptprovider\"></SELECT>');
+ }
+-->
+</script>
+<tr>
+ <td>
+<script language=javascript>
+<!--
+ if (navigator.appName == "Microsoft Internet Explorer") {
+ document.writeln('<input type=hidden name=csr_type value="pkcs10">');
+ document.writeln('<input type=submit Name=Send value="Submit">');
+ } else {
+ document.writeln('<input type=hidden name=csr_type value="crmf">');
+ document.writeln('<input type=submit name=Submit value="Submit">');
+ }
+-->
+</script>
+ </td>
+ <td></td>
+</tr>
+</table>
+</center>
+<input type=hidden name="csr" value="">
+<SCRIPT LANGUAGE=VBS>
+<!--
+FindProviders
+
+Function FindProviders
+ Dim i, j
+ Dim providers()
+ i = 0
+ j = 1
+ Dim el
+ Dim temp
+ Dim first
+ Dim TheForm
+ Set TheForm = document.enrollment
+ On Error Resume Next
+ first = 0
+
+ Dim osVersion
+ Dim result
+ osVersion = GetOSVersion()
+
+ If osVersion <> 6 Then 'Not Vista
+ Do While True
+ temp = ""
+ Enroll.providerType = j
+ temp = Enroll.enumProviders(i,0)
+ If Len(temp) = 0 Then
+ If j < 1 Then
+ j = j + 1
+ i = 0
+ Else
+ Exit Do
+ End If
+ Else
+ set el = document.createElement("OPTION")
+ el.text = temp
+ el.value = j
+ If temp = "Microsoft Base Cryptographic Provider v1.0" Then
+ first = i
+ End If
+ TheForm.cryptprovider.add(el)
+ If first = 0 Then
+ first = 1
+ TheForm.cryptprovider.selectedIndex = 0
+ Else
+ TheForm.cryptprovider.selectedIndex = first
+ End If
+ i = i + 1
+ End If
+ Loop
+ Else 'Vista
+
+ Dim csps
+ Set csps = g_objClassFactory.CreateObject("X509Enrollment.CCspInformations")
+ If IsObject(csps) = False Then
+ result = MsgBox("Can't create CSP List Object! " & " Error: " & Err.number & " :" & Err.description,0,"")
+ Exit Function
+
+ End If
+ csps.AddAvailableCsps()
+ 'result = MsgBox(csps.Count,0,"Number of CSPS")
+
+ Dim curName
+ Dim csp
+ Dim selected
+ selected = 0
+ For i = 0 to csps.Count-1
+
+ curName = csps.ItemByIndex(i).Name
+ If len(curName) > 0 Then
+ Set csp = document.createElement("OPTION")
+ csp.text = curName
+ csp.value = 1
+ TheForm.cryptprovider.add(csp)
+
+ If curName = "Microsoft Base Cryptographic Provider v1.0" Then
+ selected = i
+ End If
+ 'result = MsgBox(curName,0,"")
+ End If
+ Next
+TheForm.cryptprovider.selectedIndex = selected
+ End If
+End Function
+
+-->
+</SCRIPT>
+</form>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/footer.vm b/base/ra/apache/docroot/footer.vm
new file mode 100644
index 000000000..a596e45b1
--- /dev/null
+++ b/base/ra/apache/docroot/footer.vm
@@ -0,0 +1,19 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+ <div id="footer">
+ </div>
diff --git a/base/ra/apache/docroot/header.vm b/base/ra/apache/docroot/header.vm
new file mode 100644
index 000000000..3824b87f3
--- /dev/null
+++ b/base/ra/apache/docroot/header.vm
@@ -0,0 +1,26 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<div id="header">
+ <a href="http://pki.fedoraproject.org" title="Visit pki.fedoraproject.org for more information"><img src="/pki/images/logo_header.gif" alt="Dogtag" id="myLogo" /></a>
+ <div id="headertitle">
+ <a href="/" title="Dogtag homepage">Dogtag<sup><font size="-2">&reg;</font></sup> Certificate System</a>
+ </div>
+ <div id="account">
+ <dl><dt><span></span></dt><dd></dd></dl>
+ </div>
+</div>
diff --git a/base/ra/apache/docroot/index.cgi b/base/ra/apache/docroot/index.cgi
new file mode 100755
index 000000000..0e643166b
--- /dev/null
+++ b/base/ra/apache/docroot/index.cgi
@@ -0,0 +1,76 @@
+#!/usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# --- END COPYRIGHT BLOCK ---
+#
+#
+#
+#
+
+package op;
+
+use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl";
+
+use CGI;
+use PKI::Service::Op;
+use Template::Velocity;
+use PKI::Base::Conf;
+use PKI::Base::Registry;
+
+use vars qw (@ISA);
+use PKI::Service::Op;
+@ISA = qw(PKI::Service::Op);
+
+sub new {
+ my $self = {};
+ bless ($self);
+ return $self;
+}
+
+sub process()
+{
+ my $self = shift;
+
+ my $q = CGI->new();
+
+ my $docroot = PKI::Base::Registry->get_docroot();
+ my $parser = PKI::Base::Registry->get_parser();
+ my $cfg = PKI::Base::Registry->get_config();
+
+ $self->debug_params($cfg, $q);
+
+ $::symbol{machineName} = $cfg->get("service.machineName");
+ $::symbol{non_clientauth_securePort} = $cfg->get("service.non_clientauth_securePort");
+ $::symbol{securePort} = $cfg->get("service.securePort");
+ $::symbol{unsecurePort} = $cfg->get("service.unsecurePort");
+
+ my $result = $parser->execute_file("index.vm");
+
+ my $xml = $q->param('xml');
+ if ($xml eq "true") {
+ print "Content-Type: text/xml\n\n";
+ print $self->xml_output(\%::symbol);
+ } else {
+ print "Content-Type: text/html\n\n";
+ print "$result";
+ }
+}
+
+
+my $op = op->new();
+$op->execute();
diff --git a/base/ra/apache/docroot/index.vm b/base/ra/apache/docroot/index.vm
new file mode 100644
index 000000000..f17efb658
--- /dev/null
+++ b/base/ra/apache/docroot/index.vm
@@ -0,0 +1,90 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<title>RA Services</title>
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+</head>
+<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
+
+#include ( "header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+
+
+<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif">
+Certificate System RA Services Page
+</font><br>
+<p>
+</font>
+<p>
+<center>
+<table border="0" cellspacing="0" cellpadding="0">
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="https://$machineName:$non_clientauth_securePort/ee/index.cgi">SSL End Users Services</a></li>
+</font>
+</td>
+</tr>
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="https://$machineName:$securePort/agent/index.cgi">Agent Services</a></li>
+</font>
+</td>
+</tr>
+<tr valign="TOP">
+<td>
+<font size=4 face="PrimaSans BT, Verdana, sans-serif">
+<li><a href="https://$machineName:$securePort/admin/index.cgi">Administrator Services</a></li>
+</font>
+</td>
+</tr>
+</table>
+</center>
+#include ( "footer.vm" )
+
+</body>
+</html>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/adminauthenticatepanel.vm b/base/ra/apache/docroot/ra/admin/console/config/adminauthenticatepanel.vm
new file mode 100644
index 000000000..b27042cfb
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/adminauthenticatepanel.vm
@@ -0,0 +1,52 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+<h2>Authentication</h2>
+<p>
+The uid and password are used to authenticate to the master subsystem. These are the administrator's credential information for the master subsystem.
+#if ($systemType != "tps")
+<br/>
+If authentication is successful, a cloned subsystem will retrieve the configuration information from the master one.
+#end
+<br/>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+ <table class="details">
+ <tr>
+ <th>Uid:</th>
+
+ <td><input type="text" size="40" name="uid" value="$uid"/></td>
+ </tr>
+ <tr>
+ <th>Password:</th>
+
+ <td><input type="password" size="40" name="__password" value="$password" autocomplete="off"/></td>
+ </tr>
+ </table>
+<p>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/adminpanel.vm b/base/ra/apache/docroot/ra/admin/console/config/adminpanel.vm
new file mode 100644
index 000000000..3c32c4901
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/adminpanel.vm
@@ -0,0 +1,237 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT ID=Send_OnClick type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+#if ($import == 'true' && $clone != 'clone')
+ var email = document.forms[0].email.value;
+ var name = document.forms[0].name.value;
+ var o = '$securityDomain';
+ if (name == '') {
+ alert("Name is empty");
+ return;
+ }
+ if (email == '') {
+ alert("Email is empty");
+ return;
+ }
+ var dn = "cn=" + name + ",uid=admin,e="+email+",o="+o;
+ document.forms[0].subject.value = dn;
+ var keyGenAlg = "rsa-dual-use";
+
+ if (navigator.appName == "Netscape" &&
+ typeof(crypto.version) != "undefined") {
+
+ crmfObject = crypto.generateCRMFRequest(
+ dn, "regToken", "authenticator", null,
+ "setCRMFRequest();", 1024, null, keyGenAlg);
+ } else {
+ Send_OnClick();
+ }
+#else
+ with (document.forms[0]) {
+ submit();
+ }
+#end
+}
+
+function setCRMFRequest()
+{
+ with (document.forms[0]) {
+ cert_request.value = crmfObject.request;
+ submit();
+ }
+}
+
+</SCRIPT>
+<SCRIPT type="text/VBS">
+<!--
+
+Sub Send_OnClick
+ Dim TheForm
+ Dim szName
+ Set TheForm = Document.f
+
+
+ ' Contruct the X500 distinguished name
+ szName = "CN=NAME"
+
+ ' IE doesnt like the dn containing the O component
+
+ On Error Resume Next
+ Enroll.HashAlgorithm = "MD5"
+ Enroll.KeySpec = 1
+
+ Enroll.providerType = 1
+ Enroll.providerName = "Microsoft Base Cryptographic Provider v1.0"
+
+ ' adding 2 to "GenKeyFlags" will enable the 'High Security'
+ ' (USER_PROTECTED) mode, which means IE will pop up a dialog
+ ' asking what level of protection the user would like to give
+ ' the key - this varies from 'none' to 'confirm password
+ ' every time the key is used'
+ Enroll.GenKeyFlags = 1 ' key PKCS12-exportable
+ szCertReq = Enroll.createPKCS10(szName, "1.3.6.1.5.5.7.3.2")
+
+ theError = Err.Number
+ On Error Goto 0
+ '
+ ' If the user has cancelled things the we simply ignore whatever
+ ' they were doing ... need to think what should be done here
+ '
+ If (szCertReq = Empty AND theError = 0) Then
+ Exit Sub
+ End If
+ If (szCertReq = Empty OR theError <> 0) Then
+ '
+ ' There was an error in the key pair generation. The error value
+ ' is found in the variable 'theError' which we snarfed above before
+ ' we did the 'On Error Goto 0' which cleared it again.
+ '
+ sz = "The error '" & Hex(theError) & "' occurred." & chr(13) & chr(10) & "The credentials could not be generated."
+ result = MsgBox(sz, 0, "Credentials Enrollment")
+ Exit Sub
+ End If
+
+ TheForm.cert_request.Value = szCertReq
+ TheForm.cert_request_type.Value = "pkcs10"
+ TheForm.subject.Value = "cn=" & TheForm.name.Value & ",uid=" & TheForm.uid.Value & ",e=" & TheForm.email.Value & ",o=" & TheForm.securitydomain.Value
+
+ TheForm.Submit
+ Exit Sub
+
+End Sub
+
+-->
+</SCRIPT>
+
+<SCRIPT type="text/VBS">
+<!--
+FindProviders
+
+Function FindProviders
+ Dim i, j
+ Dim providers()
+ i = 0
+ j = 1
+ Dim el
+ Dim temp
+ Dim first
+ Dim TheForm
+ Set TheForm = document.f
+ On Error Resume Next
+ first = 0
+
+ Do While True
+ temp = ""
+ Enroll.providerType = j
+ temp = Enroll.enumProviders(i,0)
+ If Len(temp) = 0 Then
+ If j < 1 Then
+ j = j + 1
+ i = 0
+ Else
+ Exit Do
+ End If
+ Else
+ set el = document.createElement("OPTION")
+ el.text = temp
+ el.value = j
+ If temp = "Microsoft Base Cryptographic Provider v1.0" Then
+ first = j
+ End If
+ TheForm.cryptprovider.add(el)
+ If first = 0 Then
+ first = 1
+ TheForm.cryptprovider.selectedIndex = 0
+ Else
+ TheForm.cryptprovider.selectedIndex = first
+ End If
+ i = i + 1
+ End If
+ Loop
+End Function
+
+-->
+</SCRIPT>
+The administrator is a privileged user who manages this subsystem. Please enter the following relevant information, and a certificate request will be automatically generated and submitted. An administrator's entry will be created in the internal database and an administrator's certificate will be imported into this browser automatically in the next panel.
+<br/>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+<br/>
+ <br/>
+
+ <table class="details">
+ <tr>
+ <th>UID:</th>
+#if ($clone != 'clone')
+ <td><input type=text name=uid value="$admin_uid"></td>
+#else
+ <td><input type=text name=uid value="$admin_uid" disabled="disabled"></td>
+#end
+ </tr>
+ <tr>
+ <th>Name:</th>
+#if ($clone != 'clone')
+ <td><input size=35 type=text name=name value="$admin_name"></td>
+#else
+ <td><input size=35 type=text name=name value="$admin_name" disabled="disabled"></td>
+#end
+ </tr>
+ <tr>
+ <th>Email:</th>
+#if ($clone != 'clone')
+ <td><input size=35 type=text name=email value="$admin_email"></td>
+#else
+ <td><input size=35 type=text name=email value="$admin_email" disabled="disabled"></td>
+#end
+ </tr>
+ <tr>
+ <th>Password:</th>
+#if ($clone != 'clone')
+ <td><input type="password" size="40" name="__pwd" value="$admin_pwd" autocomplete="off"/></td>
+#else
+ <td><input type="password" size="40" name="__pwd" value="$admin_pwd" disabled="disabled" autocomplete="off"/></td>
+#end
+ </tr>
+ <tr>
+ <th>Password (Again):</th>
+
+#if ($clone != 'clone')
+ <td><input type="password" size="40" name="__admin_password_again" value="$admin_pwd_again" autocomplete="off"/></td>
+#else
+ <td><input type="password" size="40" name="__admin_password_again" value="$admin_pwd_again" disabled="disabled" autocomplete="off"/></td>
+#end
+<input type="hidden" name="cert_request" value=""/>
+<input type="hidden" name="display" value=$displayStr />
+<input type="hidden" name="profileId" value="caAdminCert" />
+<input type="hidden" name="cert_request_type" value="crmf" />
+<input type="hidden" name="import" value=$import />
+<input type="hidden" name="uid" value="admin" />
+<input type="hidden" name="clone" value=$clone />
+<input type="hidden" name="securitydomain" value="$securityDomain" />
+<input type="hidden" name="subject" value="cn=x" />
+ </tr>
+ </table>
+ <div align="right">
+ <hr />
+ </div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/agentauthenticatepanel.vm b/base/ra/apache/docroot/ra/admin/console/config/agentauthenticatepanel.vm
new file mode 100644
index 000000000..abb7678ae
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/agentauthenticatepanel.vm
@@ -0,0 +1,48 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+<h2>Authentication</h2>
+<br/>
+The uid and password are used to authenticate to the CA from which this subsystem's certificates are issued. Enter the uid and password of the Certificate Manager Agent who will approve the certificate requests.
+<br/>
+#if ($errorString != "")
+<img alt="" src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+ <table class="details">
+ <tr>
+ <th>Uid:</th>
+
+ <td><input type="text" size="40" name="uid" value="$uid"/></td>
+ </tr>
+ <tr>
+ <th>Password:</th>
+
+ <td><input type="password" size="40" name="__password" value="$password" autocomplete="off"/></td>
+ </tr>
+ </table>
+<br/>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/authdbpanel.vm b/base/ra/apache/docroot/ra/admin/console/config/authdbpanel.vm
new file mode 100644
index 000000000..f2e0697e7
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/authdbpanel.vm
@@ -0,0 +1,66 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT LANGUAGE="JavaScript">
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+ Please provide information about the LDAP server that will be used to authenticate the identity of end users. <a href="javascript: toggle_details();">[Details]</a>
+<script>
+function toggle_details() {
+ d = document.getElementById('details'); if (d.style.display == "block") {
+ d.style.display="none"; } else {
+ d.style.display="block";
+ } } </script>
+<div id=details style="display: none;"> <p>
+ In order for ESC to submit certificate requests to TPS, the end user's identity must first be verified. To accomplish this, an end user first sends a uid and password to TPS. TPS must then contact an LDAP server (e.g. - a corporate LDAP directory server) to verify this end user's identity.
+<p>
+If the end user's identity is successfully verified, TPS will establish an authenticated connection with this ESC, and begin accepting certificate requests and issuing certificates to this end user.
+<p>
+If, however, the end user's identity fails to be verified, TPS will not establish a connection with this ESC. TPS never issues certificates to unauthenticated end users.
+</div>
+<p>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+<p>
+
+ <table class="details">
+ <tr>
+ <th>Host:</th>
+ <td><input type="text" length="128" size="40" name="host" value="$hostname" /></td>
+ </tr>
+
+ <tr>
+ <th>Port:</th>
+
+ <td><input type="text" length="64" size="40" name="port" value="$portStr" /></td>
+ </tr>
+ <tr>
+ <th>Base DN:</th>
+ <td><input type="text" length="128" size="40" name="basedn" value="$basedn" /></td>
+ </tr>
+ </table>
+
+ <div align="right">
+ <hr />
+ &nbsp;
+ </div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/cainfopanel.vm b/base/ra/apache/docroot/ra/admin/console/config/cainfopanel.vm
new file mode 100644
index 000000000..933861a93
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/cainfopanel.vm
@@ -0,0 +1,55 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT LANGUAGE="JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+
+</SCRIPT>
+A Certificate Authority (CA) is responsible for issuing different kinds of certificates. Select an HTTPS EE URL of a CA from the list below.
+<p>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+<p>
+ <table class="details">
+ <tr>
+ <th>URL:</th>
+ <td><select name="urls">
+ #if ($urls_size != 0)
+ #set ($x=0)
+ #foreach ($p in $urls)
+ <option value="$x">$p</option>
+ #set ($x=$x+1)
+ #end
+ #end
+ </select>
+ </td>
+ </tr>
+ </table>
+
+
+ <div align="right">
+ <hr />
+ </div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/certchainpanel.vm b/base/ra/apache/docroot/ra/admin/console/config/certchainpanel.vm
new file mode 100644
index 000000000..08bcc1331
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/certchainpanel.vm
@@ -0,0 +1,49 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+<b>Pretty Print of Certificates on this subsystem.
+<p>
+#foreach ($item in $ppcerts)
+<H2>$item.getDN()</H2>
+<table width=100%>
+<tr bgcolor="#cccccc">
+ <td width=20%><b>Certificate: $item.getNickname()</b></td>
+</tr>
+
+<tr>
+ <td><textarea rows=24 cols=80 wrap="virtual" name=$item.getCertTag()>$item.getCertpp()</textarea></td>
+</tr>
+</table>
+#end
+
+ <br/>
+
+ <div align="right">
+ <hr />
+ &nbsp;
+ </div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/certprettyprintpanel.vm b/base/ra/apache/docroot/ra/admin/console/config/certprettyprintpanel.vm
new file mode 100644
index 000000000..ac8da10ee
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/certprettyprintpanel.vm
@@ -0,0 +1,49 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+The following certificates were installed on this instance.
+<p>
+#foreach ($item in $ppcerts)
+<H2>$item.getDN()</H2>
+<table width=100%>
+<tr bgcolor="#cccccc">
+ <td width=20%><b>Certificate: $item.getNickname()</b></td>
+</tr>
+
+<tr>
+ <td><textarea rows=24 cols=80 wrap="virtual" name=$item.getCertTag()>$item.getCertpp()</textarea></td>
+</tr>
+</table>
+#end
+
+ <br/>
+
+ <div align="right">
+ <hr />
+ &nbsp;
+ </div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/certrequestpanel.vm b/base/ra/apache/docroot/ra/admin/console/config/certrequestpanel.vm
new file mode 100644
index 000000000..f1327db47
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/certrequestpanel.vm
@@ -0,0 +1,225 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<style type="text/css">
+
+.floating {
+ position: absolute;
+ left: 250px;
+ top: 50px;
+ width: 600px;
+ padding: 3px;
+ border: solid;
+ border-width: 5px;
+ background: white;
+ display: none;
+ margin: 5px;
+}
+</style>
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+
+function showcert(element, event)
+{
+ var x = event.clientX;
+ var y = event.clientY;
+
+ var content = element.getAttribute("content");
+ var content_d = element.getAttribute("content_desc");
+
+ if (content == null) { return false; }
+
+ var n = element.getAttribute("n");
+
+ var editableType = element.getAttribute("editableType");
+ var desc;
+ var d;
+ var c;
+ if (editableType == "cert")
+ {
+ d = document.getElementById(n+"_editCertDiv");
+ c = document.getElementById(n+"_text");
+ desc = document.getElementById(n+"_desc_t");
+ } else if (editableType == "certchain") {
+ d = document.getElementById(n+"_editCertChainDiv");
+ c = document.getElementById(n+"_cc_text");
+ desc = document.getElementById(n+"_cc_desc_t");
+ } else {
+ d = document.getElementById(n+"_showCertDiv");
+ c = document.getElementById(n+"_pre");
+ desc = document.getElementById(n+"_desc_p");
+ }
+
+ if (desc.hasChildNodes())
+ {
+ desc.removeChild(desc.childNodes[0]);
+ }
+ var content_desc = document.createTextNode(content_d);
+ desc.appendChild(content_desc);
+
+ if (c.hasChildNodes())
+ {
+ c.removeChild(c.childNodes[0]);
+ }
+ var content_text = document.createTextNode(content);
+ c.appendChild(content_text);
+
+ d.style.left = x+30; // x-offset of floating div
+ assumedheight = 1000;
+
+ var offset = 20; // extra y-offset of floating div
+ var bottom = y + offset + assumedheight;
+ if (bottom > window.innerHeight) {
+ offset = 0 - (2*offset) - assumedheight;
+ }
+
+ d.style.top = y+ offset +document.body.scrollTop;
+
+ // unhide the window
+ d.style.display ="block";
+
+}
+
+function hide(tag)
+{
+ document.getElementById(tag+"_showCertDiv").style.display ="none";
+ document.getElementById(tag+"_editCertDiv").style.display ="none";
+ document.getElementById(tag+"_editCertChainDiv").style.display ="none";
+}
+
+</SCRIPT>
+A certificate signing request (CSR) contains a public key and is an unsigned copy of the certificate.
+<p>
+If a given CSR has been successfully signed by a CA, then the certificate will be designated below by a certificate icon labeled Certificate Generated Successfully.
+<p>
+However, if a given CSR contains an <font color="red">action required</font> label under its certificate icon, then those requests must be <i>manually</i> submitted to a CA for certificate generation.
+<p>
+Press the [Apply] button after certificates and chains are pasted in.
+<p>
+Press the [Next] button once all certificates have been generated successfully.
+<p>
+#foreach ($item in $reqscerts)
+<H2>$item.getDN()</H2>
+<table width=100%>
+<tr>
+ <td width=10%></td>
+ <td width=20%></td>
+ <td width=70%></td>
+</tr>
+
+<tr>
+ <td>&nbsp;</td>
+#if ($item.getCert() == "...paste certificate here...")
+ <td><font color=red>action required</font><br>
+<img src="/pki/images/no-certificate.png"/></td>
+#else
+ #if ($item.getCert() == "...certificate be generated internally...")
+<td>
+ <img src="/pki/images/no-certificate.png"/><br>
+ certificate will be generated internally
+ </td>
+ #else
+ #if ($item.getCert() == "")
+ <td>
+<img src="/pki/images/no-certificate.png"/><br>
+ No Certificate Generated. Please import.<br>
+ </td>
+ #else
+ <td>
+<img src="/pki/images/certificate.png"/><br>
+ Certificate Generated Successfully
+ </td>
+ #end
+ #end
+#end
+
+<td>
+
+
+#if ($item.getCert() == "...paste certificate here...")
+<a content="$item.getRequest()" content_desc="Copy the following Certificate Request (CSR) and paste it in the external CA enrollment page for enrollment" n="$item.getCertTag()" href="#" onclick="showcert(this,event);"> Step 1: Copy the Certificate Request (CSR) to enroll at an external CA</a><p>
+<a content="" content_desc="Copy the base64-encoded PKCS #7 certificate chain into the text box below and press 'X'" n="$item.getCertTag()" editableType="certchain" href="#" onclick="showcert(this,event);"> Step 2: Import the PKCS #7 Certificate Chain (optional if the certificate already contains the chain)</a><p>
+<a content="$item.getCert()" content_desc="Copy the resulting base64-encoded certificate (NOTE: PKCS #7 not accepted) into the text box below and press 'X'" n="$item.getCertTag()" editableType="cert" href="#" onclick="showcert(this,event);"> Step 3: Paste in the Base64-encoded Certificate after enrollment at an external CA (NOTE: this text box does not accept PKCS #7 certificate chains)</a><p>
+#else
+ #if ($item.getCert() == "...certificate be generated internally...")
+<p>
+ #else
+<a content="$item.getRequest()" content_desc="Certificate Request (CSR)" n="$item.getCertTag()" href="#" onclick="showcert(this,event);"> View Certificate Request (CSR)</a><p>
+<a content="$item.getCert()" content_desc="Certificate in Base64 encoding" n="$item.getCertTag()" href="#" onclick="showcert(this,event);"> View Certificate in Base64-Encoding</a><p>
+<a content="$item.getCertpp()" content_desc="Certificate in pretty print" n="$item.getCertTag()" href="#" onclick="showcert(this,event);"> View Certificate Pretty Print</a><p>
+ #end
+#end
+
+
+</td>
+</tr>
+</table>
+
+<div id="$item.getCertTag()_showCertDiv" class="floating">
+<div align="right" onclick="hide('$item.getCertTag()');">X</div>
+<table id="$item.getCertTag()_stable" width="100%">
+<tr>
+<td id="$item.getCertTag()_desc_p"></td>
+</tr>
+<tr>
+<td><pre name="$item.getCertTag()" id="$item.getCertTag()_pre">$item.getCert()</pre></td>
+</tr>
+</table>
+</div>
+
+<div id="$item.getCertTag()_editCertDiv" class="floating">
+<div align="right" onclick="hide('$item.getCertTag()');">X</div>
+<table id="$item.getCertTag()_etable" width="100%">
+<tr>
+<td id="$item.getCertTag()_desc_t"></td>
+</tr>
+<tr>
+<td><textarea rows=30 cols=90 name="$item.getCertTag()" id="$item.getCertTag()_text" style="font-family: monospace;">$item.getCert()</textarea></td>
+</tr>
+</table>
+</div>
+
+<div id="$item.getCertTag()_editCertChainDiv" class="floating">
+<div align="right" onclick="hide('$item.getCertTag()');">X</div>
+<table id="$item.getCertTag()_cc_etable" width="100%">
+<tr>
+<td id="$item.getCertTag()_cc_desc_t"></td>
+</tr>
+<tr>
+<td><textarea rows=30 cols=90 name="$item.getCertTag()_cc" id="$item.getCertTag()_cc_text" style="font-family: monospace;"></textarea></td>
+</tr>
+</table>
+</div>
+
+
+#end
+
+ <p>
+
+
+ <div align="right">
+ <hr />
+ &nbsp;
+ </div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/config_addhsm.vm b/base/ra/apache/docroot/ra/admin/console/config/config_addhsm.vm
new file mode 100644
index 000000000..839cff56a
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/config_addhsm.vm
@@ -0,0 +1,96 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+
+ <title>Dogtag Certificate System</title>
+<SCRIPT LANGUAGE="JavaScript">
+ function checkClose() {
+ if ('$status' == "update" && '$error' == '') {
+ window.close();
+ }
+ }
+
+</SCRIPT>
+
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ </head>
+
+
+ <body onLoad="checkClose();"><div id="wrap"><div id="wrap">
+
+<div id="mainNavOuter">
+<div id="mainNav">
+
+<div id="mainNavInner">
+
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<!-- close bar -->
+
+ <div id="content">
+ <table width="100%" cellspacing="0">
+ <tr>
+ <td class="page-content" width="100%">
+ <h1><img src="/pki/images/icon-software.gif" />
+ Security Modules</h1>
+Keys will be generated and stored on security modules. A security module can be hardware-based or software-based. Hardware-based security modules are more secure.
+<p>
+<H2>Registering a New Security Module</H2>
+<form name=configForm action="config_addhsm" method="post">
+<p>
+If the desired security module is not listed, it is possible that this security module's PKCS #11 library was not registered with the system. Please register a new security module here.
+<table>
+<tr>
+ <td>
+Library Path: <input type=text name="modulePath" value="">
+ </td>
+</tr>
+<tr>
+ <td>
+Module Name: <input type=text name="moduleName" value="">
+ </td>
+<tr>
+</tr>
+</table>
+<p>
+<table width=100%>
+<tr bgcolor="#eeeeee">
+ <td>
+<input onclick="configForm.submit()" type=button name=config_addhsm_next value="Apply">
+ </td>
+</tr>
+</table>
+</form>
+ </td>
+ </tr>
+ </table>
+
+ </div> <!-- close content -->
+ </div> <!-- close wrap -->
+
+ </body>
+</html>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/config_db.vm b/base/ra/apache/docroot/ra/admin/console/config/config_db.vm
new file mode 100644
index 000000000..10e1cd2dc
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/config_db.vm
@@ -0,0 +1,126 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+
+ <title>Dogtag Certificate System</title>
+
+<SCRIPT LANGUAGE="JavaScript">
+ function donePanel(errorStr, displayS) {
+ if (displayS == "loaded") {
+ if (errorStr == '') {
+ window.close();
+ }
+ }
+ }
+</SCRIPT>
+
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ </head>
+
+
+ <body onLoad="donePanel('$errorString', '$displayStr')">
+<div id="wrap">
+#include ( "admin/console/config/header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+<!-- close bar -->
+
+ <div id="content">
+ <table width="100%" cellspacing="0">
+ <tr>
+ <td width="100%">
+ <h1><img src="/pki/images/icon-software.gif" />
+ Internal Database </h1>
+
+ <form name=configForm action="config_db" method="post">
+ <b>Internal Database Connection</b> <p>This option allows sharing an internal database to improve managability.<p>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+ <table class="details">
+ <tr>
+ <th>Host:</th>
+
+ <td><input type="text" length="128" size="40" name="host" value="$hostname" /></td>
+ </tr>
+
+ <tr>
+ <th>Port:</th>
+
+ <td><input type="text" length="64" size="40" name="port" value="$portStr" /></td>
+ </tr>
+ <tr>
+ <th>Base DN:</th>
+ <td><input type="text" length="128" size="40" name="basedn" value="$basedn" /></td>
+ </tr>
+ <tr>
+ <th>Database:</th>
+
+ <td><input type="text" length="128" size="40" name="database" value="$database" /></td>
+ </tr>
+ <tr>
+ <th>Bind DN:</th>
+ <td><input type="text" length="128" size="40" name="binddn" value="$binddn" /></td>
+ </tr>
+ <tr>
+ <th>Bind Password:</th>
+
+ <td><input type="password" length="128" size="40" name="__bindpwd" value="$bindpwd" autocomplete="off" /></td>
+ </tr>
+ <td><input type="hidden" name="display" value=$displayStr /></td>
+ </table>
+
+ <div align="right">
+ <hr />
+ &nbsp;
+ </div>
+
+
+<p>
+<table width=100%>
+<tr bgcolor="#eeeeee">
+ <td>
+<input onclick="configForm.submit()" type="button" name="config_db_next" value="Apply">
+ </td>
+</tr>
+</table>
+
+ </form>
+
+ </td>
+ </tr>
+ </table>
+
+ </div> <!-- close content -->
+ </div> <!-- close wrap -->
+
+ </body>
+</html>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/config_hsm.vm b/base/ra/apache/docroot/ra/admin/console/config/config_hsm.vm
new file mode 100644
index 000000000..8812c5b36
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/config_hsm.vm
@@ -0,0 +1,176 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+
+ <title>Dogtag Certificate System</title>
+<SCRIPT LANGUAGE="JavaScript">
+ function checkClose() {
+ if ('$status' == "update" && '$error' == '') {
+ window.close();
+ }
+ }
+
+</SCRIPT>
+
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ </head>
+
+
+ <body onLoad="checkClose();"><div id="wrap">
+
+<div id="mainNavOuter">
+<div id="mainNav">
+
+<div id="mainNavInner">
+
+#include ( "admin/console/config/topmenu.vm" )
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<!-- close bar -->
+
+ <div id="content">
+ <table width="100%" cellspacing="0">
+ <tr>
+ <td width="100%">
+ <h1><img src="/pki/images/icon-software.gif" />
+ Security Modules </h1>
+
+<form name=configForm action="config_hsm" method="post">
+
+Keys will be generated and stored on security modules. A security module can be hardware-based or software-based. Hardware-based security modules are more secure. Please make sure that at least one security module is listed below.
+<p>
+<H2>Supported Security Modules</H2>
+<table width=100%>
+<tr bgcolor="#cccccc">
+ <td width=20%><b>Module/Token</b></td>
+ <td width=10%><b>Status</b></td>
+ <td width=10%><b>Default</b></td>
+ <td width=10%><b>Operations</b></td>
+</tr>
+#foreach ($module in $sms)
+<tr bgcolor="#eeeeee">
+ <td><img src=$module.getImagePath()><br>$module.getUserFriendlyName()</td>
+ <td>
+ #if ($module.isFound())
+ Found
+ #else
+ Not Found
+ #end
+ </td>
+ <td></td>
+ <td></td>
+</tr>
+#foreach ($token in $module.getTokens())
+<tr>
+ <td>- $token.getNickName()</td>
+ <td>
+ #if ($token.isLoggedIn())
+ Logged In
+ #else
+ Not logged In
+ #end
+ </td>
+ <td>
+ #if ($defTok == $token.getNickName())
+ <input checked type=radio name="choice" value="$token.getNickName()">
+ #else
+ <input type=radio name="choice" value="$token.getNickName()">
+ #end
+ </td>
+ <td></td>
+</tr>
+#end
+#end
+
+</table>
+<H2>Other Security Modules</H2>
+<h3>The security modules listed below are modules found by the server but not recognized as one of the supported modules. If the user believes that any listed modules below should have been supported, please check the "CS.cfg" configuration file to see if there is a name mismatch and adjust this accordingly.</h3>
+<table width=100%>
+<tr bgcolor="#cccccc">
+ <td width=20%><b>Module/Token</b></td>
+ <td width=10%><b>Status</b></td>
+ <td width=10%><b>Default</b></td>
+ <td width=10%><b>Operations</b></td>
+</tr>
+#foreach ($module in $oms)
+<tr bgcolor="#eeeeee">
+ <td>$module.getUserFriendlyName()</td>
+ <td>
+ #if ($module.isFound())
+ Found
+ #else
+ Not Found
+ #end
+ </td>
+ <td></td>
+ <td></td>
+</tr>
+#foreach ($token in $module.getTokens())
+<tr>
+ <td>- $token.getNickName()</td>
+ <td>
+ #if ($token.isLoggedIn())
+ Logged In
+ #else
+ Not logged In
+ #end
+ </td>
+ <td>
+ #if ($defTok == $token.getNickName())
+ <input checked type=radio name="choice" value="$token.getNickName()">
+ #else
+ <input type=radio name="choice" value="$token.getNickName()">
+ #end
+ </td>
+ <td></td>
+</tr>
+#end
+#end
+
+</table>
+
+ </td>
+</tr>
+</table>
+<p>
+<table width=100%>
+<tr bgcolor="#eeeeee">
+ <td>
+<input onclick="configForm.submit()" type=button name=config_hsm value="Apply">
+ </td>
+</tr>
+</table>
+</form>
+ </td>
+ </tr>
+ </table>
+
+ </div> <!-- close content -->
+ </div> <!-- close wrap -->
+
+ </body>
+</html>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/config_hsmloginpanel.vm b/base/ra/apache/docroot/ra/admin/console/config/config_hsmloginpanel.vm
new file mode 100644
index 000000000..46d8ae0ea
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/config_hsmloginpanel.vm
@@ -0,0 +1,83 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT LANGUAGE="JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+ <h1>
+ Security Modules Login Panel</h1>
+Keys will be generated and stored on security modules. A security module can be hardware-based or software-based. Hardware-based security modules are more secure.
+<p>
+<H2>Security Token Login</H2>
+<form name=configHSMLoginForm action="config_hsmlogin" method="post">
+<p>
+The user has chosen to login to the following security module: <b>$SecToken</b>
+<p>
+#if ($status == "alreadyLoggedIn")
+ Token already logged in.
+#else
+ #if ($status == "tokenPasswordNotInitialized")
+ Token password not initialized.
+ #else
+ #if ($status == "justLoggedIn")
+ Token logged in successfully.
+ #else
+<table>
+<tr>
+ <td>
+Security Module Token Name: <b><input type=text name="uTokName" value="$SecToken"></b>
+ </td>
+</tr>
+<tr>
+ <td>
+Security Module Token Password: <input type=password name="__uPasswd" value="" autocomplete="off">
+ </td>
+<tr>
+</tr>
+</table>
+<p>
+ #end
+ #end
+#end
+
+<table width=100%>
+<tr bgcolor="#eeeeee">
+ <td>
+
+ </td>
+</tr>
+</table>
+ </td>
+ </tr>
+ </table>
+
+ <p>
+
+ <div align="right">
+ <hr />
+ &nbsp;
+ </div>
+
+
diff --git a/base/ra/apache/docroot/ra/admin/console/config/config_join.vm b/base/ra/apache/docroot/ra/admin/console/config/config_join.vm
new file mode 100644
index 000000000..d5adb78f3
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/config_join.vm
@@ -0,0 +1,125 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+
+ <title>Dogtag Certificate System</title>
+
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ </head>
+
+<SCRIPT LANGUAGE="JavaScript">
+ function checkClose() {
+ if ('$status' == "update" && '$error' == '') {
+ window.close();
+ }
+ }
+</SCRIPT>
+
+
+ <body onLoad="checkClose();">
+<div id="wrap">
+
+#include ( "admin/console/config/header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+<!-- close bar -->
+
+ <div id="content">
+ <table width="100%" cellspacing="0">
+ <tr>
+ <td width="100%">
+ <h1><img src="/pki/images/icon-software.gif" />
+ Join the PKI Network </h1>
+
+To join this PKI network, the setup wizard needs to submit the certificate request to a Root or another subordinate CA for signing.
+ <p>
+ <form action="config_join" method="post" name="f">
+
+<input type=radio $check_manual name="choice" value="manual">Manually submit this request to a CA.
+<p>
+<table width=100%>
+<tr>
+ <td width=50%>Certificate Request to a CA:</td>
+ <td>Certificate Chain From a CA:</td>
+ </td>
+</tr>
+<tr>
+ <td>
+<textarea rows=8 cols=40 name="req">$certreq</textarea>
+ </td>
+ <td>
+<textarea rows=8 cols=40 name="cert">$cert</textarea>
+ </td>
+</tr>
+</table>
+<p>
+<input type=radio $check_auto name="choice" value="auto">Automatically submit the request to a Dogtag Certificate Authority
+<br>
+ <table class="details">
+ <tr>
+ <th width=10%>URL:</th>
+ <td><input type="text" length="128" size="40" name="url" value="https://localhost" /></td>
+ </tr>
+
+ <tr>
+ <th>UID:</th>
+ <td><input type="text" length="64" size="40" name="uid" value="agent" /></td>
+ </tr>
+ <tr>
+ <th>Password:</th>
+ <td><input type="password" length="64" size="40" name="__pwd" value="" autocomplete="off" /></td>
+ </tr>
+ </table>
+<p>
+
+ <div align="right">
+ <hr />
+ </div>
+
+ </form>
+
+<p>
+<table width=100%>
+<tr bgcolor="#eeeeee">
+ <td>
+<input onclick="javascript: document.f.submit();" type=button name=next value="Apply">
+ </td>
+</tr>
+</table>
+ </td>
+ </tr>
+ </table>
+
+ </div> <!-- close content -->
+ </div> <!-- close wrap -->
+
+ </body>
+</html>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/config_rootca.vm b/base/ra/apache/docroot/ra/admin/console/config/config_rootca.vm
new file mode 100644
index 000000000..4cf5ea946
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/config_rootca.vm
@@ -0,0 +1,113 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+
+ <title>Dogtag Certificate System</title>
+
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ </head>
+
+<SCRIPT LANGUAGE="JavaScript">
+ function checkClose() {
+ if ('$status' == "update" && '$error' == '') {
+ window.close();
+ }
+ }
+</SCRIPT>
+
+
+ <body onLoad="checkClose();">
+<div id="wrap">
+
+#include ( "admin/console/config/header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+<!-- close bar -->
+
+ <div id="content">
+ <table width="100%" cellspacing="0">
+ <tr>
+ <td width="100%">
+ <h1><img src="/pki/images/icon-software.gif" />
+ Root CA </h1>
+
+A Root CA provides a set of predefined signing capabilities. Please select the capabilities that this CA needs to provide.
+ <p>
+
+<form name="f" action="config_rootca" method="post">
+
+<H2>CA Certificate Profile</H2>
+
+<p>
+ <table class="details">
+ <tr>
+ <th width=10%>Profile:</th>
+
+ <td><select name="profile">
+#foreach ($p in $profiles)
+#if ($p.getID() == $selected_profile_id)
+ <option selected value="$p.getID()">$p.getName()</option>
+#else
+ <option value="$p.getID()">$p.getName()</option>
+#end
+#end
+ </select>
+ </td>
+ </tr>
+ </table>
+<p>
+
+ <div align="right">
+ <hr />
+ &nbsp;
+ </div>
+
+ </form>
+
+<p>
+<table width=100%>
+<tr bgcolor="#eeeeee">
+ <td>
+<input onclick="javascript: document.f.submit()" type=button name=next value="Apply">
+ </td>
+</tr>
+</table>
+
+
+ </td>
+ </tr>
+ </table>
+
+ </div> <!-- close content -->
+ </div> <!-- close wrap -->
+
+ </body>
+</html>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/createsubsystempanel.vm b/base/ra/apache/docroot/ra/admin/console/config/createsubsystempanel.vm
new file mode 100644
index 000000000..feee8962f
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/createsubsystempanel.vm
@@ -0,0 +1,95 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+<h2>Subsystem Configuration</h2>
+<p>
+This instance can be configured as a new $systemname subsystem.
+<br/>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+<br/>
+<b><input $check_newsubsystem type=radio name=choice value="newsubsystem">&nbsp;Configure this Instance as a New $systemname Subsystem </b>
+<br/>
+ <table class="details">
+ <tr>
+ <th>Subsystem Name: </th>
+ <td><input type=text size="40" name="subsystemName" value="$subsystemName"> (e.g. - $fullsystemname)</td>
+ </tr>
+ <tr>
+ <th>Subsystem HTTP URL (unsecure): </th>
+ <td>http://$machineName:$http_port</td>
+ </tr>
+ <tr>
+ <th>Subsystem HTTPS URL (clientauth): </th>
+ <td>https://$machineName:$https_port</td>
+ </tr>
+ <tr>
+ <th>Subsystem HTTPS URL (non-clientauth): </th>
+ <td>https://$machineName:$non_clientauth_https_port</td>
+ </tr>
+ </table>
+<p>
+#if ($disableClone)
+<b><input $check_clonesubsystem type=radio name=choice value="clonesubsystem" disabled="disabled">&nbsp;Clone an Existing $systemname Subsystem </b>
+#else
+<b><input $check_clonesubsystem type=radio name=choice value="clonesubsystem">&nbsp;Clone an Existing $systemname Subsystem </b>
+#end
+<br/>
+ <table class="details">
+ <tr>
+ <th>Subsystem Name: </th>
+#if ($disableClone)
+ <td><input disabled="disabled" type=text size="40" name="subsystemName" value="$subsystemName"> (e.g. - $fullsystemname
+ Clone 1)</td>
+#else
+ <td><input type=text size="40" name="subsystemName" value="$subsystemName"> (e.g. - $fullsystemname
+ Clone 1)</td>
+#end
+ </tr>
+ <tr>
+ <th>Subsystem URL: </th>
+#if ($disableClone)
+ <td><select name="urls" disabled="disabled">
+#else
+ <td><select name="urls">
+#end
+ #if ($urls_size != 0)
+ #set ($x=0)
+ #foreach ($p in $urls)
+ <option value="$x">$p</option>
+ #set ($x=$x+1)
+ #end
+ #else
+ <option selected value="none">NONE</option>
+ #end
+ </select>
+ </td>
+ </tr>
+ </table>
+<br/>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/databasepanel.vm b/base/ra/apache/docroot/ra/admin/console/config/databasepanel.vm
new file mode 100644
index 000000000..a887176ab
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/databasepanel.vm
@@ -0,0 +1,53 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+An SQL Lite database will be created to store RA internal information.
+<SCRIPT type="text/JavaScript">
+function toggle_details()
+{
+ d = document.getElementById('details');
+ if (d.style.display == "block") {
+ d.style.display="none";
+ } else {
+ d.style.display="block";
+ }
+}
+</script>
+<div id=details style="display: none;">
+<p>
+</div>
+<p>
+<br/>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+<br/>
+ <div align="right">
+ <hr />
+ &nbsp;
+ </div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/displaycertchain2panel.vm b/base/ra/apache/docroot/ra/admin/console/config/displaycertchain2panel.vm
new file mode 100644
index 000000000..eff21eca4
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/displaycertchain2panel.vm
@@ -0,0 +1,41 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT LANGUAGE="JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+<p>
+A certificate chain is a list of all certificates chained up to the root.
+<p>
+If the entire certificate chain is displayed below, click the Next button to import it into this subsystem. This certificate chain will then be trusted for this instance.
+<p>
+If no certificate chain is listed below, simply click the Next button to move on to the next panel.
+<p>
+<pre>
+$certchain
+</pre>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
diff --git a/base/ra/apache/docroot/ra/admin/console/config/displaycertchainpanel.vm b/base/ra/apache/docroot/ra/admin/console/config/displaycertchainpanel.vm
new file mode 100644
index 000000000..d5e32263a
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/displaycertchainpanel.vm
@@ -0,0 +1,41 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+<br/>
+A certificate chain is a list of all certificates chained up to the root.
+<br/>
+If a certificate chain is displayed below, click the Next button to trust this certificate chain for this instance.
+<br/>
+If no certificate chain is listed below, simply click the Next button to move on to the next panel.
+<br/>
+<pre>
+$certchain
+</pre>
+#if ($errorString != "")
+<img alt="" src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
diff --git a/base/ra/apache/docroot/ra/admin/console/config/donepanel.vm b/base/ra/apache/docroot/ra/admin/console/config/donepanel.vm
new file mode 100644
index 000000000..86e4068ea
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/donepanel.vm
@@ -0,0 +1,42 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+<input type="hidden" name="host" value=$host />
+<input type="hidden" name="port" value=$port />
+<input type="hidden" name="systemType" value=$systemType />
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+As 'root', restart the server on the command line by typing "$initCommand
+ restart $instanceID". After performing this restart, the server should become operational.
+<br/>
+Please go to the <A href="https://$host:$non_clientauth_port"><b>services page</b></A> to access all of the available interfaces.
+<br/>
+<br/>
+To create additional instances, type "/usr/bin/pkicreate" on the command line.
+<br/>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/drminfopanel.vm b/base/ra/apache/docroot/ra/admin/console/config/drminfopanel.vm
new file mode 100644
index 000000000..c26f3c0c2
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/drminfopanel.vm
@@ -0,0 +1,56 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT LANGUAGE="JavaScript">
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+
+</SCRIPT>
+A Data Recovery Manager (DRM) is responsible for server-side key generation, archival, and recovery. If server-side key generation is not needed, this step can be skipped.
+<p>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+<p>
+#end
+<b><input checked type=radio name=choice value="keygen">&nbsp;Connect this instance to an HTTPS Agent URL of a DRM to support server-side key generation.</b>
+<p>
+<p>
+ <table class="details">
+ <tr>
+ <th>URL:</th>
+ <td><select name="urls">
+ #if ($urls_size != 0)
+ #set ($x=0)
+ #foreach ($p in $urls)
+ <option value="$x">$p</option>
+ #set ($x=$x+1)
+ #end
+ #end
+ </select>
+ </td>
+ </tr>
+ </table>
+ <div align="right">
+ <hr />
+ </div>
+<p>
+<b><input type=radio name=choice value="nokeygen">&nbsp;Configure this instance to NOT support server-side key generation.</b>
+<p>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/footer.vm b/base/ra/apache/docroot/ra/admin/console/config/footer.vm
new file mode 100644
index 000000000..22d7213ba
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/footer.vm
@@ -0,0 +1,20 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+ <div id="footer">
+ </div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/header.vm b/base/ra/apache/docroot/ra/admin/console/config/header.vm
new file mode 100644
index 000000000..e653da5c1
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/header.vm
@@ -0,0 +1,26 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<div id="header">
+ <a href="http://pki.fedoraproject.org" title="Visit pki.fedoraproject.org for more information about Dogtag products and services"><img src="/pki/images/logo_header.gif" alt="Dogtag" id="myLogo" /></a>
+ <div id="headerpaddedtitle">
+ <a href="/" title="Dogtag Network homepage">Dogtag<sup><font size="-2">&reg;</font></sup> Certificate System</a>
+ </div>
+ <div id="account">
+ </div>
+</div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/hierarchypanel.vm b/base/ra/apache/docroot/ra/admin/console/config/hierarchypanel.vm
new file mode 100644
index 000000000..41cba696d
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/hierarchypanel.vm
@@ -0,0 +1,80 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+ setURL();
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+<h2>PKI Hierarchy</h2>
+<p>
+This CA instance can be either a Self-Signed Root CA or a Subordinate CA. <a href="javascript:toggle_details();">[Details]</a>
+<script>
+function toggle_details()
+{
+ d = document.getElementById('details');
+ if (d.style.display == "block") {
+ d.style.display="none";
+ } else {
+ d.style.display="block";
+ }
+}
+
+function setURL() {
+ var cbox = document.forms[0].elements['urls'];
+ if (document.forms[0].choice[0].checked) {
+ cbox.disabled = "disabled";
+ } else {
+ cbox.disabled = "";
+ }
+}
+
+</script>
+
+<div id=details style="display: none;">
+<p>
+The PKI hierarchy establishes the trust relationships between this CA instance and the other PKI instances within this security domain. A CA can be chained under an internal CA, or alternatively, it can be chained under a public or an external CA.
+</div>
+
+<p>
+<b><input $check_root type=radio name=choice value="root" onChange="setURL();">&nbsp;Make this a Self-Signed Root CA within this new PKI hierarchy. <img alt="" src="/pki/images/rootca.gif"></b>
+<p>
+<b><input $check_join type=radio name=choice value="join" onChange="setURL();">&nbsp;Make this a subordinate CA of another CA. <img alt="" src="/pki/images/sub.gif"></b>
+
+ <table class="details">
+ <tr>
+ <th>URL:</th>
+ <td><select name="urls">
+ #if ($urls.size() > 0)
+ #set ($x=0)
+ #foreach ($p in $urls)
+ <option value="$x">$p</option>
+ #set ($x=$x+1)
+ #end
+ #end
+ </select>
+ </td>
+ </tr>
+ </table>
+<p>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/importadmincertpanel.vm b/base/ra/apache/docroot/ra/admin/console/config/importadmincertpanel.vm
new file mode 100644
index 000000000..37df00c02
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/importadmincertpanel.vm
@@ -0,0 +1,56 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT ID=ImportCertificate_OnClick LANGUAGE="JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+An administrator's certificate has been created and imported into this browser. This certificate is used to access the agent interface of this subsystem.
+<p>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+<font color="red">$info</font>
+<p>
+ <p>
+
+ <table class="details">
+ <tr>
+#if ($ca == 'true' && $import == 'true')
+<iframe scrolling=no frameborder=0 height=0 width=0 src="https://$caHost:$caPort/ca/admin/ca/getBySerial?serialNumber=$serialNumber&importCert=true"></iframe>
+#else
+#if ($caType == 'ca' && $import == 'true')
+<iframe scrolling=no frameborder=0 height=0 width=0 src="https://$caHost:$caPort/ca/admin/ca/getBySerial?serialNumber=$serialNumber&importCert=true"></iframe>
+#else
+<iframe scrolling=no frameborder=0 height=0 width=0 src="https://$caHost:$caPort/ca/admin/ca/getBySerial?serialNumber=$serialNumber&importCert=true"></iframe>
+#end
+#end
+<input type="hidden" name="serialNumber" value=$serialNumber />
+<input type="hidden" name="caHost" value=$caHost />
+<input type="hidden" name="caPort" value=$caPort />
+ </tr>
+ </table>
+ <div align="right">
+ <hr />
+ </div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/login.vm b/base/ra/apache/docroot/ra/admin/console/config/login.vm
new file mode 100644
index 000000000..14593ad9c
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/login.vm
@@ -0,0 +1,110 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+
+ <title>Certificate System</title>
+
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+ </head>
+
+
+ <body><div id="wrap">
+
+#include ( "ra/admin/console/config/header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+ -
+</div>
+
+
+</div>
+</div>
+
+</div>
+<!-- close bar -->
+
+ <div id="content">
+ <table width="100%" cellspacing="0">
+ <tr>
+ <td class="sidebar">
+
+ </td>
+ <td class="page-content" width="100%">
+ <h1><img src="/pki/images/icon-software.gif" />
+ Login</h1>
+
+A one time random pin has been generated during setup to protect unauthorized access to this configuration wizard. This pin has been stored in the "CS.cfg" configuration file as the value of the 'preop.pin' parameter. Please enter this pin to continue.
+
+ <p>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+ <p>
+ <form name="f" action="login" method="post">
+
+ <table class="details">
+ <tr>
+ <th>PIN:</th>
+ <td><input type=password name="pin"></td>
+ </tr>
+ </table>
+ <div align="right">
+ <hr />
+ </div>
+ </form>
+
+<p>
+<table width=100%>
+<tr bgcolor="#eeeeee">
+<td align=right>
+<input type=button onclick="javascript: document.f.submit();" name=login value="Login">
+</td>
+</tr>
+</table>
+
+
+ </td>
+ </tr>
+ </table>
+
+ </div> <!-- close content -->
+ </div> <!-- close wrap -->
+
+#include ( "ra/admin/console/config/footer.vm" )
+ </body>
+</html>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/modulepanel.vm b/base/ra/apache/docroot/ra/admin/console/config/modulepanel.vm
new file mode 100644
index 000000000..cb9a1eaf8
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/modulepanel.vm
@@ -0,0 +1,158 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+Two lists of security modules are provided below. The <b>Supported Security Modules</b> list consists of both software-based and hardware-based security modules that this PKI solution supports, while the <b>Other Security Modules</b> list consists of any other security modules found by this PKI subsystem that are not recognized as one of the supported security modules. <a href="javascript:toggle_details();">[Details]</a>
+<SCRIPT type="text/JavaScript">
+function toggle_details()
+{
+ d = document.getElementById('details');
+ if (d.style.display == "block") {
+ d.style.display="none";
+ } else {
+ d.style.display="block";
+ }
+}
+</script>
+<div id=details style="display: none;">
+<br/>
+Key pairs for this instance will be generated and stored on a device called a security module.
+<br/>
+A <b><i>key pair</i></b> consists of a public key and a private key. A <b><i>private key</i></b> is a secret entity which is never exposed to the public, will generally be protected via a security module, and is commonly referred to simply as the <b><i>key</i></b>. A <b><i>public key</i></b> is open, distributable, and while it may also be stored on a security module, it is not protected by this device. A public key, once signed by a CA, is more generally referred to as a <b><i>certificate</i></b>.
+<br/>
+<b><i>Security modules</i></b> can be either hardware-based or software-based. Although hardware-based security modules provide more security for the secret, or private portion of this key, they must be obtained from a third-party vendor and installed prior to deployment of this PKI solution. For this particular PKI implementation, a software-based FIPS 140-1 security module has been included.
+<br/>
+Before any security module solution can be used, a user must first always be authenticated to this security module via a token. To support this, each security module consists of one or more <b><i>slots</i></b>. For hardware-based security modules, a slot often consists of one or more physical contact points to the device itself (e.g. - a card reader or USB receptacle), while for software-based security modules, these may be thought of as merely a functional entry point into the software.
+<br/>
+Finally, a <b><i>token</i></b> (often generically referred to as a <b><i>smartcard</i></b>), which contains the actual key material, interfaces with the security module via a slot. For hardware-based security modules, this may be something like a physical card containing a chip, or a USB device that can be physically inserted into a USB slot. For software-based security modules, this can be thought of as an entry in a database. In the case of both hardware-based as well as software-based security modules, a password is the most commonly used method to complete this authentication.
+<br/>
+Since a security module may consist of slots for one or more tokens, the user must be successfully authenticated to each token of the chosen security module before this configuration can continue.
+</div>
+<br/>
+<H2>Supported Security Modules</H2>
+<table width=100%>
+<tr bgcolor="#cccccc">
+ <td width=20%><b>Module/Token</b></td>
+ <td width=10%><b>Status</b></td>
+ <td width=10%><b>Default</b></td>
+ <td width=10%><b>Operations</b></td>
+</tr>
+#foreach ($module in $sms)
+<tr bgcolor="#eeeeee">
+ <td><img alt="" src=$module.getImagePath()><br>$module.getUserFriendlyName()</td>
+ <td>
+ #if ($module.isFound())
+ Found
+ #else
+ Not Found
+ #end
+ </td>
+ <td></td>
+ <td></td>
+</tr>
+#foreach ($token in $module.getTokens())
+<tr>
+ <td>- $token.getNickName()</td>
+ <td>
+ #if ($token.isLoggedIn())
+ Logged In
+ #else
+ Not logged In
+ #end
+ </td>
+ <td>
+ #if ($token.isLoggedIn())
+ #if ($defTok == $token.getNickName())
+ <input checked type=radio name="choice" value="$token.getNickName()">
+ #else
+ <input type=radio name="choice" value="$token.getNickName()">
+ #end
+ #end
+ </td>
+ <td>
+ #if (!$token.isLoggedIn())
+<a href="wizard?p=$subpanelno&amp;SecToken=$token.getNickName()">Login</a>
+ #end
+</td>
+</tr>
+#end
+#end
+
+</table>
+<H2>Other Security Modules</H2>
+<h3>The security modules listed below are modules found by the server but not recognized as one of the supported modules. If the user believes that any listed modules below should have been supported, please check the "CS.cfg" configuration file to see if there is a name mismatch and adjust this accordingly.</h3>
+<table width=100%>
+<tr bgcolor="#cccccc">
+ <td width=20%><b>Module/Token</b></td>
+ <td width=10%><b>Status</b></td>
+ <td width=10%><b>Default</b></td>
+ <td width=10%><b>Operations</b></td>
+</tr>
+#foreach ($module in $oms)
+<tr bgcolor="#eeeeee">
+ <td>$module.getUserFriendlyName()</td>
+ <td>
+ #if ($module.isFound())
+ Found
+ #else
+ Not Found
+ #end
+ </td>
+ <td></td>
+ <td></td>
+</tr>
+#foreach ($token in $module.getTokens())
+<tr>
+ <td>- $token.getNickName()</td>
+ <td>
+ #if ($token.isLoggedIn())
+ Logged In
+ #else
+ Not logged In
+ #end
+ </td>
+ <td>
+ #if ($defTok == $token.getNickName())
+ <input checked type=radio name="choice" value="$token.getNickName()">
+ #else
+ <input type=radio name="choice" value="$token.getNickName()">
+ #end
+ </td>
+ <td></td>
+</tr>
+#end
+#end
+
+</table>
+
+
+ <br/>
+
+ <div align="right">
+ <hr />
+ &nbsp;
+ </div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/namepanel.vm b/base/ra/apache/docroot/ra/admin/console/config/namepanel.vm
new file mode 100644
index 000000000..071b523a9
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/namepanel.vm
@@ -0,0 +1,91 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+Each certificate associated with this instance needs to have a unique name within the PKI hierarchy. The following information will be used to generate these unique names. Each certificate will be stored in the security module using a unique nickname. <a href="javascript:toggle_details();">[Details]</a>
+<SCRIPT type="text/JavaScript">
+function toggle_details()
+{
+ d = document.getElementById('details');
+ if (d.style.display == "block") {
+ d.style.display="none";
+ } else {
+ d.style.display="block";
+ }
+}
+</script>
+
+<div id=details style="display: none;">
+<p>
+Each unique name, called the certificate's subject name, is referenced as the distinguished name (DN). A DN may be composed of multiple comma separated name=value fields.
+<br/>
+</div>
+
+ <p>
+#if ($errorString != "")
+<img alt="" src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+<br/>
+#foreach ($item in $certs)
+<H2>$item.getUserFriendlyName()</H2>
+
+ <table class="details">
+ <tr>
+ <th>DN:</th>
+ <td><input type="text" size="70" name="$item.getCertTag()" value="$item.getDN()"/></td>
+ </tr>
+ <tr>
+ <th>Nickname:</th>
+ <td><input type="text" size="70" name="$item.getCertTag()_nick" value="$item.getNickname()"/></td>
+ </tr>
+ </table>
+<p>
+#end
+<p>
+<hr>
+<p>
+Please select the CA to submit these system certificate requests:
+<p>
+ <table class="details">
+ <tr>
+ <th>URL:</th>
+ <td><select name="urls">
+ #if ($urls_size != 0)
+ #set ($x=0)
+ #foreach ($p in $urls)
+ <option value="$x">$p</option>
+ #set ($x=$x+1)
+ #end
+ #end
+ </select>
+ </td>
+ </tr>
+ </table>
+
+ <div align="right">
+ <hr />
+ </div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/securitydomainloginpanel.vm b/base/ra/apache/docroot/ra/admin/console/config/securitydomainloginpanel.vm
new file mode 100644
index 000000000..58ace3f68
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/securitydomainloginpanel.vm
@@ -0,0 +1,109 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+
+ <title>Dogtag Certificate System</title>
+
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+<META http-equiv=Content-Type content="text/html; charset=UTF-8">
+ </head>
+
+
+<div id="wrap">
+<div id="header">
+ <a href="http://pki.fedoraproject.org/" title="Visit pki.fedoraproject.org for more information about Dogtag"><img src="/pki/images/logo_header.gif" alt="Dogtag" id="myLogo" /></a>
+ <div id="headerpaddedtitle">
+ <a href="/" title="Dogtag">Dogtag<sup><font size="-2">&reg;</font></sup> Certificate System</a>
+ </div>
+ <div id="account">
+ <dl><dt><span></span></dt><dd></dd></dl>
+ </div>
+</div>
+
+<div id="mainNavOuter">
+<div id="mainNav">
+
+<div id="mainNavInner">
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+<!-- close bar -->
+
+ <div id="content">
+ <table width="100%" cellspacing="0">
+ <tr>
+ <td width="100%">
+ <h1><img src="/pki/images/icon-software.gif" />
+ Security Domain ($name) Login </h1>
+
+ <form name=sdForm action="getCookie" method="post">
+ <p>The Enterprise $subsystem Administrator will register this $subsystem Subsystem located at $host under this Security Domain located at $sdhost. The credential information will be provided to the Security Domain for authentication.<p>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+ <table class="details">
+ <tr>
+ <th>Uid:</th>
+
+ <td><input type="text" length="128" size="40" name="uid" value="$sd_uid" /></td>
+ </tr>
+
+ <tr>
+ <th>Password:</th>
+
+ <td><input type="password" length="64" size="40" name="pwd" value="$sd_pwd" autocomplete="off" /></td>
+ </tr>
+<input type=hidden name=url value="$url">
+
+ </table>
+
+ <div align="right">
+ <hr />
+ &nbsp;
+ </div>
+
+
+<p>
+<table width=100%>
+<tr bgcolor="#eeeeee">
+ <td>
+<div align="right">
+<input onclick="sdForm.submit()" type="button" name="sd_next" value="Login">
+</div>
+ </td>
+</tr>
+</table>
+
+ </form>
+
+ </td>
+ </tr>
+ </table>
+
+ </div> <!-- close content -->
+ </div> <!-- close wrap -->
+
+ </body>
+</html>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/securitydomainpanel.vm b/base/ra/apache/docroot/ra/admin/console/config/securitydomainpanel.vm
new file mode 100644
index 000000000..f67f7b242
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/securitydomainpanel.vm
@@ -0,0 +1,115 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+<h2>$panelname</h2>
+<br/>
+A security domain is a registry for all of the PKI services within an enterprise. Applications may use the security domain to locate other PKI services. <a href="javascript:toggle_details();">[Details]</a>
+<SCRIPT type="text/JavaScript">
+function toggle_details()
+{
+ d = document.getElementById('details');
+ if (d.style.display == "block") {
+ d.style.display="none";
+ } else {
+ d.style.display="block";
+ }
+}
+</script>
+
+<div id=details style="display: none;">
+<br/>
+This PKI solution allows multiple security domains within an organization, but each security domain must host a Certificate Authority.
+<br/>
+If the user is creating a new security domain, this CA Administrator is also
+the security domain Administrator.
+<br/>
+If this subsystem is joining an existing security domain, the user will need to provide the credential information of the security domain Administrator
+requested in the next panel.
+</div>
+#if ($errorString != "")
+<img alt="" src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+<br/>
+#if ($cstype == "CA")
+<b><input $check_newdomain type=radio name=choice value="newdomain">&nbsp;Create a New Security Domain </b>
+<br/>
+If no security domain exists, a new one must be created for this CA.
+ <table class="details">
+ <tr>
+ <th>Security Domain Name: </th>
+ <td><input type=text size="40" name="sdomainName" value="$sdomainName"> (e.g. - Dogtag Security Domain)</td>
+ </tr>
+ <tr>
+ <th>Security Domain HTTP EE URL (unsecure): </th>
+ <td>http://$machineName:$http_ee_port</td>
+ </tr>
+ <tr>
+ <th>Security Domain HTTPS Agent URL (clientauth): </th>
+ <td>https://$machineName:$https_agent_port</td>
+ </tr>
+ <tr>
+ <th>Security Domain HTTPS EE URL (non-clientauth): </th>
+ <td>https://$machineName:$https_ee_port</td>
+ </tr>
+ <tr>
+ <th>Security Domain HTTPS Admin URL (non-clientauth): </th>
+ <td>https://$machineName:$https_admin_port</td>
+ </tr>
+ </table>
+<br/>
+<b><input $check_existingdomain type=radio name=choice value="existingdomain">&nbsp;Join an Existing Security Domain </b>
+#else
+<b><input disabled="disabled" type=radio name=choice value="newdomain">&nbsp;Create a New Security Domain </b>
+<br/>
+If no security domain exists, a new one must be created for this CA.
+ <table class="details">
+ <tr>
+ <th>Security Domain Name: </th>
+ <td><input disabled="disabled" type=text size="40" name="sdomainName" value="$sdomainName"> (e.g. - Dogtag Security Domain)</td>
+ </tr>
+ </table>
+<br/>
+<b><input checked type=radio name=choice value="existingdomain">&nbsp;Join an Existing Security Domain </b>
+#end
+<br/>
+Enter the URL to an existing security domain.
+<br/>
+ <table class="details">
+ <tr>
+ <th>Security Domain HTTPS Admin URL (non-clientauth): </th>
+ <td><input type=text size="40" name="sdomainURL" value="$sdomainURL"> (e.g. - https://example.com:9445)</td>
+ </tr>
+ </table>
+<br/>
+<table>
+<tr>
+<td valign="top"><b>NOTE:&nbsp;&nbsp; </b></td>
+<td>Since a Security Domain MUST be a CA (although all CAs are NOT necessarily Security Domains), an appropriate value for this URL may be obtained by logging into the machine which hosts the desired Security Domain CA as 'root' and running the command "$initCommand status $instanceID" from the command-line.</td>
+</tr>
+</table>
+<br/>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/sidemenu.vm b/base/ra/apache/docroot/ra/admin/console/config/sidemenu.vm
new file mode 100644
index 000000000..09fe16870
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/sidemenu.vm
@@ -0,0 +1,30 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<div id="sidenav">
+<ul>
+ <li><a href="welcome">Welcome</a></li>
+ <li><a href="database">Internal Database</a></li>
+ <li><a href="module">Security Modules</a></li>
+ <li><a href="size">Key Size</a></li>
+ <li><a href="name">Issuer Name</a></li>
+ <li><a href="hierarchy">PKI Hierarchy</a></li>
+ <li><a href="admin">Administrator</a></li>
+ <li><a href="done">Finish</a></li>
+</ul>
+</div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/sizepanel.vm b/base/ra/apache/docroot/ra/admin/console/config/sizepanel.vm
new file mode 100644
index 000000000..76b1d18a2
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/sizepanel.vm
@@ -0,0 +1,235 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<style type="text/css">
+div#advance
+{
+ margin: 0px 20px 0px 20px;
+ display: none;
+}
+div#simple
+{
+ margin: 0px 20px 0px 20px;
+ display: block;
+}
+</style>
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+
+function toggleLayer(whichLayer)
+{
+ if (document.getElementById) {
+ // this is the way the standards work
+ var style2 = document.getElementById(whichLayer).style;
+ if (style2.display == "block") {
+ style2.display = "none";
+ } else {
+ style2.display = "block";
+ }
+ }
+}
+
+function toggleLayer1(whichLayer)
+{
+ if (document.getElementById) {
+ // this is the way the standards work
+ var style2 = document.getElementById(whichLayer).style;
+ if (style2.display == "block") {
+ style2.display = "none";
+ } else if (style2.display == "") {
+ style2.display = "none";
+ } else {
+ style2.display = "block";
+ }
+ }
+}
+
+function keyTypeChange()
+{
+ var form = document.forms[0];
+ var keyTypeSelect = document.forms[0].elements['keytype'];
+ for (var i = 0; i < form.length; i++) {
+ var name = form[i].name;
+ if (name.indexOf('_keytype') != -1) {
+ form.elements[name].selectedIndex = keyTypeSelect.selectedIndex;
+ }
+ }
+}
+
+function defaultChange()
+{
+ var form = document.forms[0];
+ var choiceSelect = document.forms[0].elements['choice'];
+ for (var i = 0; i < form.length; i++) {
+ var name = form[i].name;
+ if (name.indexOf('_choice') != -1) {
+ for (var j = 0; j < form.elements[name].length; j++) {
+ var c = form.elements[name];
+ c[j].checked = choiceSelect[j].checked;
+ }
+ }
+ }
+}
+
+function customChange()
+{
+ var form = document.forms[0];
+ var choiceSelect = document.forms[0].elements['choice'];
+ for (var i = 0; i < form.length; i++) {
+ var name = form[i].name;
+ if (name.indexOf('_choice') != -1) {
+ for (var j = 0; j < form.elements[name].length; j++) {
+ var c = form.elements[name];
+ c[j].checked = choiceSelect[j].checked;
+ }
+ }
+ }
+}
+
+function textChange()
+{
+ var customSize = document.forms[0].elements['custom_size'];
+ var form = document.forms[0];
+ for (var i = 0; i < form.length; i++) {
+ var name = form[i].name;
+ if (name.indexOf('_custom_size') != -1) {
+ form.elements[name].value = customSize.value;
+ }
+ }
+}
+
+</SCRIPT>
+Select the key pair type(s) and associated key pair size(s) from the pulldown menus. <a href="javascript:toggle_details();">[Details]</a>
+<SCRIPT type="text/JavaScript">
+function toggle_details()
+{
+ d = document.getElementById('details');
+ if (d.style.display == "block") {
+ d.style.display="none";
+ } else {
+ d.style.display="block";
+ }
+}
+</script>
+<div id=details style="display: none;">
+<p>
+Each key pair is comprised of a <b><i>key type</i></b> and a <b><i>key size</i></b>. Based upon the key type selected from the first pulldown menu, associated key sizes (in bits) will be selectable from the second pulldown menu.
+<p>
+Within each key pair type (but not comparable between two different key pair types), the size of the key is a measure of how secure a given system is (i.e. - the longer the key pair size, the more secure the system). Unfortunately, longer key pair sizes increase the time required to perform operations such as signing certificates.
+<p>
+</div>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+<p>
+<div id="simple">
+<p>
+<table width=100%>
+<tr>
+ <td align=right><a href="javascript:toggleLayer1('simple'); toggleLayer('advance');" title="Advanced">[Advanced]</a></td>
+</tr>
+</table>
+<p>
+<H2>Common Key Settings</H2>
+<p>
+<table width=100% class="details">
+ <tr>
+ <th width="30%">Key Type:</th>
+ <td><select name="keytype" onChange="keyTypeChange()"><option value=rsa>RSA</option><option value=ecc>ECC</option></select></td>
+ </tr>
+</table>
+<p>
+ <input
+#if ($select == "default")
+ checked
+#end
+ onChange="defaultChange()" type=radio name="choice" value="default"><b>Use the default key size ($default_keysize bits for RSA, $default_ecc_keysize bits for ECC)</b>.
+ <p>
+ <input
+#if ($select == "custom")
+ checked
+#end
+ onChange="customChange()" type=radio name="choice" value="custom"><b>Use the following custom key size:</b>
+
+ <p>
+<table width=100% class="details">
+ <tr>
+ <th>Key Size:</th>
+ <td><input onChange="textChange()" type="text" size="20" name="custom_size" value="2048" /></td>
+ </tr>
+</table>
+</div>
+<p>
+<div id="advance">
+<p>
+<table width=100%>
+<tr>
+ <td align=right><a href="javascript:toggleLayer1('simple');toggleLayer('advance');" title="Simple">[Simple]</a></td>
+</tr>
+</table>
+#foreach ($item in $certs)
+<H2>Key for $item.getUserFriendlyName()</H2>
+<p>
+<table width=100% class="details">
+ <tr>
+ <th width="30%">Key Type:</th>
+ <td><select name="$item.getCertTag()_keytype"><option value=rsa>RSA</option><option value=ecc>ECC</option></select></td>
+ </tr>
+</table>
+<p>
+ <input
+#if ($item.useDefaultKey())
+ checked
+#end
+ type=radio name=$item.getCertTag()_choice value="default"><b>Use the default key size ($default_keysize bits for RSA, $default_ecc_keysize bits for ECC).
+ <p>
+ <input
+#if (!$item.useDefaultKey())
+ checked
+#end
+ type=radio name=$item.getCertTag()_choice value="custom"><b>Use the following custom key size:</b>
+
+ <p>
+<table width=100% class="details">
+ <tr>
+ <th>Key Size:</th>
+ <td><input type="text" size="20" name=$item.getCertTag()_custom_size value="$item.getCustomKeysize()" /></td>
+ </tr>
+</table>
+#end
+</div>
+<br/>
+<br/>
+<br/>
+#if ($firsttime == 'false')
+<input type="CHECKBOX" NAME="generateKeyPair">New Keys<p>
+#end
+<p>
+ <div align="right">
+ <hr />
+<i>Note: After pressing Next, keys will be generated on the server, which will take some time to complete. Please wait for the next panel to appear.</i>
+ &nbsp;
+ </div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/tksinfopanel.vm b/base/ra/apache/docroot/ra/admin/console/config/tksinfopanel.vm
new file mode 100644
index 000000000..f4a0a3fd7
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/tksinfopanel.vm
@@ -0,0 +1,51 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT LANGUAGE="JavaScript">
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+
+</SCRIPT>
+The Token Key Service (TKS) is responsible for managing master keys that are used for establishing secure channels. Select an HTTPS Agent URL of a TKS from the list below.
+<p>
+#if ($errorString != "")
+<img src="/pki/images/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+<p>
+ <table class="details">
+ <tr>
+ <th>URL:</th>
+ <td><select name="urls">
+ #if ($urls_size != 0)
+ #set ($x=0)
+ #foreach ($p in $urls)
+ <option value="$x">$p</option>
+ #set ($x=$x+1)
+ #end
+ #end
+ </select>
+ </td>
+ </tr>
+ </table>
+ <div align="right">
+ <hr />
+ </div>
+<p>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/topmenu.vm b/base/ra/apache/docroot/ra/admin/console/config/topmenu.vm
new file mode 100644
index 000000000..64881066f
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/topmenu.vm
@@ -0,0 +1,21 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<ul>
+<li id="mainFirst-active"><a href="wizard" class="mainFirstLink">Setup Wizard</a></li>
+</ul>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/welcomepanel.vm b/base/ra/apache/docroot/ra/admin/console/config/welcomepanel.vm
new file mode 100644
index 000000000..fd478d1a8
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/welcomepanel.vm
@@ -0,0 +1,57 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<SCRIPT type="text/JavaScript">
+function myOnLoad() {
+}
+
+function performPanel() {
+ with (document.forms[0]) {
+ submit();
+ }
+}
+</SCRIPT>
+<H2>$wizardname</H2>
+The $fullsystemname
+ configuration wizard will guide the administrator through the process of configuring a single instance of the $fullsystemname
+ ($systemname). <a href="javascript:toggle_details();">[Details]</a>
+
+<SCRIPT type="text/JavaScript">
+function toggle_details()
+{
+ d = document.getElementById('details');
+ if (d.style.display == "block") {
+ d.style.display="none";
+ } else {
+ d.style.display="block";
+ }
+}
+</script>
+
+<div id=details style="display: none;">
+<p>
+A Public Key Infrastructure (PKI) system creates, manages, and revokes keys and certificates.
+<p>
+Dogtag Certificate System (DCS) $productversion &nbsp;
+is a robust PKI system consisting of numerous subsystems including a Certificate Authority (CA), a Registration Authority (RA), a Data Recovery Manager (DRM), an Online Certificate Status Protocol (OCSP) Manager, a Token Key Service (TKS), and a Token Processing System (TPS), as well as a multi-platform smartcard middleware software client called Enterprise Security Client (ESC).
+<p>
+For any subsystem to be useable, a user must use this wizard to configure an instance of this subsystem.
+#if ($systemType != "tps")
+<p>
+#end
+</div>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/wizard.vm b/base/ra/apache/docroot/ra/admin/console/config/wizard.vm
new file mode 100644
index 000000000..4c7472817
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/wizard.vm
@@ -0,0 +1,144 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+ <head>
+
+ <title>Dogtag Certificate System</title>
+
+ <link rel="shortcut icon" href="/pki/images/favicon.ico" />
+ <link rel="stylesheet" href="/pki/css/pki-base.css" type="text/css" />
+
+ <META http-equiv=Content-Type content="text/html; charset=UTF-8">
+
+ </head>
+
+<SCRIPT LANGUAGE="JavaScript">
+function process(fop) {
+ with (document.forms[0]) {
+ op.value = fop;
+ if (fop == 'next') {
+ document.getElementById('progress').style.visibility = "visible";
+ performPanel();
+ } else if (fop == 'apply') {
+ document.getElementById('progress').style.visibility = "visible";
+ performPanel();
+ } else {
+ document.getElementById('progress').style.visibility = "visible";
+ submit();
+ }
+ }
+}
+
+</SCRIPT>
+
+ <body><div id="wrap">
+
+#include ( "ra/admin/console/config/header.vm" )
+
+<div id="mainNavOuter">
+<div id="mainNav">
+
+<div id="mainNavInner">
+
+
+<ul>
+<li id="mainFirst-active"><a href="wizard" class="mainFirstLink">$name</a></li>
+</ul>
+
+</div><!-- end mainNavInner -->
+</div><!-- end mainNav -->
+</div><!-- end mainNavOuter -->
+
+
+<div id="bar">
+
+<div id="systembar">
+<div id="systembarinner">
+
+<div>
+</div>
+
+
+</div>
+</div>
+
+</div>
+<!-- close bar -->
+
+ <div id="content">
+ <table width="100%" cellspacing="0">
+ <tr>
+ <td class="sidebar">
+
+<div id="sidenav">
+<ul>
+#foreach ($pn in $panels)
+#if (!$pn.isSubPanel())
+ <li><center><font color=black size="2">$pn.getName()</font></center></li>
+#end
+#end
+</ul>
+</div>
+
+ </td>
+ <td class="page-content" width="100%">
+ <h1><img src="/pki/images/icon-software.gif" />
+ $title </h1>
+
+<form name=f method=post action="wizard">
+<input type=hidden name=p value="$p">
+
+#parse ( $panel )
+
+<input type=hidden name="op" value=''>
+
+</form>
+
+<table width=100% border=0 cellspacing=0 cellpadding=0>
+<tr bgcolor="#eeeeee">
+<td><img id=progress style="visibility: hidden;" src="/pki/images/bigrotation2.gif" /></td>
+<td align=right>
+
+#if ($showApplyButton == "true")
+<input type=button onclick="process('apply')" name=back value="Apply">
+#end
+
+#if ($lastpanel)
+&nbsp;
+#else
+<input type=button onclick="process('next')" name=back value="Next>">
+#end
+
+</td>
+</tr>
+</table>
+
+ </td>
+ </tr>
+ </table>
+
+#include ( "ra/admin/console/config/footer.vm" )
+
+ </div> <!-- close content -->
+ </div> <!-- close wrap -->
+
+ </body>
+</html>
diff --git a/base/ra/apache/docroot/ra/admin/console/config/xml.vm b/base/ra/apache/docroot/ra/admin/console/config/xml.vm
new file mode 100644
index 000000000..31ff72aa2
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/config/xml.vm
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<response>
+ $xml
+</response>
diff --git a/base/ra/apache/docroot/ra/admin/console/js/misc.js b/base/ra/apache/docroot/ra/admin/console/js/misc.js
new file mode 100644
index 000000000..d4dc336ab
--- /dev/null
+++ b/base/ra/apache/docroot/ra/admin/console/js/misc.js
@@ -0,0 +1,30 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// Copyright (C) 2007 Red Hat, Inc.
+// All rights reserved.
+// --- END COPYRIGHT BLOCK ---
+
+/**
+ * This function is to submit the form's parameters and to decide if the
+ * window should remain open.
+ *
+ * @param f The form
+ * @param fclose true if you want to close the window; otherwise false.
+ */
+function saveConfig(f, fclose) {
+ f.submit();
+ if (fclose == true)
+ window.close();
+}