summaryrefslogtreecommitdiffstats
path: root/base/kra/shared/webapps/kra/agent/kra/processReq.template
diff options
context:
space:
mode:
Diffstat (limited to 'base/kra/shared/webapps/kra/agent/kra/processReq.template')
-rw-r--r--base/kra/shared/webapps/kra/agent/kra/processReq.template281
1 files changed, 281 insertions, 0 deletions
diff --git a/base/kra/shared/webapps/kra/agent/kra/processReq.template b/base/kra/shared/webapps/kra/agent/kra/processReq.template
new file mode 100644
index 0000000..078764d
--- /dev/null
+++ b/base/kra/shared/webapps/kra/agent/kra/processReq.template
@@ -0,0 +1,281 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+</head>
+<CMS_TEMPLATE>
+<SCRIPT LANGUAGE="JavaScript"></SCRIPT>
+<SCRIPT LANGUAGE="JavaScript" SRC="../helpfun.js"></SCRIPT>
+<SCRIPT LANGUAGE="JavaScript">
+//<!--
+
+function toHex(number)
+{
+ var absValue = "", sign = "";
+ var digits = "0123456789abcdef";
+ if (number < 0) {
+ sign = "-";
+ number = -number;
+ }
+
+ for(; number >= 16 ; number = Math.floor(number/16)) {
+ absValue = digits.charAt(number % 16) + absValue;
+ }
+ absValue = digits.charAt(number % 16) + absValue;
+ return sign + absValue;
+}
+
+function renderHexNumber(number,width)
+{
+ var num = toHex(number);
+ while (num.length < width)
+ num = "0"+num;
+ return "0x"+num;
+}
+
+function renderDateFromSecs(secs)
+{
+ if (secs == null) return "";
+ var today = new Date();
+ var dateTmp = new Date();
+ dateTmp.setTime(secs * 1000);
+ var dateStr = dateTmp.toLocaleString();
+ return dateStr;
+}
+
+function passwdValidate()
+{
+
+ if (document.forms[0].p12Password.value != document.forms[0].p12PasswordAgain.value) {
+ alert("Passwords do not match");
+ return false;
+ }
+ return true;
+}
+
+//
+// This form is a template that gets a preamble defining the contents
+// of the request form as a JavaScript object called 'result.header'.
+// whose properties are filled in by the server.
+//
+document.writeln('<body vlink="0000ff" alink="ff0000" link="0000ff" bgcolor="white">');
+document.writeln(
+ '<font face="PrimaSans BT, Verdana, sans-serif"><font size=+1>'+
+ 'Request ' +
+ '<a href="/kra/agent/kra/processReq?op=processReq&seqNum=' +
+ result.header.seqNum + '"' +
+ 'onMouseOver=" return helpstatus(\'Click to redisplay this ' +
+ 'request \')" onMouseOut="return helpstatus(\'\')">' +
+ result.header.seqNum +
+ '</a></font></font>');
+document.writeln('<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" BACKGROUND="/pki/images/hr.gif"><TR><TD></TD></TR></TABLE>');
+
+
+document.writeln('<form action="/kra/agent/kra/getAsyncPk12" method=post onSubmit="return passwdValidate()">');
+document.writeln('<table border="0" cellspacing="2" cellpadding="2" width="100%">');
+document.writeln('<tr><td valign="top" align="left" colspan="3" bgcolor="#e5e5e5">');
+document.writeln('<font size="-1" face="PrimaSans BT, Verdana, sans-serif">'
+);
+document.writeln('Request</font></td></tr>');
+document.writeln('<tr>');
+document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">Status:</font></td>');
+document.write('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif">' + result.header.status + '</font></td>');
+document.writeln('</tr>');
+
+// Note these values are filtered for safety by the server.
+if (result.header.requestorName != null ||
+ result.header.requestorEmail != null ||
+ result.header.requestorPhone != null) {
+ document.writeln('<p><b> Requestor\'s Contact Information:</b><br>');
+ document.writeln('<blockquote>');
+ if (result.header.requestorName != null) {
+ document.writeln('<b> Name: </b>',
+ result.header.requestorName,
+ '<br>');
+ }
+ if (result.header.requestorEmail != null) {
+ document.writeln('<b> E-mail: </b>',
+ result.header.requestorEmail,
+ '<br>');
+ }
+ if (result.header.requestorPhone != null) {
+ document.writeln('<b> Phone: </b>',
+ result.header.requestorPhone,
+ '<br>');
+ }
+ document.writeln('</blockquote>');
+}
+
+// request type
+document.writeln('<tr>');
+document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">Type:</font></td>');
+document.write('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif">' + result.header.requestType + '</font></td>');
+document.writeln('</tr>');
+
+// createdOn
+document.writeln('<tr>');
+document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">Created on:</font></td>');
+document.write('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif">' + renderDateFromSecs(result.header.createdOn) + '</font></td>');
+document.writeln('</tr>');
+
+// updateBy
+document.writeln('<tr>');
+document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">Updated by:</font></td>');
+document.write('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif">' + result.header.updatedBy + '</font></td>');
+document.writeln('</tr>');
+
+// updatedOn
+document.writeln('<tr>');
+document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">Updated on:</font></td>');
+document.write('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif">' + renderDateFromSecs(result.header.updatedOn) + '</font></td>');
+document.writeln('</tr>');
+
+document.writeln('<INPUT TYPE="HIDDEN" NAME="seqNum" VALUE="' +
+ result.header.seqNum + '">');
+
+if (result.header.requestorName != null) {
+ document.writeln('<INPUT TYPE="HIDDEN" NAME="requestorName" VALUE="' +
+ result.header.requestorName + '">');
+}
+if (result.header.requestorEmail != null) {
+ document.writeln('<INPUT TYPE="HIDDEN" NAME="requestorEmail" VALUE="' +
+ result.header.requestorEmail + '">');
+}
+if (result.header.requestorPhone != null) {
+ document.writeln('<INPUT TYPE="HIDDEN" NAME="requestorPhone" VALUE="' +
+ result.header.requestorPhone + '">');
+}
+
+
+// Note: requestorComments are safely filtered by server
+if (result.header.requestorComments != null) {
+ document.writeln('<b> Comments Made When The Request Was Filed:</b><br>');
+ document.writeln('<blockquote>', result.header.requestorComments,
+ '</blockquote>');
+ document.writeln('<b> Additional Comments:</b><br>');
+ document.writeln('<blockquote>');
+ document.writeln('<INPUT TYPE="TEXT" NAME="moreComments" SIZE=72 VALUE="">');
+ document.writeln('</blockquote>');
+}
+
+if (result.header.requestType == "enrollment") {
+ document.writeln('<tr><td valign="top" align="left" colspan="3" bgcolor="#e5e5e5">');
+ document.writeln('<font size="-1" face="PrimaSans BT, Verdana, sans-serif">');
+ document.writeln('Archival Information</font></td></tr>');
+
+ // Archival-specific UI
+ document.writeln('<tr>');
+ document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">Public key:</font></td>');
+ document.write('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif">' + result.header.publicKey + '</font></td>');
+ document.writeln('</tr>');
+
+ document.writeln('<tr>');
+ document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">Owner name:</font></td>');
+ document.write('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif">' + result.header.ownerName + '</font></td>');
+ document.writeln('</tr>');
+
+ // key serial number
+ document.writeln('<tr>');
+ document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">Key identifier:</font></td>');
+ document.write('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif">' + result.header.serialNumber + '</font></td>');
+ document.writeln('</tr>');
+
+} else if (result.header.requestType == "recovery") {
+ document.writeln('<tr><td valign="top" align="left" colspan="3" bgcolor="#e5e5e5">');
+ document.writeln('<font size="-1" face="PrimaSans BT, Verdana, sans-serif">');
+ document.writeln('Recovery Information</font></td></tr>');
+
+ // Recovery-specific UI
+ // key serial number
+ document.writeln('<tr>');
+ document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">Key identifier:</font></td>');
+ document.write('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif">' + result.header.serialNumber + '</font></td>');
+ document.writeln('</tr>');
+
+ // Recovery agents who have approved the recovery request
+ var initAgent="";
+ var approveAgents="";
+ if (result.header.approvingAgents.indexOf(",")== -1) {
+ initAgent = result.header.approvingAgents;
+ } else {
+ initAgent = result.header.approvingAgents.substring(0,
+ result.header.approvingAgents.indexOf(","));
+ approveAgents = result.header.approvingAgents.substring(
+ result.header.approvingAgents.indexOf(",")+1);
+ }
+ document.writeln('<tr>');
+ document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">Recovery Initiating Agent:</font></td>');
+ document.write('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif">' + initAgent+ '</font></td>');
+ document.writeln('</tr>');
+ document.writeln('<tr>');
+ document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">Recovery Approving Agents:</font></td>');
+ document.write('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif">' + approveAgents
+ + '</font></td>');
+ document.writeln('</tr>');
+}
+
+
+if (result.header.status != "complete") {
+ document.writeln('<tr><td valign="top" align="left" colspan="3" bgcolor="#e5e5e5">');
+ document.writeln('<font size="-1" face="PrimaSans BT, Verdana, sans-serif">');
+ document.writeln('Action</font></td></tr>');
+ if (result.header.requestType == "recovery") {
+ if (result.header.status == "pending") {
+document.writeln('<tr>');
+document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">Asynchronous Key Recovery:</font></td>');
+ document.writeln('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif"><a href="/kra/agent/kra/grantAsyncRecovery?op=grantRecovery&reqID=' +
+ result.header.seqNum + '">' + ' Grant</a></font></td>');
+document.writeln('</tr>');
+
+ } else if (result.header.status == "approved") {
+ var initAgent = result.header.approvingAgents.substring(0,
+ result.header.approvingAgents.indexOf(","));
+
+ // get PKCS#12 password
+ document.writeln('<tr>');
+ document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">PKCS #12 Password:</font></td>');
+ document.write('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif"><input type=password name="p12Password" value="" AutoComplete=off ></font></td>');
+ document.writeln('</tr>');
+
+ document.writeln('<tr>');
+ document.write('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">PKCS #12 Password again:</font></td>');
+ document.write('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif"><input type=password name="p12PasswordAgain" value="" AutoComplete=off ></font></td>');
+ document.writeln('</tr>');
+
+ document.writeln('<tr>');
+ document.writeln('<input type=hidden name="op" VALUE="getAsyncPk12">');
+ document.writeln('<input type=hidden name="reqID" VALUE="' +
+ result.header.seqNum + '">\n');
+ document.writeln('<td align=right><font size="-1" face="PrimaSans BT, Verdana, sans-serif">(only allowed for initiating agent,' + initAgent+')</font></td>');
+ document.writeln('<td align=left><font size="-1" face="PrimaSans BT, Verdana, sans-serif"><input type=submit value="Retrieve PKCS#12"></font></td>');
+ document.writeln('</tr>');
+ }
+ } else {
+ if (result.header.assignedTo != null) {
+ document.write('<b> Assigned To: </b>',result.header.assignedTo);
+ } else {
+ document.write('<b> Unassigned </b>');
+ }
+ if (result.header.assignedTo == null) {
+ document.write('<a href="/kra/agent/kra/processReq?op=processReq&doAssign=yes&seqNum=' +
+ result.header.seqNum + '"' +
+ 'onMouseOver=" return helpstatus(\'Click to assign the ' +
+ 'request to yourself\')" ' +
+ 'onMouseOut="return helpstatus(\'\')">',
+ ' Assign To Me','</a>');
+ } else if (result.header.assignedTo != result.header.callerName) {
+ document.write('<a href="/' +
+ '/kra/agent/kra/processReq?op=processReq&doAssign=yes&overrideAssignment=yes&seqNum=' + result.header.seqNum + '">',
+ ' Re-assign To Me', '</a>');
+ }
+ }
+}
+
+document.writeln('</table>');
+document.writeln('</form>');
+document.writeln('</body>');
+
+//-->
+</SCRIPT>
+
+</HTML>