summaryrefslogtreecommitdiffstats
path: root/pki/linux/tps-ui/shared
diff options
context:
space:
mode:
Diffstat (limited to 'pki/linux/tps-ui/shared')
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/demo/Enroll.html82
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/home/Enroll.html80
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/so/Enroll.html107
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/sow/cfg.pl141
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/sow/enroll.html193
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/sow/enroll_temp.html166
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/sow/format.html181
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/sow/formatso.html161
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/sow/main.html68
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/sow/noaccess.html64
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/sow/read.html79
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/sow/read_temp.html79
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/sow/search.html72
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/sow/search_temp.html72
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/sow/seturl.html166
-rwxr-xr-xpki/linux/tps-ui/shared/cgi-bin/sow/welcome.html64
-rw-r--r--pki/linux/tps-ui/shared/docroot/css/pki-360.css922
-rw-r--r--pki/linux/tps-ui/shared/docroot/css/pki-base.css214
-rw-r--r--pki/linux/tps-ui/shared/docroot/css/pki.css745
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/AdminEsc.html58
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/AdvancePopup.html1714
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/EnrollPopup.html1718
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/GenericAuth.html537
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/SettingsEsc.html738
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/TokenManager.html1706
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/TokenPin.html77
-rw-r--r--pki/linux/tps-ui/shared/docroot/esc/demo/EnrollSuccess.html52
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/demo/GenericAuth.html538
-rw-r--r--pki/linux/tps-ui/shared/docroot/esc/demo/logo.jpgbin0 -> 429 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/demo/style.css214
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/demo/util.js1504
-rw-r--r--pki/linux/tps-ui/shared/docroot/esc/home/EnrollSuccess.html47
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/home/GenericAuth.html539
-rw-r--r--pki/linux/tps-ui/shared/docroot/esc/home/logo.jpgbin0 -> 429 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/home/style.css214
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/home/util.js1504
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/BannerBackground.gifbin0 -> 335 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/CancelButton.gifbin0 -> 1337 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/CloseButton.gifbin0 -> 1309 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/ContinueButton.gifbin0 -> 1457 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/HelpButton.gifbin0 -> 1279 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/NetKey-Small.gifbin0 -> 135 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/NetKeyInsert.gifbin0 -> 1622 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/NetKeyLogo.gifbin0 -> 426 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/NetKeyPair.gifbin0 -> 1451 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/NetKeyProgress.gifbin0 -> 7018 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/NetKeyQuestionMark.gifbin0 -> 1707 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/OKButton.gifbin0 -> 1237 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/PadLock.gifbin0 -> 136 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/PurchaseButton.gifbin0 -> 1878 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/ReactivateButton.gifbin0 -> 1482 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/ReleaseButton.gifbin0 -> 1413 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/SecureButton.gifbin0 -> 1340 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/SuspendButton.gifbin0 -> 1425 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/TryAgainButton.gifbin0 -> 1441 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/images/bg.jpgbin0 -> 519 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/esc/images/logo.gifbin0 -> 2866 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/esc/so/EnrollSuccess.html45
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/so/GenericAuth.html539
-rw-r--r--pki/linux/tps-ui/shared/docroot/esc/so/logo.jpgbin0 -> 429 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/so/style.css214
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/so/util.js1507
-rw-r--r--pki/linux/tps-ui/shared/docroot/esc/sow/EnrollSuccess.html52
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/sow/GenericAuth.html539
-rw-r--r--pki/linux/tps-ui/shared/docroot/esc/sow/images/logo.gifbin0 -> 2866 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/esc/sow/logo.jpgbin0 -> 429 bytes
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/sow/style.css214
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/sow/util.js1698
-rwxr-xr-xpki/linux/tps-ui/shared/docroot/esc/style.css197
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/addResults.template74
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/delete.template283
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/deleteResults.template75
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/doToken.template310
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/doTokenConfirm.template330
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/edit.template186
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/editAdmin.template214
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/editAdminResults.template76
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/editResults.template76
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/error.template74
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/index.template129
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/indexAdmin.template108
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/new.template94
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/revoke.template307
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/search.template116
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/searchActivity.template116
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/searchActivityResults.template195
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/searchAdmin.template116
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/searchAdminResults.template183
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/searchCertificate.template116
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/searchCertificateResults.template182
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/searchResults.template183
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/show.template306
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/showAdmin.template296
-rw-r--r--pki/linux/tps-ui/shared/docroot/tokendb/showCert.template346
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/adminauthenticatepanel.vm52
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/adminpanel.vm237
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/agentauthenticatepanel.vm48
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/authdbpanel.vm66
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/cainfopanel.vm55
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/certchainpanel.vm49
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/certprettyprintpanel.vm49
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/certrequestpanel.vm225
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_addhsm.vm96
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_db.vm126
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_hsm.vm176
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_hsmloginpanel.vm83
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_join.vm125
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_rootca.vm113
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/createsubsystempanel.vm91
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/databasepanel.vm94
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/displaycertchain2panel.vm41
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/displaycertchainpanel.vm41
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/donepanel.vm55
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/drminfopanel.vm56
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/footer.vm21
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/header.vm23
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/hierarchypanel.vm80
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/importadmincertpanel.vm56
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/login.vm110
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/modulepanel.vm158
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/namepanel.vm87
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/securitydomainloginpanel.vm106
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/securitydomainpanel.vm96
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/sidemenu.vm30
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/sizepanel.vm235
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/tksinfopanel.vm51
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/topmenu.vm21
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/welcomepanel.vm58
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/wizard.vm144
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/config/xml.vm4
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/badge.pngbin0 -> 1635 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/bigrotation2.gifbin0 -> 1787 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/button-clear.gifbin0 -> 647 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/button-manage.gifbin0 -> 776 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/button-search.gifbin0 -> 1293 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/certificate.pngbin0 -> 4663 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/clearpixel.gifbin0 -> 43 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/favicon.icobin0 -> 601 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_checkin.gifbin0 -> 225 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_crit_update.gifbin0 -> 337 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_locked.gifbin0 -> 515 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_reg_update.gifbin0 -> 307 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_up2date.gifbin0 -> 226 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/id.pngbin0 -> 1604 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/idkey.pngbin0 -> 1690 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/key.pngbin0 -> 1753 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/lock.pngbin0 -> 1453 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/logo_header.gifbin0 -> 2432 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/no-certificate.pngbin0 -> 2342 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/pki-icon-help.gifbin0 -> 326 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/pki-icon-home.gifbin0 -> 657 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/img/pki-icon-software.gifbin0 -> 1146 bytes
-rw-r--r--pki/linux/tps-ui/shared/docroot/tps/admin/console/js/misc.js31
153 files changed, 27501 insertions, 0 deletions
diff --git a/pki/linux/tps-ui/shared/cgi-bin/demo/Enroll.html b/pki/linux/tps-ui/shared/cgi-bin/demo/Enroll.html
new file mode 100755
index 000000000..79d5a30f1
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/demo/Enroll.html
@@ -0,0 +1,82 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/demo/style.css" type="text/css">
+
+<title>Enrollment</title>
+</head>
+<script type="text/JavaScript" src="/demo/util.js">
+</script>
+<body onload="InitializeBindingTable();" onunload=cleanup()>
+
+<progressmeter id="progress-id" hidden="true" align = "center"/>
+<table width="100%" class="logobar">
+ <tr>
+ <td>
+<img alt="" src="/demo/logo.jpg">
+ </td>
+ <td>
+ <p class="headerText">Veracify Investments Smartcard Enrollment</p>
+ </td>
+ </tr>
+</table>
+ <table id="BindingTable" width="200px" align="center">
+ <tr id="HeaderRow">
+ <td></td>
+ </tr>
+ </table>
+ <p class="bodyText">You have plugged in your Veracify Investments smartcard! After answering a few easy questions, you will be able to use your smartcard to securely manage your investment portfolio.
+ </p>
+ <p class="bodyText">
+ Now we would like you to identify yourself as a current Veracify Investments Customer.
+ </p>
+ <table>
+ <tr>
+ <td><p >Veracify Account Name: </p></td>
+ <td> </td>
+ <td><input type="text" id="snametf" value=""></td>
+ <td> </td>
+ <td><p>Veracify Account Number: </p></td>
+ <td> </td>
+ <td><input type="password" id="snamepwd" value=""></td>
+ </tr>
+
+ </table>
+
+ <p class="bodyText"> Before you can use your smartcard, you will need a password to protect it.</p>
+ <table>
+ <tr>
+ <td><p >Password:</p></td>
+ <td><input type="password" id="pintf" name="pintf" value=""></td>
+
+ <td><p >Re-Enter Password:</p></td>
+ <td><input type="password" id="reenterpintf" name="reenterpintf" value=""></td>
+ </table>
+ <br>
+ <table width="100%">
+ <tr>
+ <td align="right">
+ <input type="button" id="enrollbtn" name="enrollbtn" value="Enroll My Veracify Smartcard" onClick="DoEnrollCOOLKey();">
+ </td>
+ </tr>
+ </table>
+</body></html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/home/Enroll.html b/pki/linux/tps-ui/shared/cgi-bin/home/Enroll.html
new file mode 100755
index 000000000..f6e72c3bc
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/home/Enroll.html
@@ -0,0 +1,80 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/home/style.css" type="text/css">
+
+<title>Enrollment</title>
+</head>
+<script type="text/JavaScript" src="/home/util.js">
+</script>
+<body onload="InitializeBindingTable();" onunload=cleanup()>
+
+<progressmeter id="progress-id" hidden="true" align = "center"/>
+<table width="100%" class="logobar">
+ <tr>
+ <td>
+<img alt="" src="/home/logo.jpg">
+ </td>
+ <td>
+ <p class="headerText">Smartcard Enrollment</p>
+ </td>
+ </tr>
+</table>
+ <table id="BindingTable" width="200px"align="center">
+ <tr id="HeaderRow">
+ </tr>
+ </table>
+ <p class="bodyText">You have plugged in your smartcard! After answering a few easy questions, you will be able to use your smartcard.
+ </p>
+ <p class="bodyText">
+ Now we would like you to identify yourself.
+ </p>
+ <table>
+ <tr>
+ <td><p >LDAP User ID: </p></td>
+ <td> </td>
+ <td><input type="text" id="snametf" value=""></td>
+ <td> </td>
+ <td><p>LDAP Password: </p></td>
+ <td> </td>
+ <td><input type="password" id="snamepwd" value=""></td>
+ </tr>
+
+ </table>
+
+ <p class="bodyText"> Before you can use your smartcard, you will need a password to protect it.</p>
+ <table>
+ <tr>
+ <td><p >Password:</p></td>
+ <td><input type="password" id="pintf" name="pintf" value=""></td>
+
+ <td><p >Re-Enter Password:</p></td>
+ <td><input type="password" id="reenterpintf" name="reenterpintf" value=""></td>
+ </table>
+ <br>
+ <table width="100%">
+ <tr>
+ <td align="right">
+ <input type="button" id="enrollbtn" name="enrollbtn" value="Enroll My Smartcard" onClick="DoEnrollCOOLKey();">
+ </td>
+ </tr>
+ </table>
+</body></html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/so/Enroll.html b/pki/linux/tps-ui/shared/cgi-bin/so/Enroll.html
new file mode 100755
index 000000000..7980a9cf0
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/so/Enroll.html
@@ -0,0 +1,107 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/so/style.css" type="text/css">
+
+<title>Enrollment</title>
+</head>
+<script type="text/JavaScript" src="/so/util.js">
+</script>
+
+<script type="text/javascript">
+<!--
+function UserSelectRowByKeyID(keyType, keyID)
+{
+ DoCoolKeySetConfigValue("Operation-" + keyID,
+ "http://$host:$port/nk_service");
+ DoCoolKeySetConfigValue("TokenType-" + keyID, "userKey");
+ SelectRowByKeyID(keyType, keyID);
+}
+
+function UserOnDoneInitializeBindingTable()
+{
+ var arr = GetAvailableCOOLKeys();
+ var i;
+ for (i=0; i < arr.length; i++)
+ {
+ var keyType = arr[i][0];
+ var keyID = arr[i][1];
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ UserSelectRowByKeyID(keyType, keyID);
+ }
+}
+
+// -->
+</script>
+
+<body onload="InitializeBindingTable();" onunload=cleanup()>
+
+<progressmeter id="progress-id" hidden="true" align = "center"/>
+<table width="100%" class="logobar">
+ <tr>
+ <td>
+<img alt="" src="/so/logo.jpg">
+ </td>
+ <td>
+ <p class="headerText">Security Officer Enrollment</p>
+ </td>
+ </tr>
+</table>
+ <table id="BindingTable" width="200px"align="center">
+ <tr id="HeaderRow">
+ </tr>
+ </table>
+ <p class="bodyText">You have plugged in your smartcard! After answering a few easy questions, you will be able to use your smartcard.
+ </p>
+ <p class="bodyText">
+ Now we would like you to identify yourself.
+ </p>
+ <table>
+ <tr>
+ <td><p >LDAP User ID: </p></td>
+ <td> </td>
+ <td><input type="text" id="snametf" value=""></td>
+ <td> </td>
+ <td><p>LDAP Password: </p></td>
+ <td> </td>
+ <td><input type="password" id="snamepwd" value=""></td>
+ </tr>
+
+ </table>
+
+ <p class="bodyText"> Before you can use your smartcard, you will need a password to protect it.</p>
+ <table>
+ <tr>
+ <td><p >Password:</p></td>
+ <td><input type="password" id="pintf" name="pintf" value=""></td>
+
+ <td><p >Re-Enter Password:</p></td>
+ <td><input type="password" id="reenterpintf" name="reenterpintf" value=""></td>
+ </table>
+ <br>
+ <table width="100%">
+ <tr>
+ <td align="right">
+ <input type="button" id="enrollbtn" name="enrollbtn" value="Enroll My Smartcard" onClick="DoEnrollCOOLKey();">
+ </td>
+ </tr>
+ </table>
+</body></html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/sow/cfg.pl b/pki/linux/tps-ui/shared/cgi-bin/sow/cfg.pl
new file mode 100755
index 000000000..79c236bbd
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/sow/cfg.pl
@@ -0,0 +1,141 @@
+#! /usr/bin/perl
+#
+# --- BEGIN COPYRIGHT BLOCK ---
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; 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 ---
+#
+
+#
+# Establish platform-dependent variables:
+#
+my $default_hardware_platform="";
+my $ldapsearch="";
+$default_hardware_platform=`pkiarch`;
+chomp($default_hardware_platform);
+if( $^O eq "linux" ) {
+ if( $default_hardware_platform eq "i386" ) {
+ $ldapsearch = "/usr/lib/mozldap/ldapsearch";
+ } elsif( $default_hardware_platform eq "x86_64" ) {
+ $ldapsearch = "/usr/lib64/mozldap/ldapsearch";
+ }
+} elsif( $^O eq "solaris" ) {
+ if( $default_hardware_platform eq "sparc" ) {
+ $ldapsearch = "/usr/lib/mozldap/ldapsearch";
+ } elsif( $default_hardware_platform eq "sparcv9" ) {
+ $ldapsearch = "/usr/lib/sparcv9/mozldap/ldapsearch";
+ }
+}
+
+#
+# Feel free to modify the following parameters:
+#
+my $ldapHost = "localhost";
+my $ldapPort = "389";
+my $basedn = "ou=People,dc=sfbay,dc=redhat,dc=com";
+my $port = "7888";
+my $secure_port = "7889";
+my $host = "localhost";
+
+my $cfg = "/var/lib/rhpki-tps/conf/CS.cfg";
+
+sub get_ldapsearch()
+{
+ return $ldapsearch;
+}
+
+sub get_ldap_host()
+{
+ my $ldapport = `grep auth.instance.0.hostport $cfg | cut -c26-`;
+ chomp($ldapport);
+ my ($ldapHost, $p) = split(/:/, $ldapport);
+ return $ldapHost;
+}
+
+sub get_ldap_port()
+{
+ my $ldapport = `grep auth.instance.0.hostport $cfg | cut -c26-`;
+ chomp($ldapport);
+ my ($p, $ldapPort) = split(/:/, $ldapport);
+ return $ldapPort;
+}
+
+sub get_base_dn()
+{
+ my $basedn = `grep auth.instance.0.baseDN $cfg | cut -c24-`;
+ chomp($basedn);
+ return $basedn;
+}
+
+sub get_port()
+{
+ my $port = `grep service.unsecurePort $cfg | cut -c22-`;
+ chomp($port);
+ return $port;
+}
+
+sub get_secure_port()
+{
+ my $secure_port = `grep service.securePort $cfg | cut -c20-`;
+ chomp($secure_port);
+ return $secure_port;
+}
+
+sub get_host()
+{
+ my $host = `grep service.machineName $cfg | cut -c21-`;
+ chomp($host);
+ return $host;
+}
+
+sub is_agent()
+{
+ my ($dn) = @_;
+
+ my $uid = $dn;
+ # need to map a subject dn into user DN
+ $uid =~ /uid=([^,]*)/; # retrieve the uid
+ $uid = $1;
+
+ my $x_hostport = `grep -e "^tokendb.hostport" $cfg | cut -c18-`;
+ chomp($x_hostport);
+ my ($x_host, $x_port) = split(/:/, $x_hostport);
+ my $x_basedn = `grep -e "^tokendb.userBaseDN" $cfg | cut -c20-`;
+ chomp($x_basedn);
+ my $x_binddn = `grep -e "^tokendb.bindDN" $cfg | cut -c16-`;
+ chomp($x_binddn);
+ my $x_bindpwdpath = `grep -e "^tokendb.bindPassPath" $cfg | cut -c22-`;
+ chomp($x_bindpwdpath);
+ my $x_bindpwd = `grep -e "^tokendbBindPass" $x_bindpwdpath | cut -c17-`;
+ chomp($x_bindpwd);
+
+ my $cmd = $ldapsearch . "\" " .
+ "-D \"" . $x_binddn . "\" " .
+ "-w \"" . $x_bindpwd . "\" " .
+ "-b \"" . "cn=TUS Officers,ou=Groups,".$x_basedn . "\" " .
+ "-h \"" . $x_host . "\" " .
+ "-p \"" . $x_port ."\" " .
+ "-1 \"(uniqueMember=uid=" . $uid . "*)\" | wc -l";
+ my $matched = `$cmd`;
+ chomp($matched);
+
+ if ($matched eq "0") {
+ return 0;
+ } else {
+ return 1;
+ }
+}
diff --git a/pki/linux/tps-ui/shared/cgi-bin/sow/enroll.html b/pki/linux/tps-ui/shared/cgi-bin/sow/enroll.html
new file mode 100755
index 000000000..605d2274e
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/sow/enroll.html
@@ -0,0 +1,193 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/sow/style.css" type="text/css">
+
+<title>Enrollment</title>
+<script type="text/javascript" src="/sow/js/prototype.js"></script>
+<script type="text/javascript" src="/sow/js/scriptaculous.js?load=effects"></script>
+<script type="text/JavaScript" src="/sow/util.js"></script>
+<link rel="stylesheet" href="/sow/css/style.css" media="screen" type="text/css">
+<script type="text/javascript">
+<!--
+function UserOnCOOLKeyStateError()
+{
+ toggleAjaxProgress('ajax-pb', 'off');
+ toggleButton('enrollbtn', 'on');
+ toggleButton('cancel', 'on');
+}
+
+function UserSelectRowByKeyID(keyType, keyID)
+{
+ DoCoolKeySetConfigValue("Operation-" + keyID,
+ "https://$host:$secure_port/nk_service");
+ DoCoolKeySetConfigValue("TokenType-" + keyID, "userKey");
+ SelectRowByKeyID(keyType, keyID);
+}
+
+function updateKeyText(text)
+{
+ var f = document.getElementById('keytext');
+ new Effect.Shake(f);
+ var text = document.createTextNode(text);
+ var len= f.childNodes.length;
+ for (i=0;i<len;i++){
+ f.removeChild(f.childNodes[0]);
+ }
+ f.appendChild(text);
+}
+
+function UserOnDoneInitializeBindingTable()
+{
+ document.body.onkeyup = onUserKeyUp;
+ var enrollbtn = document.getElementById('enrollbtn');
+ enrollbtn.disabled = true;
+ var pintf = document.getElementById('pintf');
+ pintf.focus();
+
+ // display existing blank smart
+ var arr = GetAvailableCOOLKeys();
+ if (!arr || arr.length < 1)
+ return;
+ var i;
+ for (i=0; i < arr.length; i++)
+ {
+ var keyType = arr[i][0];
+ var keyID = arr[i][1];
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ if (keyStatus == "BLANK") {
+ updateKeyText('A ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ UserSelectRowByKeyID(keyType, keyID);
+ } else if (keyStatus == "UNINITIALIZED") {
+ updateKeyText('An ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ UserSelectRowByKeyID(keyType, keyID);
+ }
+ }
+}
+
+function UserOnCOOLKeyInserted(keyType, keyID)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ if (keyStatus == "ENROLLED" || keyStatus == "UNINITIALIZED") {
+ updateKeyText('An ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ } else {
+ updateKeyText('A ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ }
+ UserSelectRowByKeyID(keyType, keyID);
+}
+
+function UserOnCOOLKeyRemoved(keyType, keyID)
+{
+ updateKeyText('Please insert a blank smartcard now!');
+}
+
+function toggleAjaxProgress(id, i)
+{
+ var e = document.getElementById(id);
+ if (i == 'off') {
+ e.style.display = 'none';
+ } else {
+ e.style.display = 'block';
+ }
+}
+
+function toggleButton(id, i)
+{
+ var e = document.getElementById(id);
+ if (i == 'off') {
+ e.disabled = true;
+ } else {
+ e.disabled = false;
+ }
+}
+
+function onUserKeyUp(e)
+{
+ var pintf = document.getElementById('pintf');
+ var reenterpintf = document.getElementById('reenterpintf');
+ var enrollbtn = document.getElementById('enrollbtn');
+ if (e.keyCode == 13) {
+ if (e.target == pintf) {
+ reenterpintf.focus();
+ } else {
+ pintf.focus();
+ }
+ }
+ if (pintf.value != '' && pintf.value == reenterpintf.value) {
+ enrollbtn.disabled = false;
+ } else {
+ enrollbtn.disabled = true;
+ }
+ return e;
+}
+
+// -->
+</script>
+</head>
+
+<body onload="InitializeBindingTable();" onunload=cleanup()>
+
+<progressmeter id="progress-id" hidden="true" align = "center"/>
+
+<div id="pb" style="display:none;">
+ <table id="BindingTable" width="200px" align="center">
+ <tr id="HeaderRow">
+ </tr>
+ </table>
+</div>
+<div id="header">
+ <div id="logo">
+ <h3><img align=bottom src="/sow/images/badget.png">Security Officer Station</h3>
+ </div>
+</div>
+
+<div id="content">
+ <div id="maintext">
+ <div id="topmenu">
+ | <a href="/cgi-bin/sow/main.cgi">Main</a> |
+ </div>
+ <blockquote><p>The security officer has identified the user as <strong>$cn</strong>. The User ID is <strong>$uid</strong>.</p>
+</blockquote>
+<h3><span id="keytext">Please insert new smartcard now!</span></h3>
+ <blockquote><p>The user must provide a password to protect the smart card.</p> </blockquote>
+ <h3>New Token Password:</h3>
+ <input type="password" id="pintf" name="pintf" value=""><br/>
+ <h3>Re-Enter Token Password:</h3>
+ <input type="password" id="reenterpintf" name="reenterpintf" value=""><br/>
+ <input type="hidden" id="snametf" value="$uid">
+ <h3>User Password:</h3>
+ <input type="password" id="snamepwd" value=""><br/>
+ <table width="100%">
+ <tr>
+<td>
+<div id="ajax-pb" style="display:none;">
+ <img src="/sow/images/indicator.gif">
+</div>
+</td>
+ <td align="right">
+ <input type="button" id="enrollbtn" name="enrollbtn" value="Start Enrollment" onClick="toggleButton('enrollbtn','off');toggleButton('cancel', 'off');toggleAjaxProgress('ajax-pb','on');DoEnrollCOOLKey();">
+ <input type="submit" id="cancel" name="cancel" value="Cancel" onClick="javascript:location.href='/cgi-bin/sow/search.cgi';">
+ </td>
+ </tr>
+ </table>
+ </div>
+</div>
+</body></html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/sow/enroll_temp.html b/pki/linux/tps-ui/shared/cgi-bin/sow/enroll_temp.html
new file mode 100755
index 000000000..b72add5c5
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/sow/enroll_temp.html
@@ -0,0 +1,166 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/sow/style.css" type="text/css">
+
+<title>Enrollment</title>
+<script type="text/javascript" src="/sow/js/prototype.js"></script>
+<script type="text/javascript" src="/sow/js/scriptaculous.js?load=effects"></script>
+<script type="text/JavaScript" src="/sow/util.js"></script>
+<link rel="stylesheet" href="/sow/css/style.css" media="screen" type="text/css">
+<script type="text/javascript">
+<!--
+function UserOnCOOLKeyStateError()
+{
+ toggleAjaxProgress('ajax-pb', 'off');
+ toggleButton('enrollbtn', 'on');
+ toggleButton('cancel', 'on');
+}
+
+function UserSelectRowByKeyID(keyType, keyID)
+{
+ DoCoolKeySetConfigValue("Operation-" + keyID,
+ "https://$host:$secure_port/nk_service");
+ DoCoolKeySetConfigValue("TokenType-" + keyID, "userKey");
+ SelectRowByKeyID(keyType, keyID);
+}
+
+function updateKeyText(text)
+{
+ var f = document.getElementById('keytext');
+ new Effect.Shake(f);
+ var text = document.createTextNode(text);
+ var len= f.childNodes.length;
+ for (i=0;i<len;i++){
+ f.removeChild(f.childNodes[0]);
+ }
+ f.appendChild(text);
+}
+
+function UserOnDoneInitializeBindingTable()
+{
+ // display existing blank smart
+ var arr = GetAvailableCOOLKeys();
+ if (!arr || arr.length < 1)
+ return;
+ var i;
+ for (i=0; i < arr.length; i++)
+ {
+ var keyType = arr[i][0];
+ var keyID = arr[i][1];
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ if (keyStatus == "BLANK") {
+ updateKeyText('A ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ UserSelectRowByKeyID(keyType, keyID);
+ } else if (keyStatus == "UNINITIALIZED") {
+ updateKeyText('An ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ UserSelectRowByKeyID(keyType, keyID);
+ }
+ }
+}
+
+function UserOnCOOLKeyInserted(keyType, keyID)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ if (keyStatus == "ENROLLED" || keyStatus == "UNINITIALIZED") {
+ updateKeyText('An ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ } else {
+ updateKeyText('A ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ }
+ UserSelectRowByKeyID(keyType, keyID);
+}
+
+function UserOnCOOLKeyRemoved(keyType, keyID)
+{
+ updateKeyText('Please insert a blank smartcard now!');
+}
+
+function toggleAjaxProgress(id, i)
+{
+ var e = document.getElementById(id);
+ if (i == 'off') {
+ e.style.display = 'none';
+ } else {
+ e.style.display = 'block';
+ }
+}
+
+function toggleButton(id, i)
+{
+ var e = document.getElementById(id);
+ if (i == 'off') {
+ e.disabled = true;
+ } else {
+ e.disabled = false;
+ }
+}
+// -->
+</script>
+</head>
+
+<body onload="InitializeBindingTable();" onunload=cleanup()>
+
+<progressmeter id="progress-id" hidden="true" align = "center"/>
+
+<div id="pb" style="display:none;">
+ <table id="BindingTable" width="200px" align="center">
+ <tr id="HeaderRow">
+ </tr>
+ </table>
+</div>
+<div id="header">
+ <div id="logo">
+ <h3><img align=bottom src="/sow/images/badget.png">Security Officer Station</h3>
+ </div>
+</div>
+
+<div id="content">
+ <div id="maintext">
+ <div id="topmenu">
+ | <a href="/cgi-bin/sow/main.cgi">Main</a> |
+ </div>
+ <blockquote><p>The security officer has identified the user as <strong>$cn</strong>. The User ID is <strong>$uid</strong>.</p>
+</blockquote>
+<h3><span id="keytext">Please insert new smartcard now!</span></h3>
+ <blockquote><p>The user must provide a password to protect the smart card.</p> </blockquote>
+ <h3>New Token Password:</h3>
+ <input type="password" id="pintf" name="pintf" value=""><br/>
+ <h3>Re-Enter Token Password:</h3>
+ <input type="password" id="reenterpintf" name="reenterpintf" value=""><br/>
+ <input type="hidden" id="snametf" value="$uid">
+ <h3>User Password:</h3>
+ <input type="password" id="snamepwd" value=""><br/>
+ <table width="100%">
+ <tr>
+<td>
+<div id="ajax-pb" style="display:none;">
+ <img src="/sow/images/indicator.gif">
+</div>
+</td>
+ <td align="right">
+ <input type="button" id="enrollbtn" name="enrollbtn" value="Start Enrollment" onClick="toggleButton('enrollbtn','off');toggleButton('cancel', 'off');toggleAjaxProgress('ajax-pb','on');DoEnrollTempCOOLKey();">
+ <input type="submit" id="cancel" name="cancel" value="Cancel" onClick="javascript:location.href='/cgi-bin/sow/search.cgi';">
+ </td>
+ </tr>
+ </table>
+ </div>
+</div>
+</body></html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/sow/format.html b/pki/linux/tps-ui/shared/cgi-bin/sow/format.html
new file mode 100755
index 000000000..30989aa07
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/sow/format.html
@@ -0,0 +1,181 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/sow/style.css" type="text/css">
+
+<title>Enrollment</title>
+<script type="text/javascript" src="/sow/js/prototype.js"></script>
+<script type="text/javascript" src="/sow/js/scriptaculous.js?load=effects"></script>
+<script type="text/JavaScript" src="/sow/util.js"></script>
+<link rel="stylesheet" href="/sow/css/style.css" media="screen" type="text/css">
+<script type="text/javascript">
+<!--
+function UserOnCOOLKeyStateError()
+{
+ toggleAjaxProgress('ajax-pb', 'off');
+ toggleButton('enrollbtn', 'on');
+ toggleButton('cancel', 'on');
+}
+
+function UserOnCOOLKeyFormatComplete()
+{
+ toggleAjaxProgress('ajax-pb', 'off');
+ toggleButton('enrollbtn', 'on');
+ toggleButton('cancel', 'on');
+}
+
+function updateKeyText(text)
+{
+ var f = document.getElementById('keytext');
+ new Effect.Shake(f);
+ var text = document.createTextNode(text);
+ var len= f.childNodes.length;
+ for (i=0;i<len;i++){
+ f.removeChild(f.childNodes[0]);
+ }
+ f.appendChild(text);
+}
+
+function UserSelectRowByKeyID(keyType, keyID)
+{
+ DoCoolKeySetConfigValue("Operation-" + keyID,
+ "https://$host:$secure_port/nk_service");
+ DoCoolKeySetConfigValue("TokenType-" + keyID, "userKey");
+ SelectRowByKeyID(keyType, keyID);
+}
+
+function UserOnDoneInitializeBindingTable()
+{
+ // display existing blank smart
+ var arr = GetAvailableCOOLKeys();
+ if (!arr || arr.length < 1)
+ return;
+ var i;
+ for (i=0; i < arr.length; i++)
+ {
+ var keyType = arr[i][0];
+ var keyID = arr[i][1];
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ if (keyStatus == "BLANK") {
+ updateKeyText('A ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ UserSelectRowByKeyID(keyType, keyID);
+ } else if (keyStatus == "UNINITIALIZED") {
+ updateKeyText('An ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ UserSelectRowByKeyID(keyType, keyID);
+ }
+ }
+
+ if (arr && arr.length <= 1 )
+ {
+ toggleButton('enrollbtn','off');
+ }
+}
+
+function UserOnCOOLKeyInserted(keyType, keyID)
+{
+ var arr = GetAvailableCOOLKeys();
+ if (arr && arr.length <= 1 )
+ {
+ toggleButton('enrollbtn','off');
+ }
+ if (arr && arr.length > 1 )
+ {
+ toggleButton('enrollbtn','on');
+ }
+
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ if (keyStatus == "ENROLLED" || keyStatus == "UNINITIALIZED") {
+ updateKeyText('An ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ } else {
+ updateKeyText('A ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ }
+ UserSelectRowByKeyID(keyType, keyID);
+}
+
+function UserOnCOOLKeyRemoved(keyType, keyID)
+{
+ updateKeyText('Please insert a blank smartcard now!');
+}
+
+function toggleAjaxProgress(id, i)
+{
+ var e = document.getElementById(id);
+ if (i == 'off') {
+ e.style.display = 'none';
+ } else {
+ e.style.display = 'block';
+ }
+}
+
+function toggleButton(id, i)
+{
+ var e = document.getElementById(id);
+ if (i == 'off') {
+ e.disabled = true;
+ } else {
+ e.disabled = false;
+ }
+}
+// -->
+</script>
+</head>
+
+<body onload="InitializeBindingTable();" onunload=cleanup()>
+
+<progressmeter id="progress-id" hidden="true" align = "center"/>
+
+<div id="pb" style="display:none;">
+ <table id="BindingTable" width="200px" align="center">
+ <tr id="HeaderRow">
+ </tr>
+ </table>
+</div>
+<div id="header">
+ <div id="logo">
+ <h3><img align=bottom src="/sow/images/badget.png">Security Officer Station</h3>
+ </div>
+</div>
+
+<div id="content">
+ <div id="maintext">
+ <div id="topmenu">
+ | <a href="/cgi-bin/sow/main.cgi">Main</a> |
+ </div>
+<br/>
+<blockquote>This will erase the home phone URL and format the user token.</blockquote>
+<h3><span id="keytext">Please insert new smartcard now!</span></h3>
+ <br/>
+ <table width="100%">
+ <tr>
+<td>
+<div id="ajax-pb" style="display:none;">
+ <img src="/sow/images/indicator.gif">
+</div>
+</td>
+ <td align="right">
+ <input type="button" id="enrollbtn" name="enrollbtn" value="Format" onClick="toggleButton('enrollbtn','off');toggleButton('cancel', 'off');toggleAjaxProgress('ajax-pb','on');DoFormatCOOLKey();">
+ <input type="submit" id="cancel" name="cancel" value="Cancel" onClick="javascript:location.href='/cgi-bin/sow/search.cgi';">
+ </td>
+ </tr>
+ </table>
+ </div>
+</div>
+</body></html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/sow/formatso.html b/pki/linux/tps-ui/shared/cgi-bin/sow/formatso.html
new file mode 100755
index 000000000..dcfae82d9
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/sow/formatso.html
@@ -0,0 +1,161 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/sow/style.css" type="text/css">
+
+<title>Enrollment</title>
+<script type="text/javascript" src="/sow/js/prototype.js"></script>
+<script type="text/javascript" src="/sow/js/scriptaculous.js?load=effects"></script>
+<script type="text/JavaScript" src="/sow/util.js"></script>
+<link rel="stylesheet" href="/sow/css/style.css" media="screen" type="text/css">
+<script type="text/javascript">
+<!--
+function UserOnCOOLKeyStateError()
+{
+ toggleAjaxProgress('ajax-pb', 'off');
+ toggleButton('enrollbtn', 'on');
+ toggleButton('cancel', 'on');
+}
+
+function UserOnCOOLKeyFormatComplete()
+{
+ toggleAjaxProgress('ajax-pb', 'off');
+ toggleButton('enrollbtn', 'on');
+ toggleButton('cancel', 'on');
+}
+
+function updateKeyText(text)
+{
+ var f = document.getElementById('keytext');
+ new Effect.Shake(f);
+ var text = document.createTextNode(text);
+ var len= f.childNodes.length;
+ for (i=0;i<len;i++){
+ f.removeChild(f.childNodes[0]);
+ }
+ f.appendChild(text);
+}
+
+function UserSelectRowByKeyID(keyType, keyID)
+{
+ DoCoolKeySetConfigValue("Operation-" + keyID,
+ "https://$host:$secure_port/nk_service");
+ DoCoolKeySetConfigValue("TokenType-" + keyID, "userKey");
+ SelectRowByKeyID(keyType, keyID);
+}
+
+function UserOnDoneInitializeBindingTable()
+{
+ // display existing blank smart
+ var arr = GetAvailableCOOLKeys();
+ if (!arr || arr.length < 1)
+ return;
+ var i;
+ for (i=0; i < arr.length; i++)
+ {
+ var keyType = arr[i][0];
+ var keyID = arr[i][1];
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ updateKeyText('A ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ UserSelectRowByKeyID(keyType, keyID);
+ }
+}
+
+function UserOnCOOLKeyInserted(keyType, keyID)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ if (keyStatus == "ENROLLED" || keyStatus == "UNINITIALIZED") {
+ updateKeyText('An ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ } else {
+ updateKeyText('A ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ }
+ UserSelectRowByKeyID(keyType, keyID);
+}
+
+function UserOnCOOLKeyRemoved(keyType, keyID)
+{
+ updateKeyText('Please insert a blank smartcard now!');
+}
+
+function toggleAjaxProgress(id, i)
+{
+ var e = document.getElementById(id);
+ if (i == 'off') {
+ e.style.display = 'none';
+ } else {
+ e.style.display = 'block';
+ }
+}
+
+function toggleButton(id, i)
+{
+ var e = document.getElementById(id);
+ if (i == 'off') {
+ e.disabled = true;
+ } else {
+ e.disabled = false;
+ }
+}
+// -->
+</script>
+</head>
+
+<body onload="InitializeBindingTable();" onunload=cleanup()>
+
+<progressmeter id="progress-id" hidden="true" align = "center"/>
+
+<div id="pb" style="display:none;">
+ <table id="BindingTable" width="200px" align="center">
+ <tr id="HeaderRow">
+ </tr>
+ </table>
+</div>
+<div id="header">
+ <div id="logo">
+ <h3><img align=bottom src="/sow/images/badget.png">Security Officer Station</h3>
+ </div>
+</div>
+
+<div id="content">
+ <div id="maintext">
+ <div id="topmenu">
+ | <a href="/cgi-bin/sow/main.cgi">Main</a> |
+ </div>
+<br/>
+<blockquote>This will erase the home phone URL and format the SO token, so that you can start the demonstration all over again. <br/><br/>WARNING: You will not be able to access the security officer station after this operation.</blockquote>
+<h3><span id="keytext">Please insert new smartcard now!</span></h3>
+ <br/>
+ <table width="100%">
+ <tr>
+<td>
+<div id="ajax-pb" style="display:none;">
+ <img src="/sow/images/indicator.gif">
+</div>
+</td>
+ <td align="right">
+ <input type="button" id="enrollbtn" name="enrollbtn" value="Format" onClick="toggleButton('enrollbtn','off');toggleButton('cancel', 'off');toggleAjaxProgress('ajax-pb','on');DoFormatSoCOOLKey();">
+ <input type="submit" id="cancel" name="cancel" value="Cancel" onClick="javascript:location.href='/cgi-bin/sow/search.cgi';">
+ </td>
+ </tr>
+ </table>
+ </div>
+</div>
+</body></html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/sow/main.html b/pki/linux/tps-ui/shared/cgi-bin/sow/main.html
new file mode 100755
index 000000000..c4e5fc081
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/sow/main.html
@@ -0,0 +1,68 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/sow/style.css" type="text/css">
+
+<title>Security Officer</title>
+<link rel="stylesheet" href="/sow/css/style.css" media="screen" type="text/css">
+</head>
+
+<body>
+
+<div id="header">
+ <div id="logo">
+ <h3><img align=bottom src="/sow/images/badget.png">Security Officer Station</h3>
+ </div>
+</div>
+
+<div id="content">
+ <div id="maintext">
+ <div id="topmenu">
+ | <a href="/cgi-bin/sow/main.cgi">Main</a> |
+ </div>
+ <blockquote><p>User Token Functions</p></blockquote>
+<ul style="font-size:1.2em;">
+ <a href="search.cgi">Enroll New Card</a> - enroll a new user smart card<br />
+ <a href="search_temp.cgi">Enroll Temporay Card</a> - enroll a temporary smart card<br />
+ <a href="format.cgi">Format Card</a> - format a user card<br />
+ <a href="seturl.cgi">Set Home URL</a> - set phone home URL to a user card<br />
+</ul>
+ <blockquote><p>Misc Functions</p></blockquote>
+<ul style="font-size:1.2em;">
+ <a href="formatso.cgi">Format SO Card</a> - format a SO card<br />
+</ul>
+
+ <br/>
+<font color="red">$error</font>
+ <br/>
+ <table width="100%">
+ <tr>
+ <td align="right">
+ </td>
+ </tr>
+ </table>
+</form>
+
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/sow/noaccess.html b/pki/linux/tps-ui/shared/cgi-bin/sow/noaccess.html
new file mode 100755
index 000000000..1a315019b
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/sow/noaccess.html
@@ -0,0 +1,64 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/sow/style.css" type="text/css">
+
+<title>Security Officer</title>
+<link rel="stylesheet" href="/sow/css/style.css" media="screen" type="text/css">
+</head>
+
+<body>
+
+<div id="header">
+ <div id="logo">
+ <h3><img align=bottom src="/sow/images/badget.png">Security Officer Station</h3>
+ </div>
+</div>
+
+<div id="content">
+ <div id="maintext">
+ <div id="topmenu">
+ </div>
+ <blockquote><p>Sorry, you do not have permission to perform the requested operation.</p></blockquote>
+<form method=post action="http://$host:$port/cgi-bin/sow/welcome.cgi">
+ <table>
+ <tr>
+ </tr>
+
+ </table>
+
+ <br/>
+<font color="red">$error</font>
+ <br/>
+ <table width="100%">
+ <tr>
+ <td align="right">
+ <input type="submit" id="search" name="search" value="Start Over">
+ </td>
+ </tr>
+ </table>
+</form>
+
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/sow/read.html b/pki/linux/tps-ui/shared/cgi-bin/sow/read.html
new file mode 100755
index 000000000..640053364
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/sow/read.html
@@ -0,0 +1,79 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/sow/style.css" type="text/css">
+
+<title>Security Officer</title>
+<script type="text/javascript" src="/sow/js/prototype.js"></script>
+<script type="text/javascript" src="/sow/js/scriptaculous.js?load=effects"></script>
+<link rel="stylesheet" href="/sow/css/style.css" media="screen" type="text/css">
+</head>
+
+<body>
+
+<div id="header">
+ <div id="logo">
+ <h3><img align=bottom src="/sow/images/badget.png">Security Officer Station</h3>
+ </div>
+</div>
+
+<div id="content">
+ <div id="maintext">
+ <div id="topmenu">
+ | <a href="/cgi-bin/sow/main.cgi">Main</a> |
+ </div>
+ <blockquote><p>Please check user's identification and verify the user information. If the information is correct, please insert a new smart card and continue.</p></blockquote>
+ <table>
+ <tr>
+ <td>
+<script type="text/javascript">
+ if ('$departmentNumber' != '') {
+ document.writeln('<img alt="" border=0 src="$photoSmall">');
+ }
+</script>
+ </td>
+ <td>
+ <span class="heading">UID:</span> $uid<br/>
+ <span class="heading">Given Name:</span> $givenName<br/>
+ <span class="heading">Last Name:</span> $sn<br/>
+ <span class="heading">Email:</span>$mail<br/>
+ <span class="heading">Height:</span> $height<br/>
+ <span class="heading">Weight:</span> $weight<br/>
+ <span class="heading">Eye Color:</span> $eyecolor<br/>
+ </td>
+ </table>
+ <br/>
+
+ <form method=post action="enroll.cgi">
+ <input type=hidden name=uid value="$uid">
+ <table width="100%">
+ <tr>
+ <td align="right">
+ <input type="submit" id="search" name="Enroll" value="Continue">
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/sow/read_temp.html b/pki/linux/tps-ui/shared/cgi-bin/sow/read_temp.html
new file mode 100755
index 000000000..640053364
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/sow/read_temp.html
@@ -0,0 +1,79 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/sow/style.css" type="text/css">
+
+<title>Security Officer</title>
+<script type="text/javascript" src="/sow/js/prototype.js"></script>
+<script type="text/javascript" src="/sow/js/scriptaculous.js?load=effects"></script>
+<link rel="stylesheet" href="/sow/css/style.css" media="screen" type="text/css">
+</head>
+
+<body>
+
+<div id="header">
+ <div id="logo">
+ <h3><img align=bottom src="/sow/images/badget.png">Security Officer Station</h3>
+ </div>
+</div>
+
+<div id="content">
+ <div id="maintext">
+ <div id="topmenu">
+ | <a href="/cgi-bin/sow/main.cgi">Main</a> |
+ </div>
+ <blockquote><p>Please check user's identification and verify the user information. If the information is correct, please insert a new smart card and continue.</p></blockquote>
+ <table>
+ <tr>
+ <td>
+<script type="text/javascript">
+ if ('$departmentNumber' != '') {
+ document.writeln('<img alt="" border=0 src="$photoSmall">');
+ }
+</script>
+ </td>
+ <td>
+ <span class="heading">UID:</span> $uid<br/>
+ <span class="heading">Given Name:</span> $givenName<br/>
+ <span class="heading">Last Name:</span> $sn<br/>
+ <span class="heading">Email:</span>$mail<br/>
+ <span class="heading">Height:</span> $height<br/>
+ <span class="heading">Weight:</span> $weight<br/>
+ <span class="heading">Eye Color:</span> $eyecolor<br/>
+ </td>
+ </table>
+ <br/>
+
+ <form method=post action="enroll.cgi">
+ <input type=hidden name=uid value="$uid">
+ <table width="100%">
+ <tr>
+ <td align="right">
+ <input type="submit" id="search" name="Enroll" value="Continue">
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/sow/search.html b/pki/linux/tps-ui/shared/cgi-bin/sow/search.html
new file mode 100755
index 000000000..b0d00f350
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/sow/search.html
@@ -0,0 +1,72 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/sow/style.css" type="text/css">
+
+<title>Security Officer</title>
+<link rel="stylesheet" href="/sow/css/style.css" media="screen" type="text/css">
+</head>
+
+<body>
+
+<div id="header">
+ <div id="logo">
+ <h3><img align=bottom src="/sow/images/badget.png">Security Officer Station</h3>
+ </div>
+</div>
+
+<div id="content">
+ <div id="maintext">
+ <div id="topmenu">
+ | <a href="/cgi-bin/sow/main.cgi">Main</a> |
+ </div>
+ <blockquote><p>Please locate the user who is requesting for a new smart card.</p></blockquote>
+<form method=post action="read.cgi">
+<div style="font-size:0.8em;">
+ <table>
+ <tr>
+ <td><h3>Name: </h3></td>
+ <td> </td>
+ <td><input type="text" id="name" name="name" value="" autocomplete="off"></td>
+ <input type="hidden" id="name_hidden" name="name_ID"><!-- THE ID OF the country will be inserted into this hidden input --></td>
+ <td> </td>
+ </tr>
+
+ </table>
+</div>
+
+ <br/>
+<font color="red">$error</font>
+ <br/>
+ <table width="100%">
+ <tr>
+ <td align="right">
+ <input type="submit" id="search" name="search" value="Continue">
+ </td>
+ </tr>
+ </table>
+</form>
+
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/sow/search_temp.html b/pki/linux/tps-ui/shared/cgi-bin/sow/search_temp.html
new file mode 100755
index 000000000..6f9b6d1d8
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/sow/search_temp.html
@@ -0,0 +1,72 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/sow/style.css" type="text/css">
+
+<title>Security Officer</title>
+<link rel="stylesheet" href="/sow/css/style.css" media="screen" type="text/css">
+</head>
+
+<body>
+
+<div id="header">
+ <div id="logo">
+ <h3><img align=bottom src="/sow/images/badget.png">Security Officer Station</h3>
+ </div>
+</div>
+
+<div id="content">
+ <div id="maintext">
+ <div id="topmenu">
+ | <a href="/cgi-bin/sow/main.cgi">Main</a> |
+ </div>
+ <blockquote><p>Please locate the user who is requesting for a temporary smart card.</p></blockquote>
+<form method=post action="read_temp.cgi">
+<div style="font-size:0.8em;">
+ <table>
+ <tr>
+ <td><h3>Name: </h3></td>
+ <td> </td>
+ <td><input type="text" id="name" name="name" value="" autocomplete="off"></td>
+ <input type="hidden" id="name_hidden" name="name_ID"><!-- THE ID OF the country will be inserted into this hidden input --></td>
+ <td> </td>
+ </tr>
+
+ </table>
+</div>
+
+ <br/>
+<font color="red">$error</font>
+ <br/>
+ <table width="100%">
+ <tr>
+ <td align="right">
+ <input type="submit" id="search" name="search" value="Continue">
+ </td>
+ </tr>
+ </table>
+</form>
+
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/sow/seturl.html b/pki/linux/tps-ui/shared/cgi-bin/sow/seturl.html
new file mode 100755
index 000000000..91ece7d6f
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/sow/seturl.html
@@ -0,0 +1,166 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/sow/style.css" type="text/css">
+
+<title>Enrollment</title>
+<script type="text/javascript" src="/sow/js/prototype.js"></script>
+<script type="text/javascript" src="/sow/js/scriptaculous.js?load=effects"></script>
+<script type="text/JavaScript" src="/sow/util.js"></script>
+<link rel="stylesheet" href="/sow/css/style.css" media="screen" type="text/css">
+<script type="text/javascript">
+<!--
+function UserOnCOOLKeyStateError()
+{
+ toggleAjaxProgress('ajax-pb', 'off');
+ toggleButton('enrollbtn', 'on');
+ toggleButton('cancel', 'on');
+}
+
+function UserOnCOOLKeyFormatComplete()
+{
+ toggleAjaxProgress('ajax-pb', 'off');
+ toggleButton('enrollbtn', 'on');
+ toggleButton('cancel', 'on');
+}
+
+function updateKeyText(text)
+{
+ var f = document.getElementById('keytext');
+ new Effect.Shake(f);
+ var text = document.createTextNode(text);
+ var len= f.childNodes.length;
+ for (i=0;i<len;i++){
+ f.removeChild(f.childNodes[0]);
+ }
+ f.appendChild(text);
+}
+
+function UserSelectRowByKeyID(keyType, keyID)
+{
+ DoCoolKeySetConfigValue("Operation-" + keyID,
+ "https://$host:$secure_port/nk_service");
+ DoCoolKeySetConfigValue("TokenType-" + keyID, "userKey");
+ SelectRowByKeyID(keyType, keyID);
+}
+
+function UserOnDoneInitializeBindingTable()
+{
+ // display existing blank smart
+ var arr = GetAvailableCOOLKeys();
+ if (!arr || arr.length < 1)
+ return;
+ var i;
+ for (i=0; i < arr.length; i++)
+ {
+ var keyType = arr[i][0];
+ var keyID = arr[i][1];
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ if (keyStatus == "BLANK") {
+ updateKeyText('A ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ UserSelectRowByKeyID(keyType, keyID);
+ } else if (keyStatus == "UNINITIALIZED") {
+ updateKeyText('An ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ UserSelectRowByKeyID(keyType, keyID);
+ }
+ }
+}
+
+function UserOnCOOLKeyInserted(keyType, keyID)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ if (keyStatus == "ENROLLED" || keyStatus == "UNINITIALIZED") {
+ updateKeyText('An ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ } else {
+ updateKeyText('A ' + keyStatus + ' smartcard "' + keyID + '" is detected!');
+ }
+ UserSelectRowByKeyID(keyType, keyID);
+}
+
+function UserOnCOOLKeyRemoved(keyType, keyID)
+{
+ updateKeyText('Please insert a blank smartcard now!');
+}
+
+function toggleAjaxProgress(id, i)
+{
+ var e = document.getElementById(id);
+ if (i == 'off') {
+ e.style.display = 'none';
+ } else {
+ e.style.display = 'block';
+ }
+}
+
+function toggleButton(id, i)
+{
+ var e = document.getElementById(id);
+ if (i == 'off') {
+ e.disabled = true;
+ } else {
+ e.disabled = false;
+ }
+}
+// -->
+</script>
+</head>
+
+<body onload="InitializeBindingTable();" onunload=cleanup()>
+
+<progressmeter id="progress-id" hidden="true" align = "center"/>
+
+<div id="pb" style="display:none;">
+ <table id="BindingTable" width="200px" align="center">
+ <tr id="HeaderRow">
+ </tr>
+ </table>
+</div>
+<div id="header">
+ <div id="logo">
+ <h3><img align=bottom src="/sow/images/badget.png">Security Officer Station</h3>
+ </div>
+</div>
+
+<div id="content">
+ <div id="maintext">
+ <div id="topmenu">
+ | <a href="/cgi-bin/sow/main.cgi">Main</a> |
+ </div>
+<br/>
+<blockquote>This will burn a home phone URL on the user token.</blockquote>
+<h3><span id="keytext">Please insert new smartcard now!</span></h3>
+ <br/>
+ <table width="100%">
+ <tr>
+<td>
+<div id="ajax-pb" style="display:none;">
+ <img src="/sow/images/indicator.gif">
+</div>
+</td>
+ <td align="right">
+ <input type="button" id="enrollbtn" name="enrollbtn" value="Format" onClick="toggleButton('enrollbtn','off');toggleButton('cancel', 'off');toggleAjaxProgress('ajax-pb','on');DoSetURLCOOLKey();">
+ <input type="submit" id="cancel" name="cancel" value="Cancel" onClick="javascript:location.href='/cgi-bin/sow/search.cgi';">
+ </td>
+ </tr>
+ </table>
+ </div>
+</div>
+</body></html>
diff --git a/pki/linux/tps-ui/shared/cgi-bin/sow/welcome.html b/pki/linux/tps-ui/shared/cgi-bin/sow/welcome.html
new file mode 100755
index 000000000..1ede1edbf
--- /dev/null
+++ b/pki/linux/tps-ui/shared/cgi-bin/sow/welcome.html
@@ -0,0 +1,64 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="/sow/style.css" type="text/css">
+
+<title>Security Officer</title>
+<link rel="stylesheet" href="/sow/css/style.css" media="screen" type="text/css">
+</head>
+
+<body>
+
+<div id="header">
+ <div id="logo">
+ <h3><img align=bottom src="/sow/images/badget.png">Security Officer Station</h3>
+ </div>
+</div>
+
+<div id="content">
+ <div id="maintext">
+ <div id="topmenu">
+ </div>
+ <blockquote><p>Welcome to the security officer interface, you will be asked to identify yourself with your token. Please click the continue button below.</p></blockquote>
+<form method=post action="https://$host:$secure_port/cgi-bin/sow/main.cgi">
+ <table>
+ <tr>
+ </tr>
+
+ </table>
+
+ <br/>
+<font color="red">$error</font>
+ <br/>
+ <table width="100%">
+ <tr>
+ <td align="right">
+ <input type="submit" id="search" name="search" value="Continue">
+ </td>
+ </tr>
+ </table>
+</form>
+
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/docroot/css/pki-360.css b/pki/linux/tps-ui/shared/docroot/css/pki-360.css
new file mode 100644
index 000000000..ac94e691b
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/css/pki-360.css
@@ -0,0 +1,922 @@
+/* --- BEGIN COPYRIGHT BLOCK ---
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; 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 ---
+ */
+
+/*
+color scheme:
+
+light gray: #e6e6e6
+medium gray:
+dark gray:
+
+link blue: #06c
+
+red: #900
+
+*/
+
+
+/* This establishes background pattern and centering of content area as well
+as font-styles for the site */
+body {
+ margin: 0;
+ padding: 0;
+ color: #333;
+ text-align: center;
+ background: #fff url(/img/bkgrnd_greydots.png) repeat;
+ font-family: "Luxi Sans", "Bitstream Vera Sans", "Lucida Grande", "Trebuchet MS", helvetica, verdana, arial, sans-serif;
+ }
+
+td, th { /* for ie55 */
+ font-size: x-small;
+ /* false value for WinIE4/5 */
+ voice-family: "\"}\"";
+ /* trick WinIE4/5 into thinking rule is over */
+ voice-family: inherit;
+ /* recover from trick */
+ font-size: small;
+ /* intended value for better browsers */
+ }
+
+img {
+ border: 0;
+ }
+
+a {
+ text-decoration: none;
+ }
+
+a:link {
+ color: #06c;
+ }
+
+a:visited {
+ color: #06c;
+ }
+
+/* This is the container for the content that is centered */
+#wrap {
+ margin: 0 20px 10px 20px;
+ padding: 10px 15px;
+ text-align: left;
+ background: #fff;
+/*
+ min-width: 900px;
+*/
+ }
+
+/* The following styles establish the header, top nav bar and systems and
+search areas */
+#header {
+ height: 31px; /* changed height added bottom margin */
+ margin-bottom: 10px;
+ }
+
+img#myLogo {
+ float: left;
+ margin-left: 15px;
+ }
+
+img#pkiLogo {
+ float: left;
+ }
+
+#account {
+ float: right;
+ width: 450px;
+ margin-right: 15px;
+ padding-top: 7px; /* removed margin-bottom, added padding-top */
+ }
+
+#account dl {
+ float: right;
+ padding: 0;
+ margin: 0;
+ }
+
+#account dt {
+ float: left;
+ width: 66px;
+ height: 1.1em;
+ background: url(/img/account_loggedin.gif) 100% 100% no-repeat;
+ }
+
+#account dd { /* note changes to dl, dt and dd */
+ float: left;
+ margin-left: 10px;
+ }
+
+#account p {
+ float: right;
+ margin: 0 0 0 30px;
+ padding: 0;
+ }
+
+#account p a {
+ width: 56px;
+ height: 1.1em;
+ background: url(/img/account_signout.gif) 100% 100% no-repeat;
+ display: block;
+ }
+
+#account span {
+ display: none;
+ }
+
+#bar {
+ margin-bottom: 10px;
+ background-color: #e6e6e6
+ }
+
+#bar:after {
+ content: ".";
+ display: block;
+ height: 0px; /* took out negative margin and set height to 0 */
+ overflow: hidden;
+ clear: both;
+ visibility: hidden;
+ }
+
+ /* Holly Hack Targets IE Win only \*/
+ * html #bar {height: 1%;}
+ /* End Holly Hack */
+
+#systembar {
+ float: right;
+ width: 34%;
+ background: #e6e6e6 url(/img/greybar_tr.gif) 100% 0 no-repeat;
+ }
+
+#systembarinner {
+ background: url(/img/greybar_br.gif) 100% 100% no-repeat;
+ height: 2.8em;
+ /* text-align: center; */
+ text-align: right;
+ padding-right: 10px;
+ }
+
+#systembarinner div {
+ color: #000;
+ font-variant: small-caps;
+ padding-top: 5px;
+ }
+
+#searchbar {
+ float: left;
+ width: 66%;
+ background: #e6e6e6 url(/img/greybar_tl.gif) 0 0 no-repeat;
+ }
+
+#searchbarinner {
+ padding-left: 10px;
+ background: url(/img/greybar_bl.gif) 0 100% no-repeat;
+ height: 2.8em;
+ /*
+ text-align: left;
+ text-align: center;
+ */
+ text-align: right;
+
+ }
+
+#systembarinner form,
+#searchbarinner form {
+ margin: 0;
+ padding-top: 5px; /* changed to padding-top: 5px */
+ /*text-align: center;*/
+ }
+/* end header */
+
+/* The following styles establish the new side nav bar */
+#sidenav { /* for ie55 */
+ width: 132px;
+ background-color: #999;
+ background-image: url(/img/corner_sidenav_top.gif);
+ background-position: top right;
+ background-repeat: no-repeat;
+ font-family: "Luxi Sans", verdana, arial, sans-serif;
+ font-size: xx-small;
+ /* false value for WinIE4/5 */
+ voice-family: "\"}\"";
+ /* trick WinIE4/5 into thinking rule is over */
+ voice-family: inherit;
+ /* recover from trick */
+ font-size: x-small;
+ /* intended value for better browsers */
+ font-weight: bold;
+ }
+
+
+#sidenav ul {
+ background-image: url(/img/corner_sidenav_bottom.gif);
+ background-position: bottom left;
+ background-repeat: no-repeat;
+ list-style: none;
+ padding: 10px 0 10px 0;
+ margin: 0;
+ }
+
+#sidenav ul ul {
+ background: none;
+ /* background-color: #c1c1c1; */
+ background-color: #ccc;
+ margin: 0;
+ padding: 0;
+ border-top: 1px solid #999;
+ }
+
+#sidenav ul li {
+ border-bottom: 1px solid #a7a7a7;
+ margin: 0;
+ }
+
+#sidenav ul li:last-child {
+ border-bottom: 1px solid #999;
+ }
+
+#sidenav ul li.sidenav-selected {
+ /*
+ background: #8a8a8a;
+ background: #7b7b7b;
+ */
+ background: #6c6c6c;
+ /* border-top: 1px solid #999; */
+ }
+
+#sidenav ul li.sidenav-selected span {
+ display: none;
+ }
+
+#sidenav ul li a {
+ display: block;
+ color: white;
+ text-decoration: none;
+ padding: 3px 5px 3px 15px;
+ margin: 0;
+ }
+
+#sidenav ul ul li.sidenav-selected {
+ background: #6c6c6c;
+ /* background: #7b7b7b;
+ background: #8a8a8a;
+ */
+ }
+
+
+#sidenav ul ul li:last-child {
+ border-bottom: none;
+ }
+
+#sidenav ul ul li a {
+ padding-left: 30px;
+ color: #555;
+ }
+
+#sidenav ul ul li.sidenav-selected a {
+ padding-left: 30px;
+ color: white;
+ }
+
+
+#content {
+ clear: both;
+ }
+
+/* The following styles establish the legend boxes in the left sidebar */
+.sideleg {
+ width: 132px;
+ background: url(/img/sidelegend_top.gif) 0 0 no-repeat;
+ padding-top: 9px;
+ margin-top: 1em;
+ }
+
+
+.sideleg h2 {
+ font-size: x-small;
+ color: #666;
+ border: 1px solid #acacac;
+ border-top: none;
+ padding: 0 0 3px 15px;
+ margin: 0;
+ }
+
+.sideleg ul {
+ padding: 0 0 9px 0 ;
+ margin: 0;
+ list-style: none;
+ background: url(/img/sidelegend_bottom.gif) 0 100% no-repeat;
+ }
+
+.sideleg ul li {
+ padding: 12px 0 6px 15px;
+ font-size: x-small;
+ color: #666;
+ border-left: 1px solid #acacac;
+ border-right: 1px solid #acacac; /* removed clear:left */
+ }
+
+.sideleg ul li img {
+ float: left;
+ padding-right: 3px;
+ margin-top: -3px;
+ }
+
+h1 {
+ margin-top: 0;
+ }
+
+/* existing PKI STYLES - modded - these need to be inserted carefully */
+
+.sidebar {
+ padding-right: 15px;
+ vertical-align: top;
+}
+
+table.iso_dl {
+ border-collapse: collapse;
+}
+
+table.iso_dl td {
+ padding: 4px;
+}
+
+table.iso_dl th {
+ color: #999;
+ background-color: #eee;
+ border: 1px solid #999;
+ padding: 6px 3px;
+ text-align: right;
+}
+
+table.iso_dl th.first {
+ text-align: left;
+}
+
+th {
+ padding: 4px 6px;
+ color: #fff;
+ /* background-color: #b4b19a; */
+ text-align: left;
+ font-size: small;
+}
+
+
+/* -- YOUR PKI stuff -- */
+table.half-table {
+ background: #b4b19a url(/img/table_corner_tr.gif) 100% 0 no-repeat;
+ padding: 0px;
+ margin: 0px;
+ }
+
+.half-table td {
+ background-color: #fff;
+}
+
+table.your-pki table.half-table td {
+ padding: 2px 8px;
+}
+
+table.your-pki table.full-table td {
+ padding-left: 4px;
+ padding-right: 4px;
+ padding-top: 4px;
+}
+
+table.half-table thead th:first-child {
+ background: url(/img/table_corner_tl.gif) top left no-repeat;
+ }
+
+
+
+
+/* -- General list stuff -- */
+table.list {
+ font-size: 10px;
+ background: #b4b19a url(/img/table_corner_tr.gif) top right no-repeat;
+ border-bottom: 1px solid #b4b19a;
+}
+
+/* Holly Hack Targets IE Win only \*/
+ * html table.list, * html table.half-table {background-image: none;}
+ /* End Holly Hack */
+
+
+
+table.list thead th:first-child {
+ background: url(/img/table_corner_tl.gif) top left no-repeat;
+ }
+
+table.list-pagination {
+ font-size: smaller;
+}
+
+
+td.first-column {
+ border-left: 1px solid #b4b19a;
+}
+
+td.last-column {
+ border-right: 1px solid #b4b19a;
+}
+
+td.only-column {
+ border-right: 1px solid #b4b19a;
+ border-left: 1px solid #b4b19a;
+}
+
+
+.list-checkbox {
+ text-align: center;
+ border-left: 1px solid #b4b19a;
+}
+
+.list-checkbox-header {
+ text-align: center;
+}
+
+.list th a {
+ display: inline;
+ }
+
+.list a:hover {
+ text-decoration: underline;
+}
+
+/* list row classes */
+.list-row-even td{
+ background-color: #F1EBDC;
+}
+.list-row-odd td {
+ background-color: #ffffff;
+}
+.list-row-summary {
+ text-align: right;
+ font-weight: bold;
+ border: 1px solid #ccc;
+ background-color: #eee;
+}
+.list-row-even td, .list-row-odd td, .list-row-summary td {
+ padding: 4px 8px;
+}
+
+.list-horiz-separator hr {
+ border: 0;
+ border-bottom: 1px solid #ccc;
+ padding: 0px;
+}
+
+
+/* default class def for row color toggling */
+.list-row-even-selected {
+ background-color: #dde5ff;
+}
+.list-row-odd-selected {
+ background-color: #dde5ff;
+}
+
+.list-row-odd-selected td, .list-row-even-selected td {
+ border-bottom: 1px solid #ccc;
+ padding: 4px 8px;
+}
+
+/* special column classes */
+th + th {
+ border-left: 0;
+}
+a[name]:hover {
+ color: inherit;
+}
+
+
+
+
+/* --- TABLE TREE VIEW --- */
+tr.table-tree-even td, tr.table-tree-odd td {
+ padding: 10px 15px;
+}
+tr.table-tree-even img,
+tr.table-tree-odd img {
+ margin-left: 4px;
+}
+tr.table-tree-odd {
+ background-color: #F1EBDC;
+}
+tr.table-tree-even {
+ background-color: #fff;
+}
+
+/* padding for parent+child channels */
+tr.table-tree-even + tr.table-tree-even td,
+tr.table-tree-odd + tr.table-tree-odd td {
+ padding-top: 0;
+}
+
+
+
+
+/* signin page stuff start */
+#footer {
+ /*
+ border-top: 2px dotted #ccc;
+ padding: 2em 4em 2em 4em;
+ */
+ padding: 1em;
+ margin: 1em 4em 1em 4em;
+ text-align: center;
+ font-size: 10px;
+ color: #aaa;
+
+ margin-left: auto;
+ margin-right: auto;
+ margin-top: 64px;
+}
+
+h1#pki_welcome {
+ background-image: url(/img/pki_welcome.gif);
+ background-position: 0 0;
+ background-repeat: no-repeat;
+ padding-bottom: 5px;
+ height: 20px;
+ }
+
+h1#pki_welcome2 {
+ background-image: url(/img/pki_welcome2.gif);
+ background-position: 0 0;
+ background-repeat: no-repeat;
+ height: 37px;
+ }
+
+h1#pki_welcome3 {
+ background-image: url(/img/pki_welcome3.gif);
+ background-position: 0 0;
+ background-repeat: no-repeat;
+ height: 40px;
+ }
+
+h1#pki_welcome span {
+ display: none;
+ }
+
+h1#pki_welcome2 span {
+ display: none;
+ }
+
+h1#pki_welcome3 span {
+ display: none;
+ }
+
+ul.linkage {
+ list-style: none;
+ padding: 8px;
+ margin: 0px;
+ }
+
+ul.linkage li{
+ background-image: url(/img/bullet_arrowblue.png);
+ background-repeat: no-repeat;
+ background-position: 0 .4em;
+ padding-left: 10px;
+ margin: .4em 0;
+ }
+
+#contentLeft {
+ float: left;
+ margin-top: 20px;
+}
+
+#contentRight {
+ margin: 0 15px 0 295px;
+}
+
+ /**** following styles define the CLEAR BOX W/ROUNDED CORNERS */
+
+ .clearBox {
+ width: 279px;
+ background: url(/img/corner_halflinebox_top.png) top right no-repeat;
+ }
+
+ .clearBox {
+ padding-top: 7px;
+ margin-bottom: 15px;
+ }
+
+ .clearBoxInner {
+ background: url(/img/corner_halflinebox_bottom.png) bottom left no-repeat;
+ }
+
+ .clearBoxInner {
+ width: 100%;
+ padding-bottom: 7px;
+ }
+
+ .clearBoxBody {
+ padding: 5px 14px;
+ border-left: 1px solid #b4b4b4;
+ border-right: 1px solid #b4b4b4;
+ }
+
+ .clearBoxBody h2 {
+ font-size: small;
+ }
+
+div.formrow {
+ padding: 5px 0;
+ font-size: x-small;
+ }
+
+div.formrow:after {
+ content: ".";
+ display: block;
+ height: 0;
+ overflow: hidden;
+ clear: right;
+ visibility: hidden;
+ }
+
+ /* Holly Hack Targets IE Win only \*/
+ * html .formrow {height: 1%;}
+ /* End Holly Hack */
+
+div.formrow span.label {
+ float: left;
+ width: 110px;
+ text-align: right;
+ font-weight: bold;
+ padding: .5em 0;
+ }
+
+div.formrow span.formfield {
+ float: right;
+ width: 130px;
+ text-align: left;
+ }
+
+p#intro {
+ font-size: 1.3em;
+ line-height: 1.2em;
+ color: #000;
+ }
+
+p.endnote {
+ font-size: smaller;
+ margin-top: 3em;
+ padding-top: 10px;
+ line-height: 1.5em;
+ border-top: 1px solid #333;
+ }
+
+
+/* CONTENT-NAV - begin */
+
+.content-nav {
+ margin: 0;
+ padding: 0;
+}
+
+.content-nav a:visited {
+ color: #06c;
+}
+
+.content-nav ul {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ font-size: 10px;
+ font-family: "Luxi Sans", verdana, arial, sans-serif;
+ }
+
+.content-nav:after,
+.content-nav ul:after {
+ content: ".";
+ display: block;
+ height: 1px;
+ margin-top: -1px;
+ overflow: hidden;
+ clear: both;
+ visibility: hidden;
+ }
+
+/* Holly Hack Targets IE Win only */
+* html .content-nav {height: 1%;}
+* html .content-nav ul {height: 1%;}
+/* End Holly Hack */
+
+ul.content-nav-rowone,
+ul.content-nav-rowthree {
+ margin-left: 10px;
+ }
+
+ul.content-nav-rowone {
+ border-bottom: 3px solid #e6e6e6;
+ margin-bottom: -3px;
+ }
+
+/* Holly Hack Targets IE Win only \*/
+* html ul.content-nav-rowone {margin-right: 8px;}
+* html ul.content-nav-rowone {margin-bottom: -2px;}
+/* End Holly Hack */
+
+ul.content-nav-rowone li, ul.content-nav-rowthree li {
+ float: left;
+ }
+
+ul.content-nav-rowone li a, ul.content-nav-rowthree li a {
+ display: block;
+ padding: 4px 8px;
+ }
+
+ul.content-nav-rowtwo {
+ background: url(/img/contentnav_rowtwo_b.gif) bottom left no-repeat;
+ padding-bottom: 6px;
+ margin-right: 8px;
+ }
+
+ul.content-nav-rowtwo li {
+ display: inline;
+ padding-left: 18px;
+ }
+
+a.content-nav-selected-link {
+ color: #000;
+ font-weight: bold;
+ }
+
+ul.content-nav-rowone li.content-nav-selected {
+ background: url(/img/contentnav_tabr.gif) top right no-repeat;
+ }
+
+ul.content-nav-rowone a.content-nav-selected-link {
+ background: url(/img/contentnav_tabl.gif) top left no-repeat;
+ }
+
+ul.content-nav-rowthree li.content-nav-selected {
+ background: url(/img/contentnav_tabr.gif) bottom right no-repeat;
+ }
+
+ul.content-nav-rowthree a.content-nav-selected-link {
+ background: url(/img/contentnav_tabl.gif) bottom left no-repeat;
+ }
+
+div.contentnav-row2 {
+ background: #e6e6e6 url(/img/contentnav_rowtwo_t.gif) top left no-repeat;
+ padding: 0px;
+ clear: left;
+ }
+
+div.contentnav-row2 div.top {
+ background: url(/img/contentnav_rowtwo_t.gif) top right no-repeat;
+ margin-left: 8px;
+ height: 6px;
+ font-size: 0;
+ }
+
+div.contentnav-row2 div.bottom {
+ background: url(/img/contentnav_rowtwo_b.gif) bottom right no-repeat;
+ }
+
+/* CONTENTNAV - end */
+
+
+
+
+/************************************************************** MAIN NAVIGATION */
+
+#mainNavOuter {
+ width: 100%;
+ background-image: url(/img/corner_mainnav_bottom_chopped.png);
+ background-position: bottom right;
+ background-repeat: no-repeat;
+ background-color: #c00;
+ }
+
+#mainNav {
+ width: 100%;
+ font-weight: bold;
+ font-family: "Luxi Sans", verdana, helvetica, arial, sans-serif;
+ font-size: x-small;
+ }
+
+
+/* float clear hack that has been hacked for Moz 1.5x and below */
+#mainNavOuter:after {
+ content: ".";
+ display: block;
+ height: 1px;
+ margin-top: -1px;
+ overflow: hidden;
+ clear: both;
+ visibility: hidden;
+ }
+ /* Holly Hack Targets IE Win only \*/
+ * html .mainNavOuter {height: 1%;}
+ /* End Holly Hack */
+
+
+#mainNavInner {
+ width: 100%;
+ height: 7px;
+ background-image: url(/img/corner_mainnav_top_chopped.png);
+ background-position: top right;
+ background-repeat: no-repeat;
+ }
+
+#mainNav ul {
+ padding: 0;
+ margin: 0;
+ list-style-type: none;
+ background-image: url(/img/corner_mainnav_tl.png);
+ background-position: top left;
+ background-repeat: no-repeat;
+ }
+
+#mainNav ul li {
+ background: #b70000;
+ display: block;
+ float: left;
+ padding: 0;
+ margin: 0;
+ }
+
+#mainNav li#mainFirst-active,
+#mainNav li#main-active,
+#mainNav li#mainLast-active {
+ background-color: #800000;
+ }
+
+
+/* special casing for left-most top tab */
+#mainNav ul li a.mainFirstLink {
+ background-image: url(/img/corner_mainnav_tl.png);
+ background-position: top left;
+ background-repeat: no-repeat;
+ }
+
+#mainNav li#mainFirst-active a.mainFirstLink {
+ background-image: url(/img/corner_mainnav_tl_hi.png);
+ background-position: top left;
+ background-repeat: no-repeat;
+ }
+
+#mainNav ul li#mainFirst {
+ background-image: url(/img/corner_mainnav_bl.png);
+ background-position: bottom left;
+ background-repeat: no-repeat;
+ }
+
+#mainNav li#mainFirst-active {
+ background-image: url(/img/corner_mainnav_bl_hi.png);
+ background-position: bottom left;
+ background-repeat: no-repeat;
+ }
+
+/* special casing for right-most top tab */
+#mainNav ul li a.mainLastLink {
+ background-image: url(/img/corner_mainnav_tr.png);
+ background-position: top right;
+ background-repeat: no-repeat;
+ }
+
+#mainNav li#mainLast-active a.mainLastLink {
+ background-image: url(/img/corner_mainnav_tr_hi.png);
+ background-position: top right;
+ background-repeat: no-repeat;
+ }
+
+#mainNav ul li#mainLast {
+ background-image: url(/img/corner_mainnav_br.png);
+ background-position: bottom right;
+ background-repeat: no-repeat;
+ }
+
+#mainNav li#mainLast-active {
+ background-image: url(/img/corner_mainnav_br_hi.png);
+ background-position: bottom right;
+ background-repeat: no-repeat;
+ }
+
+#mainNav ul li a {
+ display: block;
+ float: left;
+ text-decoration: none;
+ color: #fff;
+ padding: 5px 15px;
+ font-size: 11px;
+ text-decoration: none !important;
+ }
+
diff --git a/pki/linux/tps-ui/shared/docroot/css/pki-base.css b/pki/linux/tps-ui/shared/docroot/css/pki-base.css
new file mode 100644
index 000000000..f752e84b1
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/css/pki-base.css
@@ -0,0 +1,214 @@
+/* --- BEGIN COPYRIGHT BLOCK ---
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; 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 ---
+ */
+
+@import url("pki.css");
+@import url("pki-360.css");
+
+/* The following styles are for ALL browsers, including Netscape
+ Navigator 4.x. Put more detailed CSS in pki.css. */
+
+
+/* from rob byers */
+
+/* This establishes background pattern and centering of content area as well
+as font-styles for the site */
+body {
+ margin: 0;
+ padding: 0;
+ color: #333;
+ text-align: center;
+ font-family: "Luxi Sans", "Bitstream Vera Sans", "Lucida Grande", "Trebuchet MS", helvetica, verdana, arial, sans-serif;
+ font-size: small;
+ }
+
+img {
+ border: 0;
+ }
+
+#broken-browser-warning {
+ text-align: center;
+}
+
+.sidebar {
+ padding: 10px 0 0 0; /* changed padding parameters */
+ /*border-right: 1px solid #ccc;*/
+ vertical-align: top;
+}
+.sidebar-title {
+ color: #999;
+ font-size: 10px;
+ text-align: center;
+ border-bottom: 1px solid #ccc;
+}
+.sidebar-links {
+ font-size: 10px;
+ margin: 0;
+ padding: 0 0 0 15pt;
+ color: #999;
+}
+.sidebar-title + .sidebar-links {
+ margin-top: -0.5em;
+}
+
+.sidebar-info {
+ padding: 4px 4px;
+}
+.sidebar-info h2 {
+ padding-left: 10px;
+ margin: 4px;
+}
+.legend-row {
+ padding: 0px 2px;
+ white-space: nowrap;
+}
+.legend-row img {
+ vertical-align: middle;
+ margin: 3px 4px;
+ padding: 0;
+}
+
+.tab-row img {
+ vertical-align: bottom;
+}
+
+.bar-undertabs div {
+ background: #900 url("/img/tab-bar.gif") repeat-x bottom;
+ height: 11px;
+ font-size: 1px;
+ margin: 0;
+ padding: 0;
+}
+.bar-status form {
+ margin: 0;
+}
+
+.bar-status {
+ background-color: #ddd;
+ font-size: 10px;
+ padding: 5px;
+ margin: 0;
+ border: 1px solid #ccc;
+ border-top: none;
+ /*
+ text-align: left;
+ */
+}
+
+#footer {
+ /*
+ border-top: 2px dotted #ccc;
+ padding: 2em 4em 2em 4em;
+ */
+ padding: 1em;
+ margin: 1em 4em 1em 4em;
+ text-align: center;
+ font-size: 10px;
+ color: #aaa;
+
+ margin-left: auto;
+ margin-right: auto;
+ margin-top: 64px;
+}
+
+ul#help-url-list ul {
+
+}
+ul#help-url-list li {
+ list-style: none;
+ padding-top: 10px;
+ padding-bottom: 10px;
+}
+
+ul#help-url-list li a {
+ font-weight: bold;
+}
+
+ul#faq-list {
+ padding-left: 2px;
+ margin-left: 0;
+}
+
+#faq-list li {
+ list-style: none;
+ margin-left: 10px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+
+#faq-list a {
+}
+
+#faq-details {
+ margin-left: 1em;
+}
+
+#faq-details a.faq-back-to-top {
+ float: right;
+}
+
+#faq-details p + h3 {
+ padding-top: 2em;
+}
+
+div.login-component {
+ text-align: center;
+}
+
+div.login-box {
+ border: 1px solid #999;
+ text-align: right;
+ padding: 12px 10px;
+ margin: 4px;
+ background-color: #eee;
+ width: 210px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+div.login-box form {
+ margin: 0;
+}
+
+div.login-box div.input-row {
+ font-weight: bold;
+ font-size: 10px;
+ white-space: nowrap;
+}
+
+div.login-box div.input-row input {
+ font-weight: normal;
+ vertical-align: middle;
+}
+
+div.filter-input {
+}
+div.filter-input input {
+ vertical-align: middle;
+ font-size: 10px;
+}
+
+/*
+ Devel environment only.
+
+b, i, u, font, center, .fixme, blockquote {
+ background-color: #eaa;
+ text-decoration: line-through;
+}
+*/
diff --git a/pki/linux/tps-ui/shared/docroot/css/pki.css b/pki/linux/tps-ui/shared/docroot/css/pki.css
new file mode 100644
index 000000000..39461f35f
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/css/pki.css
@@ -0,0 +1,745 @@
+/* --- BEGIN COPYRIGHT BLOCK ---
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; 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 file is for more detailed compliance (basically any browser
+"better" than NN 4.x */
+
+#broken-browser-warning {
+ display: none;
+}
+
+
+table.namespaces {
+ font-size: 10px;
+ border: 1px solid #999;
+}
+
+table.list-pagination {
+ font-size: 10px;
+}
+
+.list-empty-message {
+ margin: 0 2%;
+ cursor: text;
+ font-weight: bold;
+}
+.list-filterbox {
+ font-size: 10px;
+}
+.list-alphabar {
+ text-align: right;
+ font-size: 12px;
+ white-space: nowrap;
+}
+.list-alphabar a {
+ padding: 0px 2px;
+}
+.list-alphabar-enabled {
+ padding: 0px 2px;
+}
+.list-alphabar-disabled {
+ padding: 0px 2px;
+ color: #aaa;
+ cursor: default;
+}
+.list-box {
+ border: 1px solid #ccc;
+}
+.list-data-number {
+ text-align: right;
+}
+
+
+/* sample reddish toggle class def... */
+.remove-even-selected {
+ background-color: #fcc;
+}
+.remove-odd-selected {
+ background-color: #fcc;
+}
+.remove-even-selected td, .remove-odd-selected td {
+ border-bottom: 1px solid #aaa;
+ padding: 4px;
+}
+
+
+/* sample greenish toggle class def... */
+.green-even-selected {
+ background-color: #e5ffdd;
+}
+.green-odd-selected {
+ background-color: #e5ffdd;
+}
+.green-even-selected td, .green-odd-selected td {
+ border-bottom: 1px solid #ccc;
+ padding: 4px;
+}
+
+
+
+.list-navbuttons {
+ white-space: nowrap;
+}
+.list-infotext {
+ white-space: nowrap;
+ color: #777;
+}
+.list-channel a {
+}
+.list-channel ul {
+ padding: 0;
+ margin: 0;
+}
+.list-channel li {
+ list-style: none;
+}
+.list-channel li + li {
+ padding-top: 0;
+}
+.list-channel li + li li {
+ padding-top: 0;
+}
+.list-channel li li {
+ list-style-image: url("/img/branch.gif");
+ margin-left: 2.5em;
+}
+
+
+
+
+
+
+
+
+
+.invisible-buttons input {
+ font-size: 10px;
+}
+a:hover, .invisible-buttons input:hover {
+ color: #f00;
+}
+
+:visited {
+ color: #3850a9;
+}
+:link {
+ color: #2843c9;
+}
+a {
+ text-decoration: none;
+}
+a:hover {
+ text-decoration: underline !important;
+}
+a[name] {
+ text-decoration: inherit;
+}
+a[name]:hover {
+ text-decoration: none !important;
+}
+
+.tab-row td {
+ background: #fff url("/img/tab-bar-top.gif") repeat-x bottom;
+}
+
+hr {
+ border: 0;
+ border-bottom: 1px dashed #ccc;
+ padding: 0.5em;
+}
+
+.site-info {
+ border: 2px solid #002244;
+ background-color: #225580;
+ color: white;
+
+ padding: 0.5em;
+ margin-bottom: 0.5em;
+ margin-top: 2px;
+ font-size: 14px;
+ text-align: center;
+}
+
+.site-info a:link {
+ color: #99ddff;
+ font-weight: bold;
+}
+
+.site-info a:visited {
+ color: #99ddff;
+ font-weight: bold;
+}
+
+.site-alert {
+ border: 3px solid #d00;
+ background-color: #924;
+ color: white;
+
+ padding: 0.4em;
+ margin-bottom: 0.5em;
+ margin-top: 2px;
+ text-align: left;
+}
+.local-info {
+ color: #7782aa;
+
+ text-align: left;
+ font-size: 14px;
+}
+.local-alert {
+ color: #d00;
+ padding-top:7px;
+ padding-left:4px;
+ text-align: left;
+ font-size: 14px;
+}
+
+.bar-search {
+ font-size: 10px;
+ text-align: center;
+}
+.bar-logged-out {
+ font-weight: bold;
+ font-size: 10px;
+ text-align: center;
+}
+.bar-login {
+ font-weight: bold;
+ text-align: left;
+}
+.bar-ssm {
+ font-size: 10px;
+ text-align: right;
+}
+
+button {
+ padding: 2px 5px 2px 5px;
+}
+button:hover {
+ background-color: #eee;
+}
+button:active {
+ padding: 3px 6px 1px 4px;
+}
+a.help-title {
+ vertical-align: top;
+}
+
+a.help-title img {
+ border: 0;
+ padding: 0;
+ margin: 0;
+ vertical-align: top;
+
+ /* Mozilla and IE extensions */
+ -moz-opacity: 75%;
+ filter: alpha(opacity=70);
+}
+a.help-title:hover img {
+ /* Mozilla and IE extensions */
+ -moz-opacity: 100%;
+ filter: alpha(opacity=100);
+}
+
+a[name]:hover {
+ color: inherit;
+}
+
+h1, div.toolbar-h1 {
+ margin-top: 0;
+ margin-bottom: 0.5em;
+ font-size: 20px;
+}
+
+h1 img, div.toolbar-h1 img {
+ vertical-align: middle;
+ padding-top: 2px;
+ padding-bottom: 4px;
+}
+
+h1 a.help-title img, div.toolbar-h1 a.help-title img {
+ margin: 0;
+ padding: 0;
+ vertical-align: top;
+}
+
+div.toolbar-h1, div.toolbar-h2 {
+ font-weight: bold;
+ padding: 4px 0;
+}
+
+h2, div.toolbar-h2 {
+ font-size: 1.0em;
+ color: #999;
+ border-bottom: 2px solid #ccc;
+}
+h2 img, div.toolbar-h2 img {
+ vertical-align: middle;
+}
+h2 a {
+}
+
+
+h3 {
+ font-size: 1.0em;
+}
+
+.form-center {
+ text-align: center;
+}
+select, input, textarea {
+ font-family: sans-serif;
+ font-size: 100%;
+}
+.indent {
+ margin-left: 1em;
+}
+.iso-md5 {
+ font-family: monospace;
+ text-align: right;
+}
+
+.list-iso th {
+ border-width: 0 0 1px 0;
+}
+.list-iso th + th {
+ border-left: 1px solid #ccc;
+}
+.list-iso td.seperated {
+ border-top: 1px solid #ccc;
+ font-weight: bold;
+}
+.list-iso {
+ font-size: 10px;
+ border: 1px solid #999;
+ padding: 1px;
+}
+.list-iso-item {
+ margin-left: 1em;
+}
+.list-iso-item {
+ color: #555;
+}
+.list-iso-item + .list-iso-item {
+ margin-top: 0.05em;
+}
+.list-iso p + p {
+}
+.a-to-z-bar {
+
+}
+.linkchain {
+ text-align: center;
+ font-size: 12px;
+ color: #555;
+ white-space: nowrap;
+}
+.linkchain a {
+ font-weight: bold;
+}
+.preference {
+ margin: 0 30px 0 30px;
+ text-align: left;
+ font-size: 0.9em;
+ font-weight: bold;
+ color: #444;
+}
+
+
+.schedule-action-interface th {
+ background-color: #fff;
+ padding: 2px;
+ border: none;
+ color: black;
+ text-align: left;
+}
+
+div.toolbar {
+ vertical-align: middle;
+ font-weight: normal;
+ font-size: 12px;
+ color: #999;
+ float: right;
+ margin-top: 9px;
+ white-space: nowrap;
+}
+.toolbar img {
+ border: none;
+ padding: 0 2px 1px 2px;
+ vertical-align: middle;
+}
+.toolbar a {
+ padding: 0 2px;
+ text-decoration: none;
+}
+
+div.up-arrow {
+ vertical-align: middle;
+ font-weight: normal;
+ font-size: 12px;
+ color: #999;
+ float: left;
+ marginp: 0 2%;
+ white-space: nowrap;
+}
+.up-arrow img {
+ border: none;
+ padding: 0 2px 4px 2px;
+ vertical-align: middle;
+}
+.up-arrow a {
+ padding: 0 2px;
+ text-decoration: none;
+}
+
+
+.ok-explanation img {
+ border: none;
+ vertical-align: middle;
+ padding: 2px 0 4px 0;
+}
+
+
+.resubscribe-warning img {
+ border: none;
+ vertical-align: middle;
+ padding: 2px 0 4px 0;
+}
+
+.resubscribe-warning-big {
+ margin: 0 2%;
+ cursor: text;
+ color: #c00;
+}
+.resubscribe-warning-big img {
+ border: none;
+ padding: 0 4px 0 0;
+ vertical-align: middle;
+ float: left;
+}
+
+.required-form-field {
+ font-weight: bold;
+ color: #c00;
+}
+.ssm-overview th {
+ background-color: #fff;
+ border: none;
+ text-align: center;
+ padding: 6px;
+}
+
+
+table.namespace-control {
+ padding: 4px;
+}
+
+.namespace-control tr {
+ vertical-align: middle;
+}
+
+.namespace-control td {
+ padding: 4px;
+}
+
+.namespace-control-buttons td {
+ padding: 4px;
+ vertical-align: middle;
+}
+
+table.details-2-columns {
+ padding: 4;
+ border: none;
+}
+
+table.details {
+ margin: 0 2%;
+}
+.details th {
+ padding: 8px;
+ padding-left: 16px;
+ border: none;
+ color: #444;
+ text-align: right;
+ vertical-align: top;
+ border: 1px solid #ddd;
+ border:none;
+ background-color: #eee;
+ -moz-border-radius-topleft: 15px;
+ -moz-border-radius-bottomleft: 15px;
+}
+
+.details th.required-form-field {
+ border-right: 4px solid #c77;
+}
+
+.details td {
+ vertical-align: top;
+ padding: 4px;
+ padding-left: 2px;
+ padding: 8px;
+ border-bottom: 0;
+}
+
+.details th + td {
+ border-bottom: 1px solid #ddd;
+}
+
+.details td div {
+ text-align: left;
+ margin-bottom: 10px;
+ white-space: nowrap;
+}
+
+.details td table td {
+ margin: 0;
+ padding: 0;
+ border: 0;
+}
+
+.details td table {
+}
+
+table.details td.small-form textarea {
+ font-size: 10px;
+ font-family: monospace;
+}
+
+.details-header {
+ font-weight: bold;
+ color: #444;
+ font-family: helvetica;
+}
+
+.system-status {
+ text-align: center;
+}
+.system-status img {
+ vertical-align: middle;
+ padding-top: 0px;
+ padding-bottom: 2px;
+}
+.system-update-critical {
+ font-weight: bold;
+ color: #900;
+}
+
+.system-status-critical-updates {
+ font-weight: bold;
+ color: #c00;
+}
+.system-status-updates {
+ font-weight: bold;
+ color: #d80;
+}
+.system-status-bugfixes {
+ font-weight: bold;
+ color: #337;
+}
+.system-status-enhancements {
+ font-weight: bold;
+ color: #595;
+}
+.system-status-updates-scheduled {
+ font-weight: bold;
+}
+.system-status-up-to-date {
+ font-weight: bold;
+ color: #68d;
+}
+.system-status-unentitled {
+ font-weight: bold;
+ color: #333;
+}
+.system-status-awol {
+ font-weight: bold;
+ color: #f63;
+}
+
+.system-status-locked {
+ font-weight: bold;
+ color: #f63;
+}
+
+.system-status-kickstart {
+ font-weight: bold;
+ color: #f90;
+}
+
+osa-offline {
+ font-weight: bold;
+ color: #900;
+}
+
+.osa-online {
+ font-weight: bold;
+ color: #68d;
+}
+
+.probe-status-critical {
+ font-weight: bold;
+ color: #c00;
+}
+
+.probe-status-unknown {
+ font-weight: bold;
+ color: #f63;
+}
+
+.work-with-group-header {
+ text-align: right;
+}
+.work-with-group-header img {
+ border: none;
+}
+
+td.comparison {
+ padding: 10px;
+}
+
+.summary-row {
+ background-color: #f5f5f5;
+}
+
+.feedback-email {
+ font-weight: bold;
+ color: #900;
+}
+
+.schedule-action-interface {
+ color: black;
+}
+
+#navlogo {
+ border: 0;
+ margin: 4px 13px;
+ position: absolute;
+ top: 5px;
+}
+#navtabs {
+ position: absolute;
+ left: 166px;
+ top: 35px;
+ display: block;
+}
+#navhelp {
+ position: absolute;
+ right: 10px;
+ top: 15px;
+ border: 0;
+ padding: 15px;
+ padding-top: 0px;
+}
+
+
+.action-summary-errata, .action-summary-package, .action-summary-config {
+ padding-top: 10px;
+}
+
+.action-summary-errata ul, .action-summary-package ul, .action-summary-config ul {
+ margin: 0;
+ list-style: none;
+}
+
+div.page-summary {
+ margin: 0 2%;
+ cursor: text;
+}
+
+div.page-summary a {
+ text-decoration: underline;
+ cursor: pointer
+}
+
+div.marketing-summary {
+ margin: 0 2%;
+ cursor: text;
+}
+
+div.marketing-summary a {
+ text-decoration: underline;
+ font-weight: bold;
+ cursor: pointer
+}
+
+.search-choices form {
+ margin: 0;
+ padding: 0;
+}
+.search-choices {
+ margin-top: 20px;
+}
+
+.search-choices-group {
+ margin-left: 40px;
+}
+
+.debug-profile {
+ background-color: #eee;
+ border: 1px solid #ccc;
+ margin: 20px 40px;
+ padding: 8px;
+}
+
+div.buy-now {
+ text-align: left;
+ padding-top: 16px;
+}
+
+div.buy-now img {
+ border: 0;
+}
+
+span.no-details {
+ font-style: italic;
+ color: #777;
+}
+
+.page-content {
+ padding: 6px 10px 6px 16px;
+ vertical-align: top;
+ width: 100%;
+}
+
+div.pki-embedded-help {
+ padding: 6px 20px 6px 20px;
+}
+
+.pki-embedded-help-NAVHEADER th {
+ margin-top: 0;
+ padding-bottom: 1em;
+ font-size: 20px;
+ border: 0;
+ background-color: #fff;
+ color: black;
+ text-align: left;
+}
+
+.pki-embedded-help-NAVHEADER td {
+ padding: 0 2em;
+}
+
+.pki-embedded-help-TOC {
+ padding: 0 4em;
+}
+
+code.line-of-code {
+ white-space: nowrap
+}
diff --git a/pki/linux/tps-ui/shared/docroot/esc/AdminEsc.html b/pki/linux/tps-ui/shared/docroot/esc/AdminEsc.html
new file mode 100755
index 000000000..997de8e54
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/AdminEsc.html
@@ -0,0 +1,58 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<head>
+<title>Enterprise Security Administration Page</title>
+
+<link rel=stylesheet href="/style.css" type="text/css">
+
+</head>
+<body>
+
+<table width="100%">
+ <tr>
+ <td>
+<img src="../images/logo.gif"> </td>
+ <td>
+ <p class="headerText"><a href="esc.cgi?screenname=">Enterprise Security Client</a></p>
+ </td>
+ <tr>
+</table>
+
+<br>
+<br>
+<table width=100%>
+<tr>
+ <td class="bodyText">
+Welcome to the Enterprise Security Administration Page.
+</p>
+<p>Below are some useful links that take you directly to some of
+<br>the useful pages provided by the Enterprise Security program.
+</p>
+ </td>
+ </tr>
+</table>
+<br>
+<li><a class=linkText href="esc.cgi?action=enrollmentpage&screenname=">Key Enrollment Page</a></li>
+<li><a class=linkText href="esc.cgi?action=advancepage&screenname=">Advanced Function Page</a></li>
+<li><a class=linkText href="esc.cgi?action=tokenmanagerpage&screenname=">Token Manager Page</a></li>
+<li><a class=linkText href="esc.cgi?action=settingspage&screenname=">Settings Page</a></li>
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/docroot/esc/AdvancePopup.html b/pki/linux/tps-ui/shared/docroot/esc/AdvancePopup.html
new file mode 100755
index 000000000..c2698d45e
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/AdvancePopup.html
@@ -0,0 +1,1714 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+
+<head>
+<link rel=stylesheet href="/style.css" type="text/css">
+
+<script language="JavaScript">
+
+//
+// initialize netkey globals
+var netkey;
+var isMSHTML;
+
+
+var keyUITable = new Array();
+var keyTypeTable = new Array();
+var curChildWindow = null;
+
+function getUIForKey(aKeyID)
+{
+ return keyUITable[aKeyID];
+
+}
+
+function getTypeForKey(aKeyID)
+{
+ return keyTypeTable[aKeyID];
+}
+
+//
+// Determine if we are running MSHTML or GECKO
+//
+if (navigator.userAgent.indexOf("MSIE") != -1) {
+ isMSHTML = true;
+} else {
+ isMSHTML = false;
+}
+
+
+//
+// Notify callback for GECKO
+//
+function jsNotify() {}
+
+jsNotify.prototype = {
+
+ rhNotifyKeyStateChange: function(aKeyType,aKeyID,aKeyState,aData,strData)
+ {
+ OnCOOLKeyStateChange(aKeyType, aKeyID, aKeyState, aData,strData);
+ },
+
+ QueryInterface: function(iid)
+ {
+ <!-- alert("iid: " + iid); -->
+ if(!iid.equals(Components.interfaces.rhIKeyNotify) &&
+ !iid.equals(Components.interfaces.nsISupports))
+ {
+ alert("Can't find jsNotify interface");
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+ }
+ return this;
+ }
+};
+
+//
+// Attach to the object.
+//
+if (!isMSHTML) {
+ // GECKO ONLY initialization
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey = Components.classes["@redhat.com/rhCoolKey"].getService();
+ netkey = netkey.QueryInterface(Components.interfaces.rhICoolKey);
+ gNotify = new jsNotify;
+ netkey.rhCoolKeySetNotifyCallback(gNotify);
+ } catch(e) {
+ alert("Can't get UniversalXPConnect: " + e);
+ }
+} else {
+ // MSHTML only initialization
+ netkey = external;
+}
+
+//
+// unregister our notify event
+//
+function cleanup()
+{
+ if (!isMSHTML) {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.rhCoolKeyUnSetNotifyCallback(gNotify);
+ } catch(e) {
+ alert("Can't get UniversalXPConnect: " + e);
+ }
+ }
+}
+
+var gScreenName = "";
+var gKeyEnrollmentType = "userKey";
+
+var gCurrentSelectedRow = null;
+
+
+var gCurKeyType = null;
+var gCurKeyID = null;
+
+////////////////////////////////////////////////////////////////
+//
+// Utility functions specific to this page.
+//
+////////////////////////////////////////////////////////////////
+
+
+// List of Error Messages to be printed out
+
+var Status_Messages = new Array(
+
+"Operation Completed Successfully.",
+ "Server Error.",
+ "Problem communicating with the token.",
+ "Problem communicating with the token.",
+ "Problem resetting token's pin.",
+ "Internal Server Error.",
+ "Internal Server Error",
+ "Token Enrollment Error.",
+ "Problem communicating with the token.",
+ "Internal Server Error",
+ "Error communicating with the Certificate Authority, try again later.",
+ "Internal Server Error.",
+ "Error resetting the token's pin.",
+ "Internal Server Error.",
+ "Authentication Failure, Try Again.",
+ "Internal Server Error",
+ "Token is disabled, contact technical support.",
+ "Problem communicating with the token.",
+ "Internal Server Error.",
+ "Cannot upgrade token software.",
+ "Internal Server Error.",
+ "Problem communicating with the token.",
+ "Invalid token type.",
+ "Invalid token type",
+ "Cannot publish.",
+ "Cannot communicate with token database, try again later.",
+ "Token is disabled, contact techincal support.",
+ "Cannot reset pin value for the token, contact technical support.",
+ "Connection to server lost.",
+ "Cannot create entry for token in database, contact technical support.",
+ "No such token state, contact technical support.",
+ "Invalid lost token reason, contact technical support.",
+ "Token unusable due to compromise,contact technical support.",
+ "No such inactive token, contact technical support.",
+ "Cannot process more than one active token.",
+ "Internal Server Error,contact technical support.",
+ "Key Recovery has been processed.",
+ "Key Recovery failed, contact technical support.",
+ "Cannot operate on token reported lost, contact technical support.",
+ "Key archival error, contact technical support.",
+ "Problem connecting to the TKS, contact technical support.",
+ "Failed to update token database, contact technical support.",
+ "Internal certificate revocation error,contact technical support.",
+ "User does not own this token, contact technical support."
+);
+
+function GetAuthDataFromPopUp(aKeyType,aKeyID,aUiData)
+{
+
+ keyUITable[aKeyID] = aUiData;
+ keyTypeTable[aKeyID] = aKeyType;
+
+ //alert("GetAuthDataFromPopUp data " + aUiData);
+ var child = window.open("/GenericAuth.html",aKeyID,"height=400,width=400");
+
+ //alert("Attempted to create child window " + child);
+
+ curChildWindow = child;
+
+}
+
+function COOLKeySetDataValue(aKeyType,aKeyID,name,value)
+{
+ //alert("In COOLKeySetDataValue aKeyType " + aKeyType + " aKeyID " + aKeyID + " name " + name + " value " + value);
+ if(netkey)
+ {
+ try {
+ if(!isMSHTML)
+ {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+
+ netkey.SetCoolKeyDataValue(aKeyType,aKeyID,name,value);
+
+
+ } catch(e) {
+ alert("Error Setting data values: " + e);
+ }
+ }
+
+}
+
+function COOLKeySetTokenPin(pin)
+{
+ if(!isMSHTML)
+ {
+ if(netkey)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"TokenPin",pin);
+
+
+ } catch(e) {
+ alert("Error Setting data values: " + e);
+ }
+ }
+ }
+}
+
+function COOLKeySetUidPassword(uid,pwd)
+{
+
+ if(!isMSHTML)
+ {
+ if(netkey)
+ {
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"UserId",uid);
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"Password",pwd);
+
+ } catch(e) {
+ alert("Error Setting data values: " + e);
+ }
+
+ }
+
+ }
+
+}
+
+
+function MyGetErrorMessage(status_code)
+{
+
+ var result = "Internal Server Error";
+
+ if(status_code < 0 && status_code >= Status_Messages.length)
+ {
+ return result;
+
+ }
+
+ return Status_Messages[status_code];
+
+}
+
+function KeyToRowID(keyType, keyID)
+{
+ return keyType + "--" + keyID;
+}
+
+function RowIDToKeyInfo(rowID)
+{
+ return rowID.split("--");
+}
+
+function GetRowForKey(keyType, keyID)
+{
+ return document.getElementById(KeyToRowID(keyType, keyID));
+}
+
+function ReportException(msg, e)
+{
+ alert(msg + " " + e.description + "(" + e.number + ")");
+}
+
+function GetCOOLKeyStatus(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyStatus(keyType, keyID);
+ } catch (e) {
+ ReportException("netkey.GetCoolKeyStatus() failed!", e);
+ return 0;
+ }
+}
+
+function GetCOOLKeyPolicy(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyPolicy(keyType, keyID);
+ } catch (e) {
+ // ReportException("netkey.GetCoolKeyPolicy() failed!", e);
+ return "";
+ }
+}
+
+function GetCOOLKeyRequiresAuth(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyRequiresAuthentication(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyRequiresAuthentication() failed!", e);
+ return false;
+ }
+}
+
+function GetCOOLKeyIsAuthed(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyIsAuthenticated(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyIsAuthenticated() failed!", e);
+ return false;
+ }
+}
+
+function GetAvailableCOOLKeys()
+{
+ try {
+ var keyArr;
+
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var inArray = netkey.GetAvailableCoolKeys( {} );
+ keyArr = new Array(inArray.length);
+ var i;
+
+ for (i=0; i < keyArr.length; i++) {
+ keyArr[i] = new Array( "1", inArray[i]);
+ }
+ } else {
+ keyArr = ConvertVariantArrayToJScriptArray(netkey.GetAvailableCoolKeys());
+
+ var i;
+ for (i=0; i < keyArr.length; i++)
+ keyArr[i] = ConvertVariantArrayToJScriptArray(keyArr[i]);
+ }
+ return keyArr;
+ } catch(e) {
+ ReportException("netkey.GetAvailableCoolKeys() failed!", e);
+ return [];
+ }
+}
+
+function ChallengeCOOLKey(keyType, keyID, data)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return ConvertVariantArrayToJScriptArray(netkey.ChallengeCoolKey(keyType, keyID, data));
+ } catch(e) {
+ ReportException("netkey.ChallengeCoolKey() failed!", e);
+ return [];
+ }
+}
+
+function EnrollCOOLKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.EnrollCoolKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode);
+ } catch(e) {
+ ReportException("netkey.EnrollCoolKey() failed!", e);
+ return false;
+ }
+
+ return true;
+}
+
+function GetCOOLKeyIsEnrolled(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyIsEnrolled(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyIsEnrolled() failed!", e);
+ return false;
+ }
+}
+
+function ResetCOOLKeyPIN(keyType, keyID, screenname, pin,screennamepwd)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.ResetCoolKeyPIN(keyType, keyID, screenname, pin,screennamepwd);
+ } catch(e) {
+ ReportException("netkey.ResetCoolKeyPIN() failed! Make sure token is properly Enrolled.", e);
+ return false;
+ }
+ return true;
+}
+function FormatCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.FormatCoolKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode);
+ } catch(e) {
+ ReportException("netkey.FormatCoolKey() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+function CancelCOOLKeyOperation(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.CancelCoolKeyOperation(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.CancelCoolKeyOperation() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+function BlinkCOOLKey(keyType, keyID, rate, duration)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.BlinkCoolKey(keyType, keyID, rate, duration);
+ } catch(e) {
+ ReportException("netkey.BlinkCoolKey() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+function RequestServiceTicket(screenName, serviceName)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.RequestServiceTicket(screenName, serviceName);
+ } catch(e) {
+ ReportException("netkey..RequestServiceTicket() failed!", e);
+ return false;
+ }
+
+ return true;
+}
+
+//
+// MSHTML/GECKO compatibility functions.
+//
+function RemoveRow(table, row)
+{
+ if (isMSHTML) {
+ row.removeNode(row);
+ } else {
+ table.deleteRow(row.rowIndex);
+ }
+}
+
+function GetCell(row, index)
+{
+ var cell;
+
+ if (isMSHTML) {
+ cell = row.cells(index);
+ } else {
+ cell = row.cells[index];
+ }
+ return cell;
+}
+
+function GetNode(parent, index)
+{
+ var node;
+ if (isMSHTML) {
+ node = parent.childNodes(index);
+ } else {
+ node = parent.childNodes[index];
+ }
+ return node;
+}
+
+function InsertRow(table)
+{
+ var row;
+
+ if (isMSHTML) {
+ row = table.insertRow();
+ } else {
+ row = table.insertRow(table.rows.length);
+ }
+ return row;
+}
+
+function InsertCell(row)
+{
+ var cell;
+
+ if (isMSHTML) {
+ cell = row.insertCell();
+ } else {
+ cell = row.insertCell(row.cells.length);
+ }
+ return cell;
+}
+
+function RemoveAllChildNodes(parent)
+{
+ var numChildren = parent.childNodes.length;
+ var i;
+
+ i = numChildren;
+ while (numChildren)
+ {
+ parent.removeChild(GetNode(parent,0));
+ numChildren--;
+ }
+
+}
+
+
+function UpdateInfoForKeyID(keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ return;
+
+ var cell = GetCell(row,1)
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(keyStatus));
+
+ // cell = GetCell(row,2);
+ // RemoveAllChildNodes(cell);
+ //cell.appendChild(document.createTextNode(reqAuth));
+
+ //cell = GetCell(row,3);
+ //RemoveAllChildNodes(cell);
+ //cell.appendChild(document.createTextNode(isAuthed));
+}
+
+function GetStatusForKeyID(keyType, keyID)
+{
+ var keyStatus = "BLANK";
+
+ var status;
+
+ try {
+ status = GetCOOLKeyStatus(keyType, keyID);
+ } catch(e) {
+ status = 0;
+ }
+
+ switch (status) {
+ case 0: // Unavailable
+ keyStatus = "UNAVAILABLE";
+ break;
+ case 1: // AppletNotFound
+ keyStatus = "NO APPLET";
+ break;
+ case 2: // Uninitialized
+ keyStatus = "UNINITIALIZED";
+ break;
+ case 3: // Unknown
+ keyStatus = "UNKNOWN";
+ break;
+ case 4: // Available
+ case 6: // UnblockInProgress
+ case 7: // PINResetInProgress
+ case 8: // RenewInProgress
+ keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ break;
+ case 5: // EnrollmentInProgress
+ keyStatus = "BUSY";
+ break;
+ break;
+ case 9: // FormatInProgress
+ keyStatus = "BUSY";
+ break;
+ }
+
+ return keyStatus;
+}
+
+function GetKeyStatusForKeyID(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ return "UNKNOWN";
+
+ var cell = GetCell(row,1);
+ return GetNode(cell,0).data;
+}
+
+function InsertCOOLKeyIntoBindingTable(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ {
+ var table = document.getElementById("BindingTable");
+ if (table)
+ {
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ row = CreateTableRow(table, keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ }
+
+ if (!row)
+ return null;
+ }
+
+ return row;
+}
+
+function ConvertVariantArrayToJScriptArray(varr)
+{
+ // C++ native methods, like netkey.GetAvailableCOOLKeys(), can only
+ // return variant SafeArrays, so to access the data inside, you must
+ // first convert it to a VBArray, and then call toArray() to convert
+ // it to a JScript array. Lame, but that's what it takes to
+ // use an array returned from an ActiveX component.
+
+ return new VBArray(varr).toArray();
+}
+
+function UpdateBindingTableAvailability()
+{
+ var arr = GetAvailableCOOLKeys();
+
+ if (!arr || arr.length < 1)
+ return;
+
+ var i;
+
+ for (i=0; i < arr.length; i++)
+ {
+ InsertCOOLKeyIntoBindingTable(arr[i][0], arr[i][1]);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(arr[i][0], arr[i][1]);
+ }
+}
+
+function InitializeBindingTable()
+{
+ UpdateBindingTableAvailability();
+ UpdateButtonStates();
+ // document.getElementById("snametf").value = gScreenName;
+}
+
+function KeyIsPresent(keyType, keyID)
+{
+ row = document.all.item(keyType, keyID);
+
+ if (!row)
+ return false;
+
+ return true;
+}
+
+function SetStatusMessage(str)
+{
+ var cell = document.getElementById("statusMsg");
+
+ if (!cell)
+ return;
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(str));
+}
+
+function UpdateButtonStates()
+{
+ if (gKeyEnrollmentType == "deviceKey")
+ {
+ // document.getElementById("snametf").disabled = true;
+ // document.getElementById("pintf").disabled = true;
+ // document.getElementById("reenterpintf").disabled = true;
+ // document.getElementById("snamepwd").disabled = true;
+ }
+ else
+ {
+ // document.getElementById("snametf").disabled = false;
+ // document.getElementById("pintf").disabled = false;
+ // document.getElementById("reenterpintf").disabled = false;
+ // document.getElementById("snamepwd").disabled = false;
+ }
+
+ if (gCurrentSelectedRow)
+ {
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+ var keyStatus = GetKeyStatusForKeyID(keyType, keyID);
+
+ var validKey = (keyStatus == "NETKEY" || keyStatus == "HOUSEKEY");
+ // document.getElementById("challengebtn").disabled = !validKey;
+ document.getElementById("blinkbtn").disabled = false;
+ //document.getElementById("enrollbtn").disabled = false;
+ // document.getElementById("formatbtn").disabled = false;
+// document.getElementById("resetpinbtn").disabled = !((keyStatus == "NETKEY") && (gKeyEnrollmentType == "userKey"));
+document.getElementById("resetpinbtn").disabled = !((gKeyEnrollmentType == "userKey"));
+ }
+ else
+ {
+ //document.getElementById("enrollbtn").disabled = true;
+ document.getElementById("resetpinbtn").disabled = true;
+ // document.getElementById("formatbtn").disabled = true;
+ // document.getElementById("challengebtn").disabled = true;
+ document.getElementById("blinkbtn").disabled = true;
+ }
+
+ refresh();
+}
+
+function SetEnrollmentType(type)
+{
+ gKeyEnrollmentType = type;
+ UpdateButtonStates();
+}
+
+function FindRow(node)
+{
+ while (node && node.tagName != "TR")
+ {
+ node = node.parentNode;
+ }
+
+ return node;
+}
+
+function SelectRow(row)
+{
+ if (!row || gCurrentSelectedRow == row)
+ return;
+
+ if (gCurrentSelectedRow)
+ gCurrentSelectedRow.removeAttribute("style");
+
+ gCurrentSelectedRow = row;
+ gCurrentSelectedRow.style.backgroundColor="rgb(200,200,200)";
+ UpdateButtonStates();
+}
+
+function SelectRowByKeyID(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ SelectRow(row);
+}
+
+function DoSelectRow(event)
+{
+ var row;
+
+ if (isMSHTML) {
+ row = FindRow(window.event.srcElement);
+ } else {
+ row = FindRow(event.parentNode);
+ }
+ SelectRow(row);
+}
+
+function KeyToUIString(keyType, keyID)
+{
+ // If it's an COOLKey, format the keyID string.
+
+ if (keyType == 1 && keyID.length == 20)
+ {
+ var re = /([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})/i;
+ keyID = keyID.replace(re, "$1-$2-$3-$4-$5").toLowerCase();
+ }
+
+ return keyID;
+}
+
+
+
+function CreateTableRow(table, keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+
+ var row = InsertRow(table);
+ if (!row)
+ return null;
+
+ row.setAttribute("id", KeyToRowID(keyType, keyID));
+
+
+ if (isMSHTML) {
+ row.onclick = DoSelectRow;
+ }
+
+ // Create the key ID cell.
+ cell = InsertCell(row);
+ cell.appendChild(document.createTextNode(KeyToUIString(keyType, keyID)));
+
+ cell.setAttribute("onClick", "DoSelectRow(this);");
+
+ // Create the keyStatus cell.
+ cell = InsertCell(row);
+ cell.appendChild(document.createTextNode(keyStatus));
+
+ // Create the requires auth cell.
+ // cell = InsertCell(row);
+ // cell.appendChild(document.createTextNode(reqAuth));
+
+ // Create the is auth'ed cell.
+ // cell = InsertCell(row);
+ // cell.appendChild(document.createTextNode(isAuthed));
+
+ // Create the status bar cell
+ cell = InsertCell(row);
+
+ var progressMeter = document.createElement("div");
+ progressMeter.setAttribute("id", KeyToProgressBarID(keyType, keyID));
+ progressMeter.className = "ProgressMeter";
+ progressMeter.style.width = "100px";
+ progressMeter.style.height = "1.5em";
+ progressMeter.setAttribute("value", 0);
+
+ var progressBar = document.createElement("div");
+ progressBar.className = "ProgressBar";
+ progressBar.style.width = "0px";
+ progressBar.style.height = "100%";
+ progressBar.style.visibility = "hidden";
+
+ var progressBarStatus = document.createElement("div");
+ progressBarStatus.className = "ProgressBarStatus";
+ progressBarStatus.appendChild(document.createTextNode(""));
+
+ progressMeter.appendChild(progressBar);
+ progressMeter.appendChild(progressBarStatus);
+ cell.appendChild(progressMeter);
+
+ return row;
+}
+
+gAnimationMSecs = 1000/30;
+
+function SetCylonTimer(cylonID, cylonEyeID)
+{
+ setTimeout("AnimateCylonStatusBar(\"" + cylonID +
+ "\", \"" + cylonEyeID + "\");", gAnimationMSecs);
+}
+
+function AnimateCylonStatusBar(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID);
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ return;
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (!eye)
+ return;
+
+ var dir = eye.getAttribute("direction");
+ var wid = parseInt(eye.style.width);
+ var cywid = parseInt(cylon.style.width);
+ var left = parseInt(eye.style.left);
+
+ var dx = 10;
+
+ if (!dir || dir >= 0)
+ {
+ left += dx;
+
+ if (left + wid > cywid)
+ {
+ left = cywid - wid;
+ eye.setAttribute("direction", "-1");
+ }
+ }
+ else
+ {
+ left -= dx;
+
+ if (left < 0)
+ {
+ left = 0;
+ eye.setAttribute("direction", "1");
+ }
+ }
+
+ eye.style.left = left + "px";
+
+ SetCylonTimer(cylonID, cylonEyeID);
+}
+
+function StartCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ {
+ cylon.setAttribute("cylonactive", "true");
+
+ var eye = document.getElementById(cylonEyeID);
+ if (eye)
+ {
+ eye.style.left = "0px";
+ eye.style.visibility = "visible";
+ }
+
+ SetCylonTimer(cylonID, cylonEyeID);
+ }
+}
+
+function StopCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (cylon)
+ cylon.removeAttribute("cylonactive");
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (eye)
+ eye.style.visibility = "hidden";
+}
+
+function GetProgressMeterValue(progMeterID)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return -1;
+
+ return parseInt(progMeter.getAttribute("value"));
+}
+
+function SetProgressMeterValue(progMeterID, value)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter || value < 0)
+ return;
+
+ if (value > 100)
+ value = 100;
+
+ var progBar = progMeter.firstChild;
+
+ if (value == 0)
+ {
+ progBar.style.width = "0px";
+ progBar.style.visibility = "hidden";
+ progMeter.setAttribute("value", 0);
+ return;
+ }
+
+ progBar.style.visibility = "visible";
+
+ var newWidth = parseInt(progMeter.style.width) * value / 100 - 2;
+
+ progBar.style.width = newWidth + "px";
+ progMeter.setAttribute("value", value);
+}
+
+function SetProgressMeterStatus(progMeterID, statusMsg)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return;
+
+ var progBar = progMeter.firstChild;
+
+ // If it exists, the meter status should be
+ // div that is the next sibling of the progressMeter.
+
+ var meterStatus = progBar.nextSibling;
+
+ // Just replace the data in the text node, it's much faster,
+ // and reduces flashing!
+
+ meterStatus.firstChild.replaceData(0, meterStatus.firstChild.length, statusMsg);
+}
+
+function ClearProgressBar(progMeterID)
+{
+ SetProgressMeterValue(progMeterID, 0);
+ SetProgressMeterStatus(progMeterID, "");
+}
+
+function KeyToProgressBarID(keyType, keyID)
+{
+ return "PM" + keyType + "-" + keyID;
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions that contact the server or talk directly to
+// ASC native code.
+//
+// ASC Native Functions:
+//
+// netkey.GetAvailableCOOLKeys()
+//
+// - Returns an ActiveX Variant SafeArray containing the ID for each key
+// that is currentlly plugged into the computer. Before accessing any
+// data in this array you must convert it to a JScript Array with a
+// call to ConvertVariantArrayToJScriptArray().
+//
+// netkey.GetCOOLKeyIsEnrolled(keyType, keyID)
+//
+// - Returns true if a key has been initialized, false if it hasn't.
+// Initialized means the card has been formatted with certificates
+// for either an COOL HouseKey or NetKey.
+//
+// netkey.EnrollCOOLKey(keyType, keyID, enrollmentType, screenName, pin)
+//
+// - Initiates an async connection to the RA to initialize a specific
+// key. If you want the key to be initialized as a HouseKey, you should
+// pass "houseKey" as the enrollmentType, and null values for both
+// screenName and pin. For a NetKey, use "netKey" as the enrollmentType,
+// and pass a valid screenName and pin.
+//
+// netkey.ChallengeCOOLKey(keyType, keyID, data)
+//
+// - Signs some data with the specified key, and returns the results
+// in an AcviteX Variant SafeArray. Before accessing any data in
+// this array, you must convert it to a JScript Array with a
+// call to ConvertVariantArrayToJScriptArray(). The elements in the
+// array are as follows:
+//
+// array[0] --> Length of the signed challenge data in binary form.
+// array[1] --> The signed challenge data as hex.
+// array[0] --> Length of the nonce data in binary form.
+// array[0] --> The nonce data as hex.
+//
+// netkey.BlinkCOOLKey(keyType, keyID, rate, duration)
+//
+// - Make a specific key blink at a given rate for a given duration.
+// rate and duration are specified in milliseconds.
+//
+////////////////////////////////////////////////////////////////
+
+function GetScreenNameValue()
+{
+ var sname = document.getElementById("snametf").value;
+
+ if (! sname)
+ {
+ alert("You must provide a valid screen name!");
+ return null;
+ }
+
+ return sname;
+}
+
+function GetPINValue()
+{
+ var pinVal = document.getElementById("pintf").value;
+ var rpinVal = document.getElementById("reenterpintf").value;
+
+ if (! pinVal)
+ {
+ alert("You must provide a valid PIN!");
+ return null;
+ }
+
+ if ( pinVal != rpinVal)
+ {
+ alert("The PIN values you entered don't match!");
+ return null;
+ }
+
+ return pinVal;
+}
+
+function GetScreenNamePwd()
+{
+
+ var pwd = document.getElementById("snamepwd").value;
+
+ if(!pwd)
+ {
+ alert("You must provide a valid User Password!");
+ return null;
+ }
+ return pwd;
+}
+
+function GetTokenCode()
+{
+
+ return null;
+}
+function DoEnrollCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ {
+ alert("Please select a key.");
+ return;
+ }
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = GetPINValue();
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ if (type == "userKey")
+ {
+ screenname = null; //GetScreenNameValue();
+
+ pin = GetPINValue();
+
+
+ screennamepwd = null; // GetScreenNamePwd();
+
+
+ tokencode = GetTokenCode();
+
+ SetStatusMessage("Enrolling UserKey \"" + KeyToUIString(keyType, keyID) + "\"...");
+ }
+ else
+ SetStatusMessage("Enrolling DeviceKey \"" + KeyToUIString(keyType, keyID) + "\"...");
+
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!EnrollCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+}
+
+function DoResetSelectedCOOLKeyPIN()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ if(!Validate())
+ return;
+
+ //alert("In DoResetSelectedCOOLKeyPIN!");
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var screenname = null;
+ var pin = GetPINValue() ;
+ var screennamepwd = null;
+
+ if (GetCOOLKeyIsEnrolled(keyType, keyID))
+ {
+
+ SetStatusMessage("Resetting PIN for \"" + keyID + "\"...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!ResetCOOLKeyPIN(keyType, keyID, screenname, pin,screennamepwd))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+ }
+ else
+ {
+
+ alert("Your key must be enrolled before attempting a Pin Reset.");
+ }
+}
+
+function DoFormatCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+
+ if(!Validate())
+ return;
+
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ SetStatusMessage("Formatting \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!FormatCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+}
+function DoCancelOperation()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ SetStatusMessage("Cancel operation for \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ CancelCOOLKeyOperation(keyType, keyID);
+
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+}
+
+function DoChallengeSelectedKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Generating Challenge ...");
+
+ var challengeArray = ChallengeCOOLKey(keyType, keyID, document.forms[0].challengedata.value);
+
+ if (challengeArray.length != 4)
+ {
+ alert("Challenge for key \"" + KeyToUIString(keyType, keyID) + "\" failed!");
+ SetStatusMessage("");
+ return;
+ }
+
+ alert("ChallengeCOOLKey(\""+ KeyToUIString(keyType, keyID) + "\") returned:\n\n" +
+ "challenge[0]: " + challengeArray[0] + "\n" +
+ "challenge[1]: " + challengeArray[1] + "\n" +
+ "challenge[2]: " + challengeArray[2] + "\n" +
+ "challenge[3]: " + challengeArray[3] + "\n");
+
+ SetStatusMessage("");
+}
+
+function DoBlinkCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Blinking \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ BlinkCOOLKey(keyType, keyID, 400, 5000);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+}
+
+function OnCOOLKeyBlinkComplete(keyType,keyID)
+{
+ //StopCylonAnimation("cylon1", "eye1");
+ //SetStatusMessage(" ");
+}
+
+function DoHelp()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ var policy = GetCOOLKeyPolicy(keyType, keyID);
+ var type = PolicyToKeyType(policy);
+ alert("Policy: " + policy + "\n" + "Type: " + type);
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions called directly from ASC native code.
+//
+////////////////////////////////////////////////////////////////
+
+function OnCOOLKeyInserted(keyType, keyID)
+{
+ var row = InsertCOOLKeyIntoBindingTable(keyType, keyID);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(keyType, keyID);
+}
+
+
+function OnCOOLKeyRemoved(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ var table = document.getElementById("BindingTable");
+
+ if (row && table)
+ {
+ RemoveRow(table,row);
+
+ if (row == gCurrentSelectedRow)
+ gCurrentSelectedRow = null;
+ }
+
+ UpdateButtonStates();
+}
+
+var gKnownPolicies = [
+
+ // OID Value, precedence, name value
+
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.4", 4, "NETKEY" ], // Platinum - MyDoctor
+
+ // XXX: Remove the Old OIDs below, after the RA starts generating
+ // certificates with the OIDs listed above!
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.4", 4, "NETKEY" ] // Platinum - MyDoctor
+];
+
+function PolicyToKeyType(policy)
+{
+ return "ENROLLED";
+}
+
+function OldPolicyToKeyType(policy)
+{
+ var i, j;
+
+ var knownPoliciesIndex = -1;
+
+
+ var policies;
+
+
+ if (policy.indexOf(",")== -1)
+ {
+ policies = new Array(1);
+ policies[0] = policy;
+ }
+ else
+ {
+ policies = policy.split(",");
+ }
+
+ for (j = 0; j < policies.length; j++)
+ {
+ for (i = 0; i < gKnownPolicies.length; i++)
+ {
+ if (gKnownPolicies[i][0] == policies[j])
+ {
+ if (knownPoliciesIndex < gKnownPolicies[i][1])
+ knownPoliciesIndex = i;
+ }
+ }
+ }
+
+ if (knownPoliciesIndex == -1)
+ return "INITIALIZED";
+
+ return gKnownPolicies[knownPoliciesIndex][2];
+}
+
+function BoolToYesNoStr(b)
+{
+ if (b)
+ return "YES";
+ return "NO";
+}
+
+function OnCOOLKeyEnrollmentComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ alert("Enrollment for \"" + KeyToUIString(keyType, keyID) + "\" was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyPINResetComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ alert("PIN Reset was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyFormatComplete(keyType, keyID)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ alert("Format of \"" + KeyToUIString(keyType, keyID)+ "\" was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyStateError(keyType, keyID, keyState, errorCode)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ if(curChildWindow)
+ {
+ curChildWindow.close();
+ curChildWindow = null;
+
+ }
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+
+ var typeStr = "Error(" + errorCode + ")";
+
+ var messageStr = " \n\n Server Response: " + MyGetErrorMessage(errorCode) ;
+
+ var keyIDStr = KeyToUIString(keyType, keyID);
+
+ if (keyState == 1004)
+ typeStr = "Enrollment of key (" + keyIDStr + ") failed. " + typeStr + messageStr ;
+ else if (keyState == 1016)
+ typeStr = "Formatting of key (" + keyIDStr + ") failed. " + typeStr + messageStr;
+ else if (keyState == 1010)
+ typeStr = "PIN Reset for key (" + keyIDStr + ") failed. " + typeStr + messageStr;
+ else if (keyState == 1020)
+ typeStr = "Operation for key (" + keyIDStr + ") canceled.";
+
+ alert(typeStr);
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyStatusUpdate(progMeterID, statusUpdate)
+{
+ SetProgressMeterValue(progMeterID, statusUpdate);
+ SetProgressMeterStatus(progMeterID, statusUpdate + "%");
+}
+
+function Validate()
+{
+
+ var type = gKeyEnrollmentType;
+ var pin = null;
+
+ var tokencode = null;
+
+ if (type == "userKey")
+ {
+
+ pin = GetPINValue();
+
+ if (! pin)
+ return 0;
+
+ }
+
+ return 1;
+}
+
+function OnCOOLKeyStateChange(keyType, keyID, keyState, data,strData)
+{
+ // alert("KeyID: " + keyID + "\n" +
+ // "KeyState: " + keyState + "\n" +
+ // "Data: " + data);
+ //alert("State Change ="+keyState);
+
+ switch(keyState)
+ {
+ case 1000: // KeyInserted
+ OnCOOLKeyInserted(keyType, keyID);
+ break;
+ case 1001: // KeyRemoved
+ OnCOOLKeyRemoved(keyType, keyID);
+ break;
+ case 1002: // EnrollmentStart
+ // OnCOOLKeyEnrollmentStart(keyType, keyID);
+ break;
+ case 1003: // EnrollmentComplete
+ OnCOOLKeyEnrollmentComplete(keyType, keyID);
+ break;
+ case 1004: // EnrollmentError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1008: // PINResetStart
+ // OnCOOLKeyPINResetStart(keyType, keyID);
+ break;
+ case 1009: // PINResetComplete
+ OnCOOLKeyPINResetComplete(keyType, keyID);
+ break;
+ case 1010: // PINResetError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1014: // FormatStart
+ // OnCOOLKeyFormatStart(keyType, keyID);
+ break;
+ case 1015: // FormatComplete
+ OnCOOLKeyFormatComplete(keyType, keyID);
+ break;
+ case 1016: // FormatError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1017: // BlinkStatus Update?
+ //OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1018:
+ OnCOOLKeyBlinkComplete(keyType, keyID);
+ break;
+ case 1020: // OperationCancelled
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1021: // OperationStatusUpdate
+ OnCOOLKeyStatusUpdate(KeyToProgressBarID(keyType, keyID), data);
+ break;
+
+ case 1022: //Need Auth
+
+
+ gCurKeyID = keyID;
+ gCurKeyType = keyType;
+
+ GetAuthDataFromPopUp(keyType,keyID,strData);
+
+ break;
+
+ }
+}
+
+function refresh()
+{
+ window.resizeBy(0,1);
+ window.resizeBy(0,-1);
+
+}
+
+</script>
+
+</head>
+<body onload="InitializeBindingTable();" onunload=cleanup()>
+
+<table width="100%">
+ <tr>
+ <td>
+<img src="../images/logo.gif"> </td>
+ <td>
+ <p class="headerText"><a href="esc.cgi?screenname=">Enterprise Security Client</a></p>
+ </td>
+ <tr>
+</table>
+
+ <br>
+ <table id="BindingTable" width="100%"><tbody>
+ <tr id="HeaderRow">
+ <th><p class="titleText">Key ID</p></th>
+ <th><p class="titleText">Key Status</p></th>
+<!-- <th><p class="titleText">Requires Auth</p></th>
+ <th><p class="titleText">Did Auth</p></th>
+-->
+ <th width="100"><p class="titleText">Progress</p></th>
+ </tr>
+ </tbody></table>
+ <form action="esc.cgi">
+ <input type="hidden" id="action" name="action" value="bind">
+ <input type="hidden" id="screenname" name="screenname" value="">
+ <input type="hidden" id="challengedata" name="challengedata" value="QVNDIHJvY2tzIHRoZSBwYXJ0eSE=">
+ <input type="hidden" id="signedchallenge" name="signedchallenge" value="">
+ <input type="hidden" id="signedchallengelength" name="signedchallengelength" value="">
+ <input type="hidden" id="nonce" name="nonce" value="">
+ <input type="hidden" id="noncelength" name="noncelength" value="">
+ <input type="hidden" id="keytype" name="keytype" value="">
+ <input type="hidden" id="keyid" name="keyid" value="">
+ <input type="hidden" id="keylabel" name="keylabel" value="">
+ <table width=100%>
+ <tr>
+ <td class="bodyText">
+ Select enrollment type: <input checked type="radio" id="keytype" name="keytype" value="userKey" onClick="SetEnrollmentType('userKey');">UserKey
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td><p class="bodyText">Token PIN:</p></td>
+ <td><input type="password" id="pintf" id="pintf" name="pintf" value=""></td>
+ <td><p class="bodyText">Re-Enter PIN:</p></td>
+ <td><input type="password" id="reenterpintf" id="reenterpintf" name="reenterpintf" value=""></td>
+ </tr>
+ </table>
+ <br>
+ <table width="100%">
+ <tr>
+ <td valign="center" align="left">
+ <input type="button" id="resetpinbtn" name="resetpinbtn" value="Reset PIN" onClick="DoResetSelectedCOOLKeyPIN();">
+ <!-- <input type="button" id="formatbtn" name="formatbtn" value="Format" onClick="DoFormatCOOLKey();"> -->
+ <!-- <input type="button" id="challengebtn" name="challengebtn" value="Challenge" onClick="DoChallengeSelectedKey();"> -->
+ <input type="button" id="blinkbtn" name="blinkbtn" value="Blink" onClick="DoBlinkCOOLKey();">
+ <input type="button" id="canclebtn" name="canclebtn" value="Cancel" onClick="DoCancelOperation();">
+
+ <!-- <input type="button" id="helpbtn" name="helpbtn" value="Help" onClick="DoHelp();"> -->
+ </td>
+ </tr>
+ </table>
+ <table width="100%">
+ <tr>
+ <!-- <td valign="center" align="right">
+ <h5><a href="esc.cgi?">Enterprise Security Admin Page</a></h5>
+ </td> -->
+ </tr>
+ </table>
+ </form>
+ <table width="100%">
+ <tr>
+ <td valign="center" align="left" style="width: 200px;">
+ <div id="cylon1" class="cylon" style="width: 200px; height: 10px;">
+ <div id="eye1" class="cylonEye" style="top: 0px; left: 0px; width: 28px; height: 8px; visibility: hidden;"></div>
+ </div>
+ </td>
+ <td valign="center" align="left" id="statusMsg"></td>
+ </tr>
+ </table>
+</body></html>
diff --git a/pki/linux/tps-ui/shared/docroot/esc/EnrollPopup.html b/pki/linux/tps-ui/shared/docroot/esc/EnrollPopup.html
new file mode 100755
index 000000000..46cd6d450
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/EnrollPopup.html
@@ -0,0 +1,1718 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+
+<head>
+<link rel=stylesheet href="/style.css" type="text/css">
+
+<script language="JavaScript">
+
+//
+// initialize netkey globals
+var netkey;
+var isMSHTML;
+
+
+var keyUITable = new Array();
+var keyTypeTable = new Array();
+var curChildWindow = null;
+
+function getUIForKey(aKeyID)
+{
+ return keyUITable[aKeyID];
+
+}
+
+function getTypeForKey(aKeyID)
+{
+ return keyTypeTable[aKeyID];
+}
+
+//
+// Determine if we are running MSHTML or GECKO
+//
+if (navigator.userAgent.indexOf("MSIE") != -1) {
+ isMSHTML = true;
+} else {
+ isMSHTML = false;
+}
+
+
+//
+// Notify callback for GECKO
+//
+function jsNotify() {}
+
+jsNotify.prototype = {
+
+ rhNotifyKeyStateChange: function(aKeyType,aKeyID,aKeyState,aData,strData)
+ {
+ OnCOOLKeyStateChange(aKeyType, aKeyID, aKeyState, aData,strData);
+ },
+
+ QueryInterface: function(iid)
+ {
+ <!-- alert("iid: " + iid); -->
+ if(!iid.equals(Components.interfaces.rhIKeyNotify) &&
+ !iid.equals(Components.interfaces.nsISupports))
+ {
+ alert("Can't find jsNotify interface");
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+ }
+ return this;
+ }
+};
+
+//
+// Attach to the object.
+//
+if (!isMSHTML) {
+ // GECKO ONLY initialization
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey = Components.classes["@redhat.com/rhCoolKey"].getService();
+ netkey = netkey.QueryInterface(Components.interfaces.rhICoolKey);
+ gNotify = new jsNotify;
+ netkey.rhCoolKeySetNotifyCallback(gNotify);
+ } catch(e) {
+ alert("Can't get UniversalXPConnect: " + e);
+ }
+} else {
+ // MSHTML only initialization
+ netkey = external;
+}
+
+//
+// unregister our notify event
+//
+function cleanup()
+{
+ if (!isMSHTML) {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.rhCoolKeyUnSetNotifyCallback(gNotify);
+ } catch(e) {
+ alert("Can't get UniversalXPConnect: " + e);
+ }
+ }
+}
+
+var gScreenName = "";
+var gKeyEnrollmentType = "userKey";
+
+var gCurrentSelectedRow = null;
+
+
+var gCurKeyType = null;
+var gCurKeyID = null;
+
+////////////////////////////////////////////////////////////////
+//
+// Utility functions specific to this page.
+//
+////////////////////////////////////////////////////////////////
+
+
+// List of Error Messages to be printed out
+
+var Status_Messages = new Array(
+
+"Operation Completed Successfully.",
+ "Server Error.",
+ "Problem communicating with the token.",
+ "Problem communicating with the token.",
+ "Problem resetting token's pin.",
+ "Internal Server Error.",
+ "Internal Server Error",
+ "Token Enrollment Error.",
+ "Problem communicating with the token.",
+ "Internal Server Error",
+ "Error communicating with the Certificate Authority, try again later.",
+ "Internal Server Error.",
+ "Error resetting the token's pin.",
+ "Internal Server Error.",
+ "Authentication Failure, Try Again.",
+ "Internal Server Error",
+ "Token is disabled, contact technical support.",
+ "Problem communicating with the token.",
+ "Internal Server Error.",
+ "Cannot upgrade token software.",
+ "Internal Server Error.",
+ "Problem communicating with the token.",
+ "Invalid token type.",
+ "Invalid token type",
+ "Cannot publish.",
+ "Cannot communicate with token database, try again later.",
+ "Token is disabled, contact techincal support.",
+ "Cannot reset pin value for the token, contact technical support.",
+ "Connection to server lost.",
+ "Cannot create entry for token in database, contact technical support.",
+ "No such token state, contact technical support.",
+ "Invalid lost token reason, contact technical support.",
+ "Token unusable due to compromise,contact technical support.",
+ "No such inactive token, contact technical support.",
+ "Cannot process more than one active token.",
+ "Internal Server Error,contact technical support.",
+ "Key Recovery has been processed.",
+ "Key Recovery failed, contact technical support.",
+ "Cannot operate on token reported lost, contact technical support.",
+ "Key archival error, contact technical support.",
+ "Problem connecting to the TKS, contact technical support.",
+ "Failed to update token database, contact technical support.",
+ "Internal certificate revocation error,contact technical support.",
+ "User does not own this token, contact technical support."
+);
+
+function GetAuthDataFromPopUp(aKeyType,aKeyID,aUiData)
+{
+
+ keyUITable[aKeyID] = aUiData;
+ keyTypeTable[aKeyID] = aKeyType;
+
+ //alert("GetAuthDataFromPopUp data " + aUiData);
+ var child = window.open("/GenericAuth.html",aKeyID,"height=400,width=400");
+
+ //alert("Attempted to create child window " + child);
+
+ curChildWindow = child;
+
+}
+
+function COOLKeySetDataValue(aKeyType,aKeyID,name,value)
+{
+ //alert("In COOLKeySetDataValue aKeyType " + aKeyType + " aKeyID " + aKeyID + " name " + name + " value " + value);
+ if(netkey)
+ {
+ try {
+ if(!isMSHTML)
+ {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+
+ netkey.SetCoolKeyDataValue(aKeyType,aKeyID,name,value);
+
+
+ } catch(e) {
+ alert("Error Setting data values: " + e);
+ }
+ }
+
+}
+
+function COOLKeySetTokenPin(pin)
+{
+ if(!isMSHTML)
+ {
+ if(netkey)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"TokenPin",pin);
+
+
+ } catch(e) {
+ alert("Error Setting data values: " + e);
+ }
+ }
+ }
+}
+
+function COOLKeySetUidPassword(uid,pwd)
+{
+
+ if(!isMSHTML)
+ {
+ if(netkey)
+ {
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"UserId",uid);
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"Password",pwd);
+
+ } catch(e) {
+ alert("Error Setting data values: " + e);
+ }
+
+ }
+
+ }
+
+}
+
+
+function MyGetErrorMessage(status_code)
+{
+
+ var result = "Internal Server Error";
+
+ if(status_code < 0 && status_code >= Status_Messages.length)
+ {
+ return result;
+
+ }
+
+ return Status_Messages[status_code];
+
+}
+
+function KeyToRowID(keyType, keyID)
+{
+ return keyType + "--" + keyID;
+}
+
+function RowIDToKeyInfo(rowID)
+{
+ return rowID.split("--");
+}
+
+function GetRowForKey(keyType, keyID)
+{
+ return document.getElementById(KeyToRowID(keyType, keyID));
+}
+
+function ReportException(msg, e)
+{
+ alert(msg + " " + e.description + "(" + e.number + ")");
+}
+
+function GetCOOLKeyStatus(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyStatus(keyType, keyID);
+ } catch (e) {
+ ReportException("netkey.GetCOOLKeyStatus() failed!", e);
+ return 0;
+ }
+}
+
+function GetCOOLKeyPolicy(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyPolicy(keyType, keyID);
+ } catch (e) {
+ // ReportException("netkey.GetCOOLKeyPolicy() failed!", e);
+ return "";
+ }
+}
+
+function GetCOOLKeyRequiresAuth(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyRequiresAuthentication(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyRequiresAuthentication() failed!", e);
+ return false;
+ }
+}
+
+function GetCOOLKeyIsAuthed(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyIsAuthenticated(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyIsAuthenticated() failed!", e);
+ return false;
+ }
+}
+
+function GetAvailableCOOLKeys()
+{
+ try {
+ var keyArr;
+
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var inArray = netkey.GetAvailableCoolKeys( {} );
+ keyArr = new Array(inArray.length);
+ var i;
+
+ for (i=0; i < keyArr.length; i++) {
+ keyArr[i] = new Array( "1", inArray[i]);
+ }
+ } else {
+ keyArr = ConvertVariantArrayToJScriptArray(netkey.GetAvailableCoolKeys());
+
+ var i;
+ for (i=0; i < keyArr.length; i++)
+ keyArr[i] = ConvertVariantArrayToJScriptArray(keyArr[i]);
+ }
+ return keyArr;
+ } catch(e) {
+ ReportException("netkey.GetAvailableCoolKeys() failed!", e);
+ return [];
+ }
+}
+
+function ChallengeCOOLKey(keyType, keyID, data)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return ConvertVariantArrayToJScriptArray(netkey.ChallengeCoolKey(keyType, keyID, data));
+ } catch(e) {
+ ReportException("netkey.ChallengeCoolKey() failed!", e);
+ return [];
+ }
+}
+
+function EnrollCOOLKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.EnrollCoolKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode);
+ } catch(e) {
+ ReportException("netkey.EnrollCoolKey() failed!", e);
+ return false;
+ }
+
+ return true;
+}
+
+function GetCOOLKeyIsEnrolled(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyIsEnrolled(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyIsEnrolled() failed!", e);
+ return false;
+ }
+}
+
+function ResetCOOLKeyPIN(keyType, keyID, screenname, pin,screennamepwd)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.ResetCoolKeyPIN(keyType, keyID, screenname, pin,screennamepwd);
+ } catch(e) {
+ ReportException("netkey.ResetCoolKeyPIN() failed! Make sure token is properly Enrolled.", e);
+ return false;
+ }
+ return true;
+}
+function FormatCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.FormatCoolKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode);
+ } catch(e) {
+ ReportException("netkey.FormatCoolKey() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+function CancelCOOLKeyOperation(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.CancelCoolKeyOperation(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.CancelCoolKeyOperation() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+function BlinkCOOLKey(keyType, keyID, rate, duration)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.BlinkCoolKey(keyType, keyID, rate, duration);
+ } catch(e) {
+ ReportException("netkey.BlinkCoolKey() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+function RequestServiceTicket(screenName, serviceName)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.RequestServiceTicket(screenName, serviceName);
+ } catch(e) {
+ ReportException("netkey..RequestServiceTicket() failed!", e);
+ return false;
+ }
+
+ return true;
+}
+
+//
+// MSHTML/GECKO compatibility functions.
+//
+function RemoveRow(table, row)
+{
+ if (isMSHTML) {
+ row.removeNode(row);
+ } else {
+ table.deleteRow(row.rowIndex);
+ }
+}
+
+function GetCell(row, index)
+{
+ var cell;
+
+ if (isMSHTML) {
+ cell = row.cells(index);
+ } else {
+ cell = row.cells[index];
+ }
+ return cell;
+}
+
+function GetNode(parent, index)
+{
+ var node;
+ if (isMSHTML) {
+ node = parent.childNodes(index);
+ } else {
+ node = parent.childNodes[index];
+ }
+ return node;
+}
+
+function InsertRow(table)
+{
+ var row;
+
+ if (isMSHTML) {
+ row = table.insertRow();
+ } else {
+ row = table.insertRow(table.rows.length);
+ }
+ return row;
+}
+
+function InsertCell(row)
+{
+ var cell;
+
+ if (isMSHTML) {
+ cell = row.insertCell();
+ } else {
+ cell = row.insertCell(row.cells.length);
+ }
+ return cell;
+}
+
+function RemoveAllChildNodes(parent)
+{
+ var numChildren = parent.childNodes.length;
+ var i;
+
+ i = numChildren;
+ while (numChildren)
+ {
+ parent.removeChild(GetNode(parent,0));
+ numChildren--;
+ }
+
+}
+
+
+function UpdateInfoForKeyID(keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ return;
+
+ var cell = GetCell(row,1)
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(keyStatus));
+
+// cell = GetCell(row,2);
+ // RemoveAllChildNodes(cell);
+ // cell.appendChild(document.createTextNode(reqAuth));
+
+ // cell = GetCell(row,3);
+ // RemoveAllChildNodes(cell);
+ // cell.appendChild(document.createTextNode(isAuthed));
+}
+
+function GetStatusForKeyID(keyType, keyID)
+{
+ var keyStatus = "BLANK";
+
+ var status;
+
+ try {
+ status = GetCOOLKeyStatus(keyType, keyID);
+ } catch(e) {
+ status = 0;
+ }
+
+ switch (status) {
+ case 0: // Unavailable
+ keyStatus = "UNAVAILABLE";
+ break;
+ case 1: // AppletNotFound
+ keyStatus = "NO APPLET";
+ break;
+ case 2: // Uninitialized
+ keyStatus = "UNINITIALIZED";
+ break;
+ case 3: // Unknown
+ keyStatus = "UNKNOWN";
+ break;
+ case 4: // Available
+ case 6: // UnblockInProgress
+ case 7: // PINResetInProgress
+ case 8: // RenewInProgress
+ keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ break;
+ case 5: // EnrollmentInProgress
+ keyStatus = "BUSY";
+ break;
+ break;
+ case 9: // FormatInProgress
+ keyStatus = "BUSY";
+ break;
+ }
+
+ return keyStatus;
+}
+
+function GetKeyStatusForKeyID(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ return "UNKNOWN";
+
+ var cell = GetCell(row,1);
+ return GetNode(cell,0).data;
+}
+
+function InsertCOOLKeyIntoBindingTable(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ {
+ var table = document.getElementById("BindingTable");
+ if (table)
+ {
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ row = CreateTableRow(table, keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ }
+
+ if (!row)
+ return null;
+ }
+
+ return row;
+}
+
+function ConvertVariantArrayToJScriptArray(varr)
+{
+ // C++ native methods, like netkey.GetAvailableCOOLKeys(), can only
+ // return variant SafeArrays, so to access the data inside, you must
+ // first convert it to a VBArray, and then call toArray() to convert
+ // it to a JScript array. Lame, but that's what it takes to
+ // use an array returned from an ActiveX component.
+
+ return new VBArray(varr).toArray();
+}
+
+function UpdateBindingTableAvailability()
+{
+ var arr = GetAvailableCOOLKeys();
+
+ if (!arr || arr.length < 1)
+ return;
+
+ var i;
+
+ for (i=0; i < arr.length; i++)
+ {
+ InsertCOOLKeyIntoBindingTable(arr[i][0], arr[i][1]);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(arr[i][0], arr[i][1]);
+ }
+}
+
+function InitializeBindingTable()
+{
+ UpdateBindingTableAvailability();
+ UpdateButtonStates();
+ // document.getElementById("snametf").value = gScreenName;
+}
+
+function KeyIsPresent(keyType, keyID)
+{
+ row = document.all.item(keyType, keyID);
+
+ if (!row)
+ return false;
+
+ return true;
+}
+
+function SetStatusMessage(str)
+{
+ var cell = document.getElementById("statusMsg");
+
+ if (!cell)
+ return;
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(str));
+}
+
+function UpdateButtonStates()
+{
+ if (gKeyEnrollmentType == "deviceKey")
+ {
+ // document.getElementById("snametf").disabled = true;
+ // document.getElementById("pintf").disabled = true;
+ // document.getElementById("reenterpintf").disabled = true;
+ // document.getElementById("snamepwd").disabled = true;
+ }
+ else
+ {
+ // document.getElementById("snametf").disabled = false;
+ // document.getElementById("pintf").disabled = false;
+ // document.getElementById("reenterpintf").disabled = false;
+ // document.getElementById("snamepwd").disabled = false;
+ }
+
+ if (gCurrentSelectedRow)
+ {
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+ var keyStatus = GetKeyStatusForKeyID(keyType, keyID);
+
+ var validKey = (keyStatus == "NETKEY" || keyStatus == "HOUSEKEY");
+ // document.getElementById("challengebtn").disabled = !validKey;
+ // document.getElementById("blinkbtn").disabled = false;
+ document.getElementById("enrollbtn").disabled = false;
+ //document.getElementById("formatbtn").disabled = false;
+// document.getElementById("resetpinbtn").disabled = !((keyStatus == "NETKEY") && (gKeyEnrollmentType == "userKey"));
+//document.getElementById("resetpinbtn").disabled = !((gKeyEnrollmentType == "userKey"));
+ }
+ else
+ {
+ document.getElementById("enrollbtn").disabled = true;
+ //document.getElementById("resetpinbtn").disabled = true;
+ //document.getElementById("formatbtn").disabled = true;
+ // document.getElementById("challengebtn").disabled = true;
+ //document.getElementById("blinkbtn").disabled = true;
+ }
+
+ refresh();
+}
+
+function SetEnrollmentType(type)
+{
+ gKeyEnrollmentType = type;
+ UpdateButtonStates();
+}
+
+function FindRow(node)
+{
+ while (node && node.tagName != "TR")
+ {
+ node = node.parentNode;
+ }
+
+ return node;
+}
+
+function SelectRow(row)
+{
+ if (!row || gCurrentSelectedRow == row)
+ return;
+
+ if (gCurrentSelectedRow)
+ gCurrentSelectedRow.removeAttribute("style");
+
+ gCurrentSelectedRow = row;
+ gCurrentSelectedRow.style.backgroundColor="rgb(200,200,200)";
+ UpdateButtonStates();
+}
+
+function SelectRowByKeyID(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ SelectRow(row);
+}
+
+function DoSelectRow(event)
+{
+ var row;
+
+ if (isMSHTML) {
+ row = FindRow(window.event.srcElement);
+ } else {
+ row = FindRow(event.parentNode);
+ }
+ SelectRow(row);
+}
+
+function KeyToUIString(keyType, keyID)
+{
+ // If it's an COOLKey, format the keyID string.
+
+ if (keyType == 1 && keyID.length == 20)
+ {
+ var re = /([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})/i;
+ keyID = keyID.replace(re, "$1-$2-$3-$4-$5").toLowerCase();
+ }
+
+ return keyID;
+}
+
+
+
+function CreateTableRow(table, keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+
+ var row = InsertRow(table);
+ if (!row)
+ return null;
+
+ row.setAttribute("id", KeyToRowID(keyType, keyID));
+
+
+ if (isMSHTML) {
+ row.onclick = DoSelectRow;
+ }
+
+ // Create the key ID cell.
+ cell = InsertCell(row);
+ cell.appendChild(document.createTextNode(KeyToUIString(keyType, keyID)));
+
+ cell.setAttribute("onClick", "DoSelectRow(this);");
+
+ // Create the keyStatus cell.
+ cell = InsertCell(row);
+ cell.appendChild(document.createTextNode(keyStatus));
+
+ // Create the requires auth cell.
+ // cell = InsertCell(row);
+ // cell.appendChild(document.createTextNode(reqAuth));
+
+ // Create the is auth'ed cell.
+ // cell = InsertCell(row);
+ //cell.appendChild(document.createTextNode(isAuthed));
+
+ // Create the status bar cell
+ cell = InsertCell(row);
+
+ var progressMeter = document.createElement("div");
+ progressMeter.setAttribute("id", KeyToProgressBarID(keyType, keyID));
+ progressMeter.className = "ProgressMeter";
+ progressMeter.style.width = "100px";
+ progressMeter.style.height = "1.5em";
+ progressMeter.setAttribute("value", 0);
+
+ var progressBar = document.createElement("div");
+ progressBar.className = "ProgressBar";
+ progressBar.style.width = "0px";
+ progressBar.style.height = "100%";
+ progressBar.style.visibility = "hidden";
+
+ var progressBarStatus = document.createElement("div");
+ progressBarStatus.className = "ProgressBarStatus";
+ progressBarStatus.appendChild(document.createTextNode(""));
+
+ progressMeter.appendChild(progressBar);
+ progressMeter.appendChild(progressBarStatus);
+ cell.appendChild(progressMeter);
+
+ return row;
+}
+
+gAnimationMSecs = 1000/30;
+
+function SetCylonTimer(cylonID, cylonEyeID)
+{
+ setTimeout("AnimateCylonStatusBar(\"" + cylonID +
+ "\", \"" + cylonEyeID + "\");", gAnimationMSecs);
+}
+
+function AnimateCylonStatusBar(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID);
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ return;
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (!eye)
+ return;
+
+ var dir = eye.getAttribute("direction");
+ var wid = parseInt(eye.style.width);
+ var cywid = parseInt(cylon.style.width);
+ var left = parseInt(eye.style.left);
+
+ var dx = 10;
+
+ if (!dir || dir >= 0)
+ {
+ left += dx;
+
+ if (left + wid > cywid)
+ {
+ left = cywid - wid;
+ eye.setAttribute("direction", "-1");
+ }
+ }
+ else
+ {
+ left -= dx;
+
+ if (left < 0)
+ {
+ left = 0;
+ eye.setAttribute("direction", "1");
+ }
+ }
+
+ eye.style.left = left + "px";
+
+ SetCylonTimer(cylonID, cylonEyeID);
+}
+
+function StartCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ {
+ cylon.setAttribute("cylonactive", "true");
+
+ var eye = document.getElementById(cylonEyeID);
+ if (eye)
+ {
+ eye.style.left = "0px";
+ eye.style.visibility = "visible";
+ }
+
+ SetCylonTimer(cylonID, cylonEyeID);
+ }
+}
+
+function StopCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (cylon)
+ cylon.removeAttribute("cylonactive");
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (eye)
+ eye.style.visibility = "hidden";
+}
+
+function GetProgressMeterValue(progMeterID)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return -1;
+
+ return parseInt(progMeter.getAttribute("value"));
+}
+
+function SetProgressMeterValue(progMeterID, value)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter || value < 0)
+ return;
+
+ if (value > 100)
+ value = 100;
+
+ var progBar = progMeter.firstChild;
+
+ if (value == 0)
+ {
+ progBar.style.width = "0px";
+ progBar.style.visibility = "hidden";
+ progMeter.setAttribute("value", 0);
+ return;
+ }
+
+ progBar.style.visibility = "visible";
+
+ var newWidth = parseInt(progMeter.style.width) * value / 100 - 2;
+
+ progBar.style.width = newWidth + "px";
+ progMeter.setAttribute("value", value);
+}
+
+function SetProgressMeterStatus(progMeterID, statusMsg)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return;
+
+ var progBar = progMeter.firstChild;
+
+ // If it exists, the meter status should be
+ // div that is the next sibling of the progressMeter.
+
+ var meterStatus = progBar.nextSibling;
+
+ // Just replace the data in the text node, it's much faster,
+ // and reduces flashing!
+
+ meterStatus.firstChild.replaceData(0, meterStatus.firstChild.length, statusMsg);
+}
+
+function ClearProgressBar(progMeterID)
+{
+ SetProgressMeterValue(progMeterID, 0);
+ SetProgressMeterStatus(progMeterID, "");
+}
+
+function KeyToProgressBarID(keyType, keyID)
+{
+ return "PM" + keyType + "-" + keyID;
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions that contact the server or talk directly to
+// ASC native code.
+//
+// ASC Native Functions:
+//
+// netkey.GetAvailableCOOLKeys()
+//
+// - Returns an ActiveX Variant SafeArray containing the ID for each key
+// that is currentlly plugged into the computer. Before accessing any
+// data in this array you must convert it to a JScript Array with a
+// call to ConvertVariantArrayToJScriptArray().
+//
+// netkey.GetCOOLKeyIsEnrolled(keyType, keyID)
+//
+// - Returns true if a key has been initialized, false if it hasn't.
+// Initialized means the card has been formatted with certificates
+// for either an COOL HouseKey or NetKey.
+//
+// netkey.EnrollCOOLKey(keyType, keyID, enrollmentType, screenName, pin)
+//
+// - Initiates an async connection to the RA to initialize a specific
+// key. If you want the key to be initialized as a HouseKey, you should
+// pass "houseKey" as the enrollmentType, and null values for both
+// screenName and pin. For a NetKey, use "netKey" as the enrollmentType,
+// and pass a valid screenName and pin.
+//
+// netkey.ChallengeCOOLKey(keyType, keyID, data)
+//
+// - Signs some data with the specified key, and returns the results
+// in an AcviteX Variant SafeArray. Before accessing any data in
+// this array, you must convert it to a JScript Array with a
+// call to ConvertVariantArrayToJScriptArray(). The elements in the
+// array are as follows:
+//
+// array[0] --> Length of the signed challenge data in binary form.
+// array[1] --> The signed challenge data as hex.
+// array[0] --> Length of the nonce data in binary form.
+// array[0] --> The nonce data as hex.
+//
+// netkey.BlinkCOOLKey(keyType, keyID, rate, duration)
+//
+// - Make a specific key blink at a given rate for a given duration.
+// rate and duration are specified in milliseconds.
+//
+////////////////////////////////////////////////////////////////
+
+function GetScreenNameValue()
+{
+ var sname = document.getElementById("snametf").value;
+
+ if (! sname)
+ {
+ alert("You must provide a valid screen name!");
+ return null;
+ }
+
+ return sname;
+}
+
+function GetPINValue()
+{
+ var pinVal = document.getElementById("pintf").value;
+ var rpinVal = document.getElementById("reenterpintf").value;
+
+ if (! pinVal)
+ {
+ alert("You must provide a valid Token PIN!");
+ return null;
+ }
+
+ if ( pinVal != rpinVal)
+ {
+ alert("The PIN values you entered don't match!");
+ return null;
+ }
+
+ return pinVal;
+}
+
+function GetScreenNamePwd()
+{
+
+ var pwd = document.getElementById("snamepwd").value;
+
+ if(!pwd)
+ {
+ alert("You must provide a valid User Password!");
+ return null;
+ }
+ return pwd;
+}
+
+function GetTokenCode()
+{
+
+ return null;
+}
+function DoEnrollCOOLKey()
+{
+
+ if (!gCurrentSelectedRow)
+ {
+ alert("Please select a key.");
+ return;
+ }
+
+ if(!Validate())
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ if (type == "userKey")
+ {
+ screenname = null; //GetScreenNameValue();
+
+ pin = GetPINValue();
+
+
+ screennamepwd = null; // GetScreenNamePwd();
+
+
+ tokencode = GetTokenCode();
+
+ SetStatusMessage("Enrolling UserKey \"" + KeyToUIString(keyType, keyID) + "\"...");
+ }
+ else
+ SetStatusMessage("Enrolling DeviceKey \"" + KeyToUIString(keyType, keyID) + "\"...");
+
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!EnrollCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+}
+
+function DoResetSelectedCOOLKeyPIN()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ if(!Validate())
+ return;
+
+ //alert("In DoResetSelectedCOOLKeyPIN!");
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var screenname = null;
+ var pin = null;
+ var screennamepwd = null;
+
+ if (GetCOOLKeyIsEnrolled(keyType, keyID))
+ {
+
+ SetStatusMessage("Resetting PIN for \"" + keyID + "\"...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!ResetCOOLKeyPIN(keyType, keyID, screenname, pin,screennamepwd))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+ }
+}
+
+function DoFormatCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+
+ if(!Validate())
+ return;
+
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ SetStatusMessage("Formatting \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!FormatCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+}
+function DoCancelOperation()
+{
+
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ SetStatusMessage("Cancel operation for \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ CancelCOOLKeyOperation(keyType, keyID);
+
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+}
+
+function DoChallengeSelectedKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Generating Challenge ...");
+
+ var challengeArray = ChallengeCOOLKey(keyType, keyID, document.forms[0].challengedata.value);
+
+ if (challengeArray.length != 4)
+ {
+ alert("Challenge for key \"" + KeyToUIString(keyType, keyID) + "\" failed!");
+ SetStatusMessage("");
+ return;
+ }
+
+ alert("ChallengeCOOLKey(\""+ KeyToUIString(keyType, keyID) + "\") returned:\n\n" +
+ "challenge[0]: " + challengeArray[0] + "\n" +
+ "challenge[1]: " + challengeArray[1] + "\n" +
+ "challenge[2]: " + challengeArray[2] + "\n" +
+ "challenge[3]: " + challengeArray[3] + "\n");
+
+ SetStatusMessage("");
+}
+
+function DoBlinkCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Blinking \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ BlinkCOOLKey(keyType, keyID, 400, 5000);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+}
+
+function OnCOOLKeyBlinkComplete(keyType,keyID)
+{
+ //StopCylonAnimation("cylon1", "eye1");
+ //SetStatusMessage(" ");
+}
+
+function DoHelp()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ var policy = GetCOOLKeyPolicy(keyType, keyID);
+ var type = PolicyToKeyType(policy);
+ alert("Policy: " + policy + "\n" + "Type: " + type);
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions called directly from ASC native code.
+//
+////////////////////////////////////////////////////////////////
+
+function OnCOOLKeyInserted(keyType, keyID)
+{
+ var row = InsertCOOLKeyIntoBindingTable(keyType, keyID);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(keyType, keyID);
+}
+
+
+function OnCOOLKeyRemoved(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ var table = document.getElementById("BindingTable");
+
+ if (row && table)
+ {
+ RemoveRow(table,row);
+
+ if (row == gCurrentSelectedRow)
+ gCurrentSelectedRow = null;
+ }
+
+ UpdateButtonStates();
+}
+
+var gKnownPolicies = [
+
+ // OID Value, precedence, name value
+
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.4", 4, "NETKEY" ], // Platinum - MyDoctor
+
+ // XXX: Remove the Old OIDs below, after the RA starts generating
+ // certificates with the OIDs listed above!
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.4", 4, "NETKEY" ] // Platinum - MyDoctor
+];
+
+function PolicyToKeyType(policy)
+{
+ return "ENROLLED";
+}
+
+function OldPolicyToKeyType(policy)
+{
+ var i, j;
+
+ var knownPoliciesIndex = -1;
+
+
+ var policies;
+
+
+ if (policy.indexOf(",")== -1)
+ {
+ policies = new Array(1);
+ policies[0] = policy;
+ }
+ else
+ {
+ policies = policy.split(",");
+ }
+
+ for (j = 0; j < policies.length; j++)
+ {
+ for (i = 0; i < gKnownPolicies.length; i++)
+ {
+ if (gKnownPolicies[i][0] == policies[j])
+ {
+ if (knownPoliciesIndex < gKnownPolicies[i][1])
+ knownPoliciesIndex = i;
+ }
+ }
+ }
+
+ if (knownPoliciesIndex == -1)
+ return "INITIALIZED";
+
+ return gKnownPolicies[knownPoliciesIndex][2];
+}
+
+function BoolToYesNoStr(b)
+{
+ if (b)
+ return "YES";
+ return "NO";
+}
+
+function OnCOOLKeyEnrollmentComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ alert("Enrollment for \"" + KeyToUIString(keyType, keyID) + "\" was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyPINResetComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ alert("PIN Reset was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyFormatComplete(keyType, keyID)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ alert("Format of \"" + KeyToUIString(keyType, keyID)+ "\" was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyStateError(keyType, keyID, keyState, errorCode)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ if(curChildWindow)
+ {
+ curChildWindow.close();
+ curChildWindow = null;
+
+ }
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+
+ var typeStr = "Error(" + errorCode + ")";
+
+ var messageStr = " \n\n Server Response: " + MyGetErrorMessage(errorCode) ;
+
+ var keyIDStr = KeyToUIString(keyType, keyID);
+
+ if (keyState == 1004)
+ typeStr = "Enrollment of key (" + keyIDStr + ") failed. " + typeStr + messageStr ;
+ else if (keyState == 1016)
+ typeStr = "Formatting of key (" + keyIDStr + ") failed. " + typeStr + messageStr;
+ else if (keyState == 1010)
+ typeStr = "PIN Reset for key (" + keyIDStr + ") failed. " + typeStr + messageStr;
+ else if (keyState == 1020)
+ typeStr = "Operation for key (" + keyIDStr + ") canceled.";
+
+ alert(typeStr);
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyStatusUpdate(progMeterID, statusUpdate)
+{
+ SetProgressMeterValue(progMeterID, statusUpdate);
+ SetProgressMeterStatus(progMeterID, statusUpdate + "%");
+}
+
+function Validate()
+{
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ if (type == "userKey")
+ {
+// screenname = GetScreenNameValue();
+// if (! screenname)
+ // return 0;
+
+ pin = GetPINValue();
+
+ if (! pin)
+ return 0;
+
+// screennamepwd = GetScreenNamePwd();
+
+// if(! screennamepwd)
+ // return 0;
+
+ }
+
+ return 1;
+}
+
+function OnCOOLKeyStateChange(keyType, keyID, keyState, data,strData)
+{
+ // alert("KeyID: " + keyID + "\n" +
+ // "KeyState: " + keyState + "\n" +
+ // "Data: " + data);
+ //alert("State Change ="+keyState);
+
+ switch(keyState)
+ {
+ case 1000: // KeyInserted
+ OnCOOLKeyInserted(keyType, keyID);
+ break;
+ case 1001: // KeyRemoved
+ OnCOOLKeyRemoved(keyType, keyID);
+ break;
+ case 1002: // EnrollmentStart
+ // OnCOOLKeyEnrollmentStart(keyType, keyID);
+ break;
+ case 1003: // EnrollmentComplete
+ OnCOOLKeyEnrollmentComplete(keyType, keyID);
+ break;
+ case 1004: // EnrollmentError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1008: // PINResetStart
+ // OnCOOLKeyPINResetStart(keyType, keyID);
+ break;
+ case 1009: // PINResetComplete
+ OnCOOLKeyPINResetComplete(keyType, keyID);
+ break;
+ case 1010: // PINResetError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1014: // FormatStart
+ // OnCOOLKeyFormatStart(keyType, keyID);
+ break;
+ case 1015: // FormatComplete
+ OnCOOLKeyFormatComplete(keyType, keyID);
+ break;
+ case 1016: // FormatError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1017: // BlinkStatus Update?
+ //OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1018:
+ OnCOOLKeyBlinkComplete(keyType, keyID);
+ break;
+ case 1020: // OperationCancelled
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1021: // OperationStatusUpdate
+ OnCOOLKeyStatusUpdate(KeyToProgressBarID(keyType, keyID), data);
+ break;
+
+ case 1022: //Need Auth
+
+
+ gCurKeyID = keyID;
+ gCurKeyType = keyType;
+
+ GetAuthDataFromPopUp(keyType,keyID,strData);
+
+ break;
+
+ }
+}
+
+function refresh()
+{
+ window.resizeBy(0,1);
+ window.resizeBy(0,-1);
+
+}
+
+</script>
+
+</head>
+<body onload="InitializeBindingTable();" onunload=cleanup()>
+<table width="100%">
+ <tr>
+ <td>
+<img src="../images/logo.gif">
+ </td>
+ <td>
+ <p class="headerText"><a href="esc.cgi?screenname=">Enterprise Security Client</a></p>
+ </td>
+ <tr>
+</table>
+ <br>
+ <table id="BindingTable" width="100%"><tbody>
+ <tr id="HeaderRow">
+ <th><p class="titleText">Key ID</p></th>
+ <th><p class="titleText">Key Status</p></th>
+<!-- <th><p class="titleText">Requires Auth</p></th>
+ <th><p class="titleText">Did Auth</p></th>
+-->
+ <th width="100"><p class="titleText">Progress</p></th>
+ </tr>
+ </tbody></table>
+ <form action="esc.cgi">
+ <input type="hidden" id="action" name="action" value="bind">
+ <input type="hidden" id="screenname" name="screenname" value="">
+ <input type="hidden" id="challengedata" name="challengedata" value="QVNDIHJvY2tzIHRoZSBwYXJ0eSE=">
+ <input type="hidden" id="signedchallenge" name="signedchallenge" value="">
+ <input type="hidden" id="signedchallengelength" name="signedchallengelength" value="">
+ <input type="hidden" id="nonce" name="nonce" value="">
+ <input type="hidden" id="noncelength" name="noncelength" value="">
+ <input type="hidden" id="keytype" name="keytype" value="">
+ <input type="hidden" id="keyid" name="keyid" value="">
+ <input type="hidden" id="keylabel" name="keylabel" value="">
+ <table width=100%>
+ <tr>
+ <td class="bodyText">
+ Select enrollment type: <input checked type="radio" id="keytype" name="keytype" value="userKey" onClick="SetEnrollmentType('userKey');">UserKey
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td><p class="bodyText">Token PIN:</p></td>
+ <td><input type="password" id="pintf" id="pintf" name="pintf" value=""></td>
+ <td><p class="bodyText">Re-Enter PIN:</p></td>
+ <td><input type="password" id="reenterpintf" id="reenterpintf" name="reenterpintf" value=""></td>
+ </tr>
+ </table>
+ <br>
+ <table width="100%">
+ <tr>
+ <td valign="center" align="left">
+ <input type="button" id="enrollbtn" name="enrollbtn" value="Enroll" onClick="DoEnrollCOOLKey();">
+ <input type="button" id="canclebtn" name="canclebtn" value="Cancel" onClick="DoCancelOperation();">
+ </td>
+ </tr>
+ </table>
+ <table width="100%">
+ <tr>
+ <!-- <td valign="center" align="right">
+ <h5><a href="esc.cgi?">Enterprise Security Admin Page</a></h5>
+ </td> -->
+ </tr>
+ </table>
+ </form>
+ <table width="100%">
+ <tr>
+ <td valign="center" align="left" style="width: 200px;">
+ <div id="cylon1" class="cylon" style="width: 200px; height: 10px;">
+ <div id="eye1" class="cylonEye" style="top: 0px; left: 0px; width: 28px; height: 8px; visibility: hidden;"></div>
+ </div>
+ </td>
+ <td valign="center" align="left" id="statusMsg"></td>
+ </tr>
+ </table>
+</body></html>
diff --git a/pki/linux/tps-ui/shared/docroot/esc/GenericAuth.html b/pki/linux/tps-ui/shared/docroot/esc/GenericAuth.html
new file mode 100755
index 000000000..0e857c5da
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/GenericAuth.html
@@ -0,0 +1,537 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<style>
+
+body {
+background: #ffffff url(../images/bg.jpg) repeat-x;
+ font-family: arial;
+ font-size: 7pt;
+
+}
+
+h1
+{
+ text-align: left;
+
+ font-weight: bold;
+
+ font-size: 13pt;
+
+
+}
+
+
+h2 {
+
+ text-align: left;
+ font-size: 10pt;
+
+ font-weight: lighter;
+}
+
+</style>
+<script language = "Javascript">
+
+var test_ui = "id=USER_ID&name=User ID&desc=User ID&type=string&option=option1,option2,option3&&id=USER_PWD&name=User Password&desc=User Password&type=password&option=&&id=USER_PIN&name=PIN&desc=One time PIN received via mail&type=password&option=";
+
+var theForm = null;
+var curKeyID = null;
+var curKeyType = 0;
+
+
+var gTitle = null;
+var gDescription = null;
+
+
+
+function ConfirmPassword(password_element)
+{
+
+ if(!password_element)
+ return 0;
+
+ password_id = password_element.id;
+
+ if(!password_id)
+ return 0;
+
+ confirm_id = "RE_" + password_element.id;
+
+ var size = theForm.length;
+
+ if(theForm)
+ {
+ for(i = 0; i < size ; i++)
+ {
+ var cur_element = theForm.elements[i];
+
+ if(cur_element.id == confirm_id)
+ {
+ if(cur_element.value != password_element.value)
+ {
+ alert("Value " + password_element.name + " must match " + cur_element.name);
+ return 0;
+
+ }
+ else
+ {
+ return 1;
+ }
+
+ }
+
+ }
+
+ }
+
+ return 1;
+}
+
+function Validate()
+{
+ if(theForm)
+ {
+ var size = theForm.length;
+
+ for( i = 0; i < size ; i++)
+ {
+ var element = theForm.elements[i];
+
+ if(element.type == "text" )
+ {
+ if(element.value == "")
+ {
+ alert("Please enter value for " + element.name);
+ return 0;
+ }
+ }
+
+ if(element.type == "password")
+ {
+ if(element.value == "")
+ {
+ alert("Please enter value for " + element.name);
+ return 0;
+ }
+
+ if(!ConfirmPassword(element))
+ {
+ return 0;
+ }
+
+ }
+ }
+
+ }
+
+ return 1;
+}
+
+function FormSubmit()
+{
+ var result = Validate();
+
+ var thisParent = window.opener;
+
+ if(!parent)
+ {
+ alert("No parent window.");
+ window.close();
+ return;
+ }
+
+ if(!result)
+ {
+ return;
+ }
+
+ if(theForm)
+ {
+ var size = theForm.length;
+ for( i = 0; i < size ; i++)
+ {
+ var element = theForm.elements[i];
+
+ var value = element.value;
+
+ if(element.type == "text" )
+ {
+ var id = element.id;
+ value = element.value;
+
+ if(thisParent)
+ {
+ //alert("about to set data value key " + curKeyID + " id " + id + " value " + value);
+ thisParent.COOLKeySetDataValue(curKeyType,curKeyID,id,value);
+
+ }
+ }
+
+ if(element.type == "password")
+ {
+ var p_id = new String(element.id);
+
+ if(p_id.indexOf("RE_") == -1)
+ {
+ if(thisParent)
+ {
+ thisParent.COOLKeySetDataValue(curKeyType,curKeyID,p_id,value);
+ }
+ }
+ }
+ }
+
+ }
+
+ window.close();
+}
+
+function GetUIObjectList(uiData)
+{
+ var str = new String(uiData);
+ var splits = str.split("&&");
+
+// alert("Get " + splits + " len " + splits.length);
+
+ var params = new Array();
+ var size = splits.length;
+
+ for(i = 0 ; i < size ; i++)
+ {
+ params[i] = splits[i].split("&");
+ }
+
+ size = params.length;
+ var name_value_objects = new Array();
+
+ for(i = 0 ; i < size; i++)
+ {
+ var name_values = new Array();
+
+ pISize = params[i].length;
+ for(j = 0 ; j < pISize ; j ++)
+ {
+ var pair = params[i][j].split("=");
+
+ //alert(" pair " + pair[0] + " pair1 " + pair[1]);
+
+ if(pair[0] == "option")
+ {
+ var options = pair[1].split(",");
+ }
+
+ name_values[pair[0]] = pair[1];
+ }
+
+ name_value_objects[i] = name_values;
+ }
+
+ return name_value_objects;
+
+}
+
+function AddBRToNode(theNode)
+{
+
+ if(!theNode)
+ return;
+
+ var br = document.createElement("br");
+
+ theNode.appendChild(br);
+
+}
+
+function AddTextToNode(theNode,theText)
+{
+
+ if(!theNode || !theText)
+ return;
+
+
+ var text = document.createTextNode(theText);
+
+ theNode.appendChild(text);
+
+
+
+
+}
+function AddTextToDocument(theText)
+{
+ if(!theText)
+ return;
+
+ var p = document.createElement("p");
+
+ if(p)
+ {
+ p.appendChild(document.createTextNode(theText));
+ }
+
+ document.body.appendChild(p);
+}
+
+function CreateForm()
+{
+ var form = document.createElement("form");
+ document.body.appendChild(form);
+ return form;
+}
+
+function CreateTable()
+{
+ var table = document.createElement("table");
+ document.body.appendChild(table);
+ tbody = document.createElement("tbody");
+ table.appendChild(tbody);
+
+ return table;
+}
+
+function AddRowToTable(table)
+{
+ if(!table)
+ return null;
+
+ var tr = document.createElement("tr");
+ (table.tBodies[0]).appendChild(tr);
+
+ return tr;
+}
+
+function AddColumnToRow(row)
+{
+ if(!row)
+ return null;
+
+ var td = document.createElement("td");
+ row.appendChild(td);
+
+ return td;
+}
+
+function AddTextToColumn(column,text)
+{
+ if(!column || !text)
+ return;
+
+ var text_node = document.createTextNode(text);
+ column.appendChild(text_node);
+
+ return text_node;
+}
+
+function AddInputField(type,id, name,value)
+{
+ var field = document.createElement("input");
+
+ if(!field)
+ return null;
+
+ field.type = type;
+ field.id =id;
+ field.name =name;
+ field.value =value;
+
+ return field;
+}
+
+function ConstructUI(aKeyType,aKeyID,uiData)
+{
+
+ //alert("Construct UI data " + uiData);
+ var name_value_objects = GetUIObjectList(uiData);
+ var len = name_value_objects.length;
+
+ gTitle = document.createElement("h1");
+
+ gDescription = document.createElement("h2");
+
+
+ document.body.appendChild(gTitle);
+
+
+ document.body.appendChild(gDescription);
+
+
+ form = CreateForm();
+ theForm = form;
+ curKeyID = aKeyID;
+ curKeyType = aKeyType;
+
+ table = CreateTable();
+
+ form.appendChild(table);
+
+ for(i = 0 ; i < len ; i ++)
+ {
+ curParameter = name_value_objects[i];
+
+ if(curParameter)
+ {
+
+ title = curParameter["title"];
+
+
+ if(title)
+ {
+ //alert("title " + title);
+
+ AddTextToNode(gTitle,title);
+
+
+ }
+
+ description = curParameter["description"];
+
+ if(description)
+ {
+ AddBRToNode(document.body);
+ AddBRToNode(document.body);
+
+ AddTextToNode(gDescription,description);
+
+ AddBRToNode(document.body);
+
+ }
+
+ id = curParameter["id"];
+ name = curParameter["name"];
+ type = curParameter["type"];
+ desc = curParameter["desc"];
+
+ //alert(" id " + id + " name " + name + " type " + type + " desc " + desc);
+
+ if(id)
+ {
+ if(table)
+ {
+ row = AddRowToTable(table);
+ }
+
+ if(row)
+ {
+ column = AddColumnToRow(row);
+ }
+
+ if(column)
+ {
+ AddTextToColumn(column,name);
+ }
+
+ if(type == "string" || type == "integer")
+ {
+ field = AddInputField("text",id,name,"");
+ }
+
+ re_field = null;
+
+ if(type == "password")
+ {
+ field = AddInputField("password",id,name,"");
+ }
+
+ if(type == "hidden")
+ {
+ field = AddInputField("hidden",id,name,"");
+ }
+
+ if(field)
+ {
+ field_col = AddColumnToRow(row);
+ if(field_col)
+ {
+ field_col.appendChild(field);
+ }
+ }
+
+ if(re_field)
+ {
+ re_text = AddColumnToRow(row);
+
+ if(re_text)
+ {
+ AddTextToColumn(re_text,"Confirm " + name);
+ re_field_col = AddColumnToRow(row);
+ if(re_field_col)
+ {
+ re_field_col.appendChild(re_field);
+ }
+
+ }
+
+ }
+ }
+
+ }
+
+ }
+
+ var last_row = AddRowToTable(table);
+
+ if(last_row)
+ {
+ var button_field = AddColumnToRow(last_row);
+
+ if(button_field)
+ {
+ var button = AddInputField("button","Submit","Submit","Submit");
+ button.onclick = FormSubmit;
+ button_field.appendChild(button);
+
+ }
+
+ }
+}
+
+function UiLoad()
+{
+
+
+ var thisParent = window.opener;
+
+
+ if(!thisParent)
+ {
+ alert("Auth dialog has no parent!");
+ return;
+ }
+
+ var keyID = this.name;
+
+ var ui = thisParent.getUIForKey(keyID);
+
+ var type = thisParent.getTypeForKey(keyID);
+
+ //alert("UiLoad " + ui);
+
+ if(ui)
+ {
+ ConstructUI(type,keyID,ui);
+ }
+}
+
+</script>
+</head>
+<body onload = "UiLoad()">
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/docroot/esc/SettingsEsc.html b/pki/linux/tps-ui/shared/docroot/esc/SettingsEsc.html
new file mode 100755
index 000000000..9ffeb69a3
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/SettingsEsc.html
@@ -0,0 +1,738 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<head>
+
+<link rel=stylesheet href="/style.css" type="text/css">
+
+<script lang="JavaScript">
+//
+// initialize netkey globals
+var netkey;
+var gNotify = null;
+var isMSHTML;
+
+//
+// Determine if we are running MSHTML or GECKO
+//
+if (navigator.userAgent.indexOf("MSIE") != -1) {
+ isMSHTML = true;
+} else {
+ isMSHTML = false;
+}
+
+
+//
+// Notify callback for GECKO
+//
+function jsNotify() {}
+
+jsNotify.prototype = {
+
+ rhNotifyKeyStateChange: function(aKeyType,aKeyID,aKeyState,aData,strData)
+ {
+
+ OnCOOLKeyStateChange(aKeyType, aKeyID, aKeyState, aData);
+ },
+
+ QueryInterface: function(iid)
+ {
+ <!-- alert("iid: " + iid); -->
+ if(!iid.equals(Components.interfaces.rhIKeyNotify) &&
+ !iid.equals(Components.interfaces.nsISupports))
+ {
+ alert("Can't find jsNotify interface");
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+ }
+ return this;
+ }
+};
+
+//
+// Attach to the object.
+//
+if (!isMSHTML) {
+ // GECKO ONLY initialization
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey = Components.classes["@redhat.com/rhCoolKey"].getService();
+ netkey = netkey.QueryInterface(Components.interfaces.rhICoolKey);
+
+ gNotify = new jsNotify;
+
+ netkey.rhCoolKeySetNotifyCallback(gNotify);
+
+ } catch(e) {
+ alert("Can't get UniversalXPConnect: " + e);
+ }
+} else {
+ // MSHTML only initialization
+ netkey = external;
+}
+
+//
+// unregister our notify event
+//
+function cleanup()
+{
+ if (!isMSHTML) {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+
+ netkey.rhCoolKeyUnSetNotifyCallback(gNotify);
+ } catch(e) {
+ alert("Can't get UniversalXPConnect: " + e);
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////
+//
+// Host will be responsible for generating the gBindingsArray.
+//
+////////////////////////////////////////////////////////////////
+
+var gBindingsArray = [
+ <!-- SECURECOOL_BINDINGS_ARRAY -->
+];
+
+////////////////////////////////////////////////////////////////
+//
+// Utility functions specific to this page.
+//
+////////////////////////////////////////////////////////////////
+
+var gKeyBusyArray = [ ];
+
+function KeyToRowID(keyType, keyID)
+{
+ return keyType + "--" + keyID;
+}
+
+function RowIDToKeyInfo(rowID)
+{
+ return rowID.split("--");
+}
+
+function GetRowForKey(keyType, keyID)
+{
+ return document.getElementById(KeyToRowID(keyType, keyID));
+}
+
+function LoadBindingsIntoTable()
+{
+ var table = document.getElementById("KeyTable");
+
+ if (table)
+ {
+ var i;
+ for (i=0; i < gBindingsArray.length; i++)
+ {
+ CreateTableRow(table, gBindingsArray[i][0], gBindingsArray[i][1], false,
+ gBindingsArray[i][2], true);
+ }
+ }
+}
+
+function InsertCOOLKeyIntoBindingTable(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ {
+ var table = document.getElementById("KeyTable");
+ if (table)
+ {
+ // The assumption here is that if the key isn't already
+ // listed in the table, then it must be a new unbound key!
+
+ row = CreateTableRow(table, keyType, keyID, true, keyID, false);
+ }
+
+ if (!row)
+ return null;
+ }
+ else if (IsKeyBound(keyType, keyID))
+ SetKeyIsVisible(row, true);
+
+ return row;
+}
+
+function ConvertVariantArrayToJScriptArray(varr)
+{
+ // C++ native methods, like netkey.GetAvailableCOOLKeys(), can only
+ // return variant SafeArrays, so to access the data inside, you must
+ // first convert it to a VBArray, and then call toArray() to convert
+ // it to a JScript array. Lame, but that's what it takes to
+ // use an array returned from an ActiveX component.
+
+ return new VBArray(varr).toArray();
+}
+
+function ReportException(msg, e)
+{
+ alert(msg + " " + e.description + "(" + e.number + ")");
+}
+
+function GetAvailableCOOLKeys()
+{
+ try {
+ var keyArr;
+
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var inArray = netkey.GetAvailableCoolKeys( {} );
+ keyArr = new Array(inArray.length);
+ var i;
+
+ for (i=0; i < keyArr.length; i++) {
+ keyArr[i] = new Array( "1", inArray[i]);
+ }
+ } else {
+ keyArr = ConvertVariantArrayToJScriptArray(netkey.GetAvailableCoolKeys());
+
+ var i;
+ for (i=0; i < keyArr.length; i++)
+ keyArr[i] = ConvertVariantArrayToJScriptArray(keyArr[i]);
+ }
+ return keyArr;
+ } catch(e) {
+ ReportException("netkey.GetAvailableCoolKeys() failed!", e);
+ return [];
+ }
+}
+
+function BlinkCOOLKey(keyType, keyID, rate, duration)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.BlinkCoolKey(keyType, keyID, rate, duration);
+ } catch(e) {
+ ReportException("netkey.BlinkCoolKey() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+//
+// MSHTML/GECKO compatibility functions.
+//
+function RemoveRow(table, row)
+{
+ if (isMSHTML) {
+ row.removeNode(row);
+ } else {
+ table.deleteRow(row.rowIndex);
+ }
+}
+
+function InsertRow(table)
+{
+ var row;
+
+ if (isMSHTML) {
+ row = table.insertRow();
+ } else {
+ row = table.insertRow(table.rows.length);
+ }
+ return row;
+}
+
+function InsertCell(row)
+{
+ var cell;
+
+ if (isMSHTML) {
+ cell = row.insertCell();
+ } else {
+ cell = row.insertCell(row.cells.length);
+ }
+ return cell;
+}
+
+function UpdateBindingTableAvailability()
+{
+ var arr = GetAvailableCOOLKeys();
+
+ if (!arr || arr.length < 1)
+ return;
+
+ var i;
+
+ for (i=0; i < arr.length; i++)
+ InsertCOOLKeyIntoBindingTable(arr[i][0], arr[i][1]);
+}
+
+function InitializeBindingTable()
+{
+ LoadBindingsIntoTable();
+ UpdateBindingTableAvailability();
+}
+
+function IsKeyBound(keyType, keyID)
+{
+
+ for (i=0; i < gBindingsArray.length; i++)
+ {
+ if (keyType == gBindingsArray[i][0] && keyID == gBindingsArray[i][1])
+ return true;
+ }
+
+ return false;
+}
+
+function COOLKeyIsBusy(keyType, keyID)
+{
+ for (i=0; i < gKeyBusyArray.length; i++)
+ {
+ if (keyType == gKeyBusyArray[i][0] && keyID == gKeyBusyArray[i][1])
+ return true;
+ }
+
+ return false;
+}
+
+function AddKeyToBusyArray(keyType, keyID)
+{
+ // If key is already in our array, nothing to do.
+ if (COOLKeyIsBusy(keyType, keyID))
+ return;
+
+ gKeyBusyArray.push(new Array(keyType, keyID));
+}
+
+function RemoveKeyFromBusyArray(keyType, keyID)
+{
+ for (i=0; i < gKeyBusyArray.length; i++)
+ {
+ if (keyType == gKeyBusyArray[i][0] && keyID == gKeyBusyArray[i][1])
+ gKeyBusyArray.splice(i, 1);
+ }
+}
+
+function SetKeyIsVisible(row, isVisible)
+{
+ if (!row) return;
+ var cell = row.cells(0);
+ if (!cell) return;
+
+ var v = "inherit";
+ if (!isVisible)
+ v = "hidden";
+ cell.firstChild.style.visibility = v;
+}
+
+function KeyToUIString(keyType, keyID)
+{
+ // If it's an COOLKey, format the keyID string.
+
+ if (keyType == 1 && keyID.length == 20)
+ {
+ var re = /([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})/i;
+ keyID = keyID.replace(re, "$1-$2-$3-$4-$5").toLowerCase();
+ }
+
+ return keyID;
+}
+
+function CreateTableRow(table, keyType, keyID, isAvailable, label, isSecured)
+{
+
+ var row = InsertRow(table);
+ if (!row)
+ return null;
+
+ row.setAttribute("id", KeyToRowID(keyType, keyID));
+
+ var keyIDStr = KeyToUIString(keyType, keyID);
+
+ if (label == keyID)
+ label = keyIDStr;
+
+ // Add a tooltip to the row so that it displays more info.
+ var title = keyType + " - " + keyIDStr;
+ if (isSecured && label)
+ title += " - " + label;
+ row.setAttribute("title", title);
+
+ // Create the isAvailable cell:
+ cell = InsertCell(row);
+ cell.setAttribute("align", "center");
+ var a = document.createElement("a");
+ a.setAttribute("href", "javascript:DoBlinkCOOLKey(" + keyType + ", '" + keyID + "');");
+ if (! isAvailable)
+ a.style.visibility = "hidden";
+ var img = document.createElement("img");
+ img.setAttribute("src", "../images/NetKey-Small.gif");
+ a.appendChild(img);
+ cell.appendChild(a);
+
+ // Create the label cell. Make sure we truncate long
+ // labels so that they fit nicely into the window.
+ cell = InsertCell(row);
+ if (label.length > 24)
+ label = label.substr(0, 24) + "...";
+ cell.appendChild(document.createTextNode(label));
+
+ // Create the action cell:
+ cell = InsertCell(row);
+ a = document.createElement("a");
+ if (isSecured)
+ {
+ // a.setAttribute("href", "javascript:UnbindCOOLKey(" + keyType + ", '" + keyID + "');");
+ a.appendChild(document.createTextNode("Release"));
+ }
+ else
+ {
+ // a.setAttribute("href", "javascript:BindCOOLKey(" + keyType + ", '" + keyID + "');");
+ a.appendChild(document.createTextNode("Secure"));
+ }
+ cell.appendChild(a);
+
+ // Create the secured cell:
+ cell = InsertCell(row);
+ cell.setAttribute("align", "center");
+ img = document.createElement("img");
+ img.setAttribute("src", "../images/PadLock.gif");
+ if (!isSecured)
+ img.style.visibility = "hidden";
+ cell.appendChild(img);
+
+ return row;
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions that contact the server or talk directly to
+// ASC native code.
+//
+// ASC Native Functions:
+//
+// netkey.GetAvailableCOOLKeys()
+//
+// - Returns an ActiveX Variant SafeArray containing the ID for each key
+// that is currentlly plugged into the computer. Before accessing any
+// data in this array you must convert it to a JScript Array with a
+// call to ConvertVariantArrayToJScriptArray().
+//
+// netkey.GetCOOLKeyIsEnrolled(keyType, keyID)
+//
+// - Returns true if a key has been initialized, false if it hasn't.
+// Initialized means the card has been formatted with certificates
+// for either an COOL HouseKey or NetKey.
+//
+// netkey.GetCOOLKeyStatus(keyType, keyID)
+//
+// - Returns an integer describing the status of the COOLKey. Possible
+// values are:
+//
+// 0 // Unavailable
+// 1 // AppletNotFound
+// 2 // Uninitialized
+// 3 // Unknown
+// 4 // Available
+// 5 // EnrollmentInProgress
+// 6 // UnblockInProgress
+// 7 // PINResetInProgress
+// 8 // RenewInProgress
+// 9 // FormatInProgress
+// 10 // BlinkInProgress
+//
+// netkey.GetCOOLKeyPolicy(keyType, keyID)
+//
+// - Retrieves the Certificate Policy Extension Object Identifier (OID)
+// as a string. This can be useful for distinguishing between types of
+// COOLKeys. The list of currently defined OIDS are:
+//
+// Bronze Member - Phase 1: OID.1.3.6.1.4.1.1066.1.1000.1.0.1.1
+// Silver Member - Phase 2: OID.1.3.6.1.4.1.1066.1.1000.1.0.1.2
+// Gold Associate - Phase 2: OID.1.3.6.1.4.1.1066.1.1000.1.0.1.3
+// Platinum MyDoctor - Phase 2: OID.1.3.6.1.4.1.1066.1.1000.1.0.1.4
+//
+// netkey.GetCOOLKeyRequiresAuthentication(keyType, keyID)
+//
+// - Returns a bool value that indicates whether or not the COOLKey
+// requires a PIN to access crypto functionality.
+//
+// netkey.AuthenticateCOOLKey(keyType, keyID, pin)
+//
+// - Attempts to authenticates to the COOLKey using the supplied
+// pin string.
+//
+// netkey.InitCOOLKey(keyType, keyID, screenName, pin)
+//
+// - Initiates an async connection to the RA to initialize a specific
+// key. If you want the key to be initialized as a HouseKey, you should
+// pass null values for both screenName and pin, otherwise, the key.
+// is formatted as a NetKey.
+//
+// netkey.ChallengeCOOLKey(keyType, keyID, data)
+//
+// - Signs some data with the specified key, and returns the results
+// in an AcviteX Variant SafeArray. Before accessing any data in
+// this array, you must convert it to a JScript Array with a
+// call to ConvertVariantArrayToJScriptArray(). The elements in the
+// array are as follows:
+//
+// array[0] --> Length of the signed challenge data in binary form.
+// array[1] --> The signed challenge data as hex.
+// array[0] --> Length of the nonce data in binary form.
+// array[0] --> The nonce data as hex.
+//
+// netkey.BlinkCOOLKey(keyType, keyID, rate, duration)
+//
+// - Make a specific key blink at a given rate for a given duration.
+// rate and duration are specified in milliseconds.
+//
+// netkey.RequestServiceTicket(screenName, serviceName)
+//
+// - Makes an async ticket request for a specific service.
+// The ticket is returned via the OnTicketRequestSuccess()
+// callback.
+//
+// netkey.CancelServiceTicketRequest(screenName, serviceName)
+//
+// - Cancels a specific service ticket request that may be pending.
+//
+////////////////////////////////////////////////////////////////
+
+function BindCOOLKey(keyType, keyID)
+{
+ if (COOLKeyIsBusy(keyType, keyID))
+ {
+ alert("COOLKey '" + keyID + "' is busy!");
+ return;
+ }
+
+ document.forms[0].action.value = "setlabelpage";
+ document.forms[0].keytype.value = keyType;
+ document.forms[0].keyid.value = keyID;
+ document.forms[0].submit();
+}
+
+function UnbindCOOLKey(keyType, keyID)
+{
+ if (COOLKeyIsBusy(keyType, keyID))
+ {
+ alert("COOLKey '" + keyID + "' is busy!");
+ return;
+ }
+
+ document.forms[0].action.value = "unbindprogresspage";
+ document.forms[0].keytype.value = keyType;
+ document.forms[0].keyid.value = keyID;
+ document.forms[0].submit();
+}
+
+function PurchaseMoreKeys()
+{
+}
+
+function LoadHelp()
+{
+ alert("- Click on the key icon for a specific key to make it blink.\n");
+}
+
+function DoBlinkCOOLKey(keyType, keyID)
+{
+ if (!keyID)
+ return;
+
+ BlinkCOOLKey(keyType, keyID, 400, 5000);
+}
+
+function OnCOOLKeyInserted(keyType, keyID)
+{
+ var row = InsertCOOLKeyIntoBindingTable(keyType, keyID);
+
+ refresh();
+}
+
+function OnCOOLKeyRemoved(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ var table = document.getElementById("KeyTable");
+ if (row && table)
+ {
+ if (IsKeyBound(keyType, keyID))
+ SetKeyIsVisible(row, false);
+ else
+ RemoveRow(table, row)
+ }
+
+ refresh();
+}
+
+function OnCOOLKeyBusyStart(keyType, keyID)
+{
+ AddKeyToBusyArray(keyType, keyID);
+}
+
+function OnCOOLKeyBusyEnd(keyType, keyID)
+{
+ RemoveKeyFromBusyArray(keyType, keyID);
+}
+
+function refresh()
+{
+ window.resizeBy(0,1);
+ window.resizeBy(0,-1);
+
+}
+
+////////////////////////////////////////////////////////////////////////////
+//
+// Notification functions called directly from ASC native code. These
+// functions will only be called if they exist in the current running
+// JavaScript context.
+//
+// OnCOOLKeyStateChange(keyType, keyID, keyState, data)
+//
+// - Called when the state of the COOLKey changes. Values for key
+//
+// keyState Description data
+// -------------------------------------------------------
+// 1000 Key Inserted <none>
+// 1001 Key Removed <none>
+// 1002 Enrollment Start <0=Phase1, 1=Phase2>
+// 1003 Enrollment Complete <none>
+// 1004 Enrollment Error Integer Error Code
+// 1005 Unblock Start <none>
+// 1006 Unblock Complete <none>
+// 1007 Unblock Error Integer Error Code
+// 1008 PIN Reset Start <none>
+// 1009 PIN Reset Complete <none>
+// 1010 PIN Reset Error Integer Error Code
+// 1011 Renew Start <none>
+// 1012 Renew Complete <none>
+// 1013 Renew Error Integer Error Code
+// 1014 Format Start <none>
+// 1015 Format Complete <none>
+// 1016 Format Error Integer Error Code
+// 1017 Blink Start <none>
+// 1018 Blink Complete <none>
+// 1019 Blink Error Integer Error Code
+// 1020 Operation Cancelled Integer Error Code
+//
+// OnTicketRequestSuccess(serviceName, ticket, authenticator)
+//
+// - Called when a service ticket request made with
+// netkey.RequestServiceTicket() completes successfully.
+// ticket is the Base64 encoded Kerberos ticket. authenticator
+// is the Base64 encoded authenticator.
+//
+// OnTicketRequestException(serviceName, errCode, errSubSystem, errMsg)
+//
+// - Called when a service ticket request made with
+// netkey.RequestServiceTicket() fails. serviceName is the service
+// name used when the request was made. errCode is the error code
+// defined by CLC. errSubSystem is the sub system defined by CLC.
+// errMsg is the string containing the error message to display. This
+// string is provided by UAS or CLC.
+//
+////////////////////////////////////////////////////////////////////////////
+
+function OnCOOLKeyStateChange(keyType, keyID, keyState, data)
+{
+ switch(keyState)
+ {
+ case 1000: // KeyInserted
+ OnCOOLKeyInserted(keyType, keyID);
+ break;
+ case 1001: // KeyRemoved
+ OnCOOLKeyRemoved(keyType, keyID);
+ break;
+ case 1002: // EnrollmentStart
+ case 1005: // UnblockStart
+ case 1008: // PINResetStart
+ case 1011: // RenewStart
+ case 1014: // FormatStart
+ OnCOOLKeyBusyStart(keyType, keyID);
+ break;
+ case 1003: // EnrollmentComplete
+ case 1004: // EnrollmentError
+ case 1006: // UnblockComplete
+ case 1007: // UnblockError
+ case 1009: // PINResetComplete
+ case 1010: // PINResetError
+ case 1012: // RenewComplete
+ case 1013: // RenewError
+ case 1015: // FormatComplete
+ case 1016: // FormatError
+ OnCOOLKeyBusyEnd(keyType, keyID);
+ break;
+ }
+}
+
+</script>
+</head>
+<body onLoad="InitializeBindingTable();" onUnload="cleanup();">
+
+<table width="100%">
+ <tr>
+ <td>
+<img src="../images/logo.gif"> </td>
+ <td>
+ <p class="headerText"><a href="esc.cgi?screenname=">Enterprise Security Client</a></p>
+ </td>
+ <tr>
+</table>
+
+<form method="post" action="esc.cgi">
+<input type="hidden" name="action" value="settingspage">
+<input type="hidden" name="screenname" value="<!-- SECURECOOL_SCREENNAME -->">
+<input type="hidden" name="keytype" value="">
+<input type="hidden" name="keyid" value="">
+<table class="PageHeader">
+</table>
+<table class="ContentTable">
+<tbody>
+<tr><td colspan="2">
+<b>Coolkey</b> (Enterprise Security Key) helps users perform various cryptographic operations.
+<br>
+Your Coolkey(s) and any other Coolkey(s) plugged into this computer are shown here.
+<br>
+<br>
+<div class="TableTitle">Coolkey(s) <!-- SECURECOOL_SCREENNAME --></div>
+</td></tr>
+<tr>
+ <td width="55%" valign="top">
+ <table id="KeyTable">
+ <tbody>
+ <tr class="KeyTableHeader">
+ <th></th>
+ <th><p class="titleText">Name</p></th>
+ <th></th>
+ <th><p class="titleText">Secured</p></th>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+</tr>
+</tbody>
+</table>
+</form>
+</body>
+</html>
+
diff --git a/pki/linux/tps-ui/shared/docroot/esc/TokenManager.html b/pki/linux/tps-ui/shared/docroot/esc/TokenManager.html
new file mode 100755
index 000000000..2f28889ef
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/TokenManager.html
@@ -0,0 +1,1706 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+
+<head>
+<link rel=stylesheet href="/style.css" type="text/css">
+
+<script language="JavaScript">
+
+//
+// initialize netkey globals
+var netkey;
+var isMSHTML;
+
+
+var keyUITable = new Array();
+var keyTypeTable = new Array();
+var curChildWindow = null;
+
+function getUIForKey(aKeyID)
+{
+ return keyUITable[aKeyID];
+
+}
+
+function getTypeForKey(aKeyID)
+{
+ return keyTypeTable[aKeyID];
+}
+
+//
+// Determine if we are running MSHTML or GECKO
+//
+if (navigator.userAgent.indexOf("MSIE") != -1) {
+ isMSHTML = true;
+} else {
+ isMSHTML = false;
+}
+
+
+//
+// Notify callback for GECKO
+//
+function jsNotify() {}
+
+jsNotify.prototype = {
+
+ rhNotifyKeyStateChange: function(aKeyType,aKeyID,aKeyState,aData,strData)
+ {
+ OnCOOLKeyStateChange(aKeyType, aKeyID, aKeyState, aData,strData);
+ },
+
+ QueryInterface: function(iid)
+ {
+ <!-- alert("iid: " + iid); -->
+ if(!iid.equals(Components.interfaces.rhIKeyNotify) &&
+ !iid.equals(Components.interfaces.nsISupports))
+ {
+ alert("Can't find jsNotify interface");
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+ }
+ return this;
+ }
+};
+
+//
+// Attach to the object.
+//
+if (!isMSHTML) {
+ // GECKO ONLY initialization
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey = Components.classes["@redhat.com/rhCoolKey"].getService();
+ netkey = netkey.QueryInterface(Components.interfaces.rhICoolKey);
+ gNotify = new jsNotify;
+ netkey.rhCoolKeySetNotifyCallback(gNotify);
+ } catch(e) {
+ alert("Can't get UniversalXPConnect: " + e);
+ }
+} else {
+ // MSHTML only initialization
+ netkey = external;
+}
+
+//
+// unregister our notify event
+//
+function cleanup()
+{
+ if (!isMSHTML) {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.rhCoolKeyUnSetNotifyCallback(gNotify);
+ } catch(e) {
+ alert("Can't get UniversalXPConnect: " + e);
+ }
+ }
+}
+
+var gScreenName = "";
+var gKeyEnrollmentType = "userKey";
+
+var gCurrentSelectedRow = null;
+
+
+var gCurKeyType = null;
+var gCurKeyID = null;
+
+////////////////////////////////////////////////////////////////
+//
+// Utility functions specific to this page.
+//
+////////////////////////////////////////////////////////////////
+
+
+// List of Error Messages to be printed out
+
+var Status_Messages = new Array(
+
+"Operation Completed Successfully.",
+ "Server Error.",
+ "Problem communicating with the token.",
+ "Problem communicating with the token.",
+ "Problem resetting token's pin.",
+ "Internal Server Error.",
+ "Internal Server Error",
+ "Token Enrollment Error.",
+ "Problem communicating with the token.",
+ "Internal Server Error",
+ "Error communicating with the Certificate Authority, try again later.",
+ "Internal Server Error.",
+ "Error resetting the token's pin.",
+ "Internal Server Error.",
+ "Authentication Failure, Try Again.",
+ "Internal Server Error",
+ "Token is disabled, contact technical support.",
+ "Problem communicating with the token.",
+ "Internal Server Error.",
+ "Cannot upgrade token software.",
+ "Internal Server Error.",
+ "Problem communicating with the token.",
+ "Invalid token type.",
+ "Invalid token type",
+ "Cannot publish.",
+ "Cannot communicate with token database, try again later.",
+ "Token is disabled, contact techincal support.",
+ "Cannot reset pin value for the token, contact technical support.",
+ "Connection to server lost.",
+ "Cannot create entry for token in database, contact technical support.",
+ "No such token state, contact technical support.",
+ "Invalid lost token reason, contact technical support.",
+ "Token unusable due to compromise,contact technical support.",
+ "No such inactive token, contact technical support.",
+ "Cannot process more than one active token.",
+ "Internal Server Error,contact technical support.",
+ "Key Recovery has been processed.",
+ "Key Recovery failed, contact technical support.",
+ "Cannot operate on token reported lost, contact technical support.",
+ "Key archival error, contact technical support.",
+ "Problem connecting to the TKS, contact technical support.",
+ "Failed to update token database, contact technical support.",
+ "Internal certificate revocation error,contact technical support.",
+ "User does not own this token, contact technical support."
+);
+
+function GetAuthDataFromPopUp(aKeyType,aKeyID,aUiData)
+{
+
+ keyUITable[aKeyID] = aUiData;
+ keyTypeTable[aKeyID] = aKeyType;
+
+ //alert("GetAuthDataFromPopUp data " + aUiData);
+ var child = window.open("/GenericAuth.html",aKeyID,"height=400,width=400");
+
+ //alert("Attempted to create child window " + child);
+
+ curChildWindow = child;
+
+}
+
+function COOLKeySetDataValue(aKeyType,aKeyID,name,value)
+{
+ //alert("In COOLKeySetDataValue aKeyType " + aKeyType + " aKeyID " + aKeyID + " name " + name + " value " + value);
+ if(netkey)
+ {
+ try {
+ if(!isMSHTML)
+ {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+
+ netkey.SetCoolKeyDataValue(aKeyType,aKeyID,name,value);
+
+
+ } catch(e) {
+ alert("Error Setting data values: " + e);
+ }
+ }
+
+}
+
+function COOLKeySetTokenPin(pin)
+{
+ if(!isMSHTML)
+ {
+ if(netkey)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"TokenPin",pin);
+
+
+ } catch(e) {
+ alert("Error Setting data values: " + e);
+ }
+ }
+ }
+}
+
+function COOLKeySetUidPassword(uid,pwd)
+{
+
+ if(!isMSHTML)
+ {
+ if(netkey)
+ {
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"UserId",uid);
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"Password",pwd);
+
+ } catch(e) {
+ alert("Error Setting data values: " + e);
+ }
+
+ }
+
+ }
+
+}
+
+
+function MyGetErrorMessage(status_code)
+{
+
+ var result = "Internal Server Error";
+
+ if(status_code < 0 && status_code >= Status_Messages.length)
+ {
+ return result;
+
+ }
+
+ return Status_Messages[status_code];
+
+}
+
+function KeyToRowID(keyType, keyID)
+{
+ return keyType + "--" + keyID;
+}
+
+function RowIDToKeyInfo(rowID)
+{
+ return rowID.split("--");
+}
+
+function GetRowForKey(keyType, keyID)
+{
+ return document.getElementById(KeyToRowID(keyType, keyID));
+}
+
+function ReportException(msg, e)
+{
+ alert(msg + " " + e.description + "(" + e.number + ")");
+}
+
+function GetCOOLKeyStatus(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyStatus(keyType, keyID);
+ } catch (e) {
+ ReportException("netkey.GetESCKeyStatus() failed!", e);
+ return 0;
+ }
+}
+
+function GetCOOLKeyPolicy(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyPolicy(keyType, keyID);
+ } catch (e) {
+ // ReportException("netkey.GetESCKeyPolicy() failed!", e);
+ return "";
+ }
+}
+
+function GetCOOLKeyRequiresAuth(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyRequiresAuthentication(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetESCKeyRequiresAuthentication() failed!", e);
+ return false;
+ }
+}
+
+function GetCOOLKeyIsAuthed(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyIsAuthenticated(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetESCKeyIsAuthenticated() failed!", e);
+ return false;
+ }
+}
+
+function GetAvailableCOOLKeys()
+{
+ try {
+ var keyArr;
+
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var inArray = netkey.GetAvailableCoolKeys( {} );
+ keyArr = new Array(inArray.length);
+ var i;
+
+ for (i=0; i < keyArr.length; i++) {
+ keyArr[i] = new Array( "1", inArray[i]);
+ }
+ } else {
+ keyArr = ConvertVariantArrayToJScriptArray(netkey.GetAvailableCoolKeys());
+
+ var i;
+ for (i=0; i < keyArr.length; i++)
+ keyArr[i] = ConvertVariantArrayToJScriptArray(keyArr[i]);
+ }
+ return keyArr;
+ } catch(e) {
+ ReportException("netkey.GetAvailableESCKeys() failed!", e);
+ return [];
+ }
+}
+
+function ChallengeCOOLKey(keyType, keyID, data)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return ConvertVariantArrayToJScriptArray(netkey.ChallengeCoolKey(keyType, keyID, data));
+ } catch(e) {
+ ReportException("netkey.ChallengeESCKey() failed!", e);
+ return [];
+ }
+}
+
+function EnrollCOOLKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.EnrollCoolKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode);
+ } catch(e) {
+ ReportException("netkey.EnrollESCKey() failed!", e);
+ return false;
+ }
+
+ return true;
+}
+
+function GetCOOLKeyIsEnrolled(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ return netkey.GetCoolKeyIsEnrolled(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetESCKeyIsEnrolled() failed!", e);
+ return false;
+ }
+}
+
+function ResetCOOLKeyPIN(keyType, keyID, screenname, pin,screennamepwd)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.ResetCoolKeyPIN(keyType, keyID, screenname, pin,screennamepwd);
+ } catch(e) {
+ ReportException("netkey.ResetESCKeyPIN() failed! Make sure token is properly Enrolled.", e);
+ return false;
+ }
+ return true;
+}
+function FormatCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.FormatCoolKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode);
+ } catch(e) {
+ ReportException("netkey.FormatESCKey() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+function CancelCOOLKeyOperation(keyType, keyID)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.CancelCoolKeyOperation(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.CancelESCKeyOperation() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+function BlinkCOOLKey(keyType, keyID, rate, duration)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.BlinkCoolKey(keyType, keyID, rate, duration);
+ } catch(e) {
+ ReportException("netkey.BlinkESCKey() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+function RequestServiceTicket(screenName, serviceName)
+{
+ try {
+ if (!isMSHTML) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+ netkey.RequestServiceTicket(screenName, serviceName);
+ } catch(e) {
+ ReportException("netkey..RequestServiceTicket() failed!", e);
+ return false;
+ }
+
+ return true;
+}
+
+//
+// MSHTML/GECKO compatibility functions.
+//
+function RemoveRow(table, row)
+{
+ if (isMSHTML) {
+ row.removeNode(row);
+ } else {
+ table.deleteRow(row.rowIndex);
+ }
+}
+
+function GetCell(row, index)
+{
+ var cell;
+
+ if (isMSHTML) {
+ cell = row.cells(index);
+ } else {
+ cell = row.cells[index];
+ }
+ return cell;
+}
+
+function GetNode(parent, index)
+{
+ var node;
+ if (isMSHTML) {
+ node = parent.childNodes(index);
+ } else {
+ node = parent.childNodes[index];
+ }
+ return node;
+}
+
+function InsertRow(table)
+{
+ var row;
+
+ if (isMSHTML) {
+ row = table.insertRow();
+ } else {
+ row = table.insertRow(table.rows.length);
+ }
+ return row;
+}
+
+function InsertCell(row)
+{
+ var cell;
+
+ if (isMSHTML) {
+ cell = row.insertCell();
+ } else {
+ cell = row.insertCell(row.cells.length);
+ }
+ return cell;
+}
+
+function RemoveAllChildNodes(parent)
+{
+ var numChildren = parent.childNodes.length;
+ var i;
+
+ i = numChildren;
+ while (numChildren)
+ {
+ parent.removeChild(GetNode(parent,0));
+ numChildren--;
+ }
+
+}
+
+
+function UpdateInfoForKeyID(keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ return;
+
+ var cell = GetCell(row,1)
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(keyStatus));
+
+ // cell = GetCell(row,2);
+ // RemoveAllChildNodes(cell);
+ // cell.appendChild(document.createTextNode(reqAuth));
+
+ //cell = GetCell(row,3);
+ //RemoveAllChildNodes(cell);
+ //cell.appendChild(document.createTextNode(isAuthed));
+}
+
+function GetStatusForKeyID(keyType, keyID)
+{
+ var keyStatus = "BLANK";
+
+ var status;
+
+ try {
+ status = GetCOOLKeyStatus(keyType, keyID);
+ } catch(e) {
+ status = 0;
+ }
+
+ switch (status) {
+ case 0: // Unavailable
+ keyStatus = "UNAVAILABLE";
+ break;
+ case 1: // AppletNotFound
+ keyStatus = "NO APPLET";
+ break;
+ case 2: // Uninitialized
+ keyStatus = "UNINITIALIZED";
+ break;
+ case 3: // Unknown
+ keyStatus = "UNKNOWN";
+ break;
+ case 4: // Available
+ case 6: // UnblockInProgress
+ case 7: // PINResetInProgress
+ case 8: // RenewInProgress
+ keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ break;
+ case 5: // EnrollmentInProgress
+ keyStatus = "BUSY";
+ break;
+ break;
+ case 9: // FormatInProgress
+ keyStatus = "BUSY";
+ break;
+ }
+
+ return keyStatus;
+}
+
+function GetKeyStatusForKeyID(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ return "UNKNOWN";
+
+ var cell = GetCell(row,1);
+ return GetNode(cell,0).data;
+}
+
+function InsertCOOLKeyIntoBindingTable(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ {
+ var table = document.getElementById("BindingTable");
+ if (table)
+ {
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ row = CreateTableRow(table, keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ }
+
+ if (!row)
+ return null;
+ }
+
+ return row;
+}
+
+function ConvertVariantArrayToJScriptArray(varr)
+{
+ // C++ native methods, like netkey.GetAvailableCOOLKeys(), can only
+ // return variant SafeArrays, so to access the data inside, you must
+ // first convert it to a VBArray, and then call toArray() to convert
+ // it to a JScript array. Lame, but that's what it takes to
+ // use an array returned from an ActiveX component.
+
+ return new VBArray(varr).toArray();
+}
+
+function UpdateBindingTableAvailability()
+{
+ var arr = GetAvailableCOOLKeys();
+
+ if (!arr || arr.length < 1)
+ return;
+
+ var i;
+
+ for (i=0; i < arr.length; i++)
+ {
+ InsertCOOLKeyIntoBindingTable(arr[i][0], arr[i][1]);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(arr[i][0], arr[i][1]);
+ }
+}
+
+function InitializeBindingTable()
+{
+ UpdateBindingTableAvailability();
+ UpdateButtonStates();
+ // document.getElementById("snametf").value = gScreenName;
+}
+
+function KeyIsPresent(keyType, keyID)
+{
+ row = document.all.item(keyType, keyID);
+
+ if (!row)
+ return false;
+
+ return true;
+}
+
+function SetStatusMessage(str)
+{
+ var cell = document.getElementById("statusMsg");
+
+ if (!cell)
+ return;
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(str));
+}
+
+function UpdateButtonStates()
+{
+ if (gKeyEnrollmentType == "deviceKey")
+ {
+ // document.getElementById("snametf").disabled = true;
+ // document.getElementById("pintf").disabled = true;
+ // document.getElementById("reenterpintf").disabled = true;
+ // document.getElementById("snamepwd").disabled = true;
+ }
+ else
+ {
+ // document.getElementById("snametf").disabled = false;
+ // document.getElementById("pintf").disabled = false;
+ // document.getElementById("reenterpintf").disabled = false;
+ // document.getElementById("snamepwd").disabled = false;
+ }
+
+ if (gCurrentSelectedRow)
+ {
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+ var keyStatus = GetKeyStatusForKeyID(keyType, keyID);
+
+ var validKey = (keyStatus == "NETKEY" || keyStatus == "HOUSEKEY");
+ // document.getElementById("challengebtn").disabled = !validKey;
+ document.getElementById("blinkbtn").disabled = false;
+// document.getElementById("enrollbtn").disabled = false;
+ document.getElementById("formatbtn").disabled = false;
+// document.getElementById("resetpinbtn").disabled = !((keyStatus == "NETKEY") && (gKeyEnrollmentType == "userKey"));
+//document.getElementById("resetpinbtn").disabled = !((gKeyEnrollmentType == "userKey"));
+ }
+ else
+ {
+ //document.getElementById("enrollbtn").disabled = true;
+ // document.getElementById("resetpinbtn").disabled = true;
+ document.getElementById("formatbtn").disabled = true;
+ // document.getElementById("challengebtn").disabled = true;
+ document.getElementById("blinkbtn").disabled = true;
+ }
+
+ refresh();
+}
+
+function SetEnrollmentType(type)
+{
+ gKeyEnrollmentType = type;
+ UpdateButtonStates();
+}
+
+function FindRow(node)
+{
+ while (node && node.tagName != "TR")
+ {
+ node = node.parentNode;
+ }
+
+ return node;
+}
+
+function SelectRow(row)
+{
+ if (!row || gCurrentSelectedRow == row)
+ return;
+
+ if (gCurrentSelectedRow)
+ gCurrentSelectedRow.removeAttribute("style");
+
+ gCurrentSelectedRow = row;
+ gCurrentSelectedRow.style.backgroundColor="rgb(200,200,200)";
+ UpdateButtonStates();
+}
+
+function SelectRowByKeyID(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ SelectRow(row);
+}
+
+function DoSelectRow(event)
+{
+ var row;
+
+ if (isMSHTML) {
+ row = FindRow(window.event.srcElement);
+ } else {
+ row = FindRow(event.parentNode);
+ }
+ SelectRow(row);
+}
+
+function KeyToUIString(keyType, keyID)
+{
+ // If it's an COOLKey, format the keyID string.
+
+ if (keyType == 1 && keyID.length == 20)
+ {
+ var re = /([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})/i;
+ keyID = keyID.replace(re, "$1-$2-$3-$4-$5").toLowerCase();
+ }
+
+ return keyID;
+}
+
+
+
+function CreateTableRow(table, keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+
+ var row = InsertRow(table);
+ if (!row)
+ return null;
+
+ row.setAttribute("id", KeyToRowID(keyType, keyID));
+
+
+ if (isMSHTML) {
+ row.onclick = DoSelectRow;
+ }
+
+ // Create the key ID cell.
+ cell = InsertCell(row);
+ cell.appendChild(document.createTextNode(KeyToUIString(keyType, keyID)));
+
+ cell.setAttribute("onClick", "DoSelectRow(this);");
+
+ // Create the keyStatus cell.
+ cell = InsertCell(row);
+ cell.appendChild(document.createTextNode(keyStatus));
+
+ // Create the requires auth cell.
+ cell = InsertCell(row);
+ cell.appendChild(document.createTextNode(reqAuth));
+
+ // Create the is auth'ed cell.
+ cell = InsertCell(row);
+ cell.appendChild(document.createTextNode(isAuthed));
+
+ // Create the status bar cell
+ cell = InsertCell(row);
+
+ var progressMeter = document.createElement("div");
+ progressMeter.setAttribute("id", KeyToProgressBarID(keyType, keyID));
+ progressMeter.className = "ProgressMeter";
+ progressMeter.style.width = "100px";
+ progressMeter.style.height = "1.5em";
+ progressMeter.setAttribute("value", 0);
+
+ var progressBar = document.createElement("div");
+ progressBar.className = "ProgressBar";
+ progressBar.style.width = "0px";
+ progressBar.style.height = "100%";
+ progressBar.style.visibility = "hidden";
+
+ var progressBarStatus = document.createElement("div");
+ progressBarStatus.className = "ProgressBarStatus";
+ progressBarStatus.appendChild(document.createTextNode(""));
+
+ progressMeter.appendChild(progressBar);
+ progressMeter.appendChild(progressBarStatus);
+ cell.appendChild(progressMeter);
+
+ return row;
+}
+
+gAnimationMSecs = 1000/30;
+
+function SetCylonTimer(cylonID, cylonEyeID)
+{
+ setTimeout("AnimateCylonStatusBar(\"" + cylonID +
+ "\", \"" + cylonEyeID + "\");", gAnimationMSecs);
+}
+
+function AnimateCylonStatusBar(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID);
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ return;
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (!eye)
+ return;
+
+ var dir = eye.getAttribute("direction");
+ var wid = parseInt(eye.style.width);
+ var cywid = parseInt(cylon.style.width);
+ var left = parseInt(eye.style.left);
+
+ var dx = 10;
+
+ if (!dir || dir >= 0)
+ {
+ left += dx;
+
+ if (left + wid > cywid)
+ {
+ left = cywid - wid;
+ eye.setAttribute("direction", "-1");
+ }
+ }
+ else
+ {
+ left -= dx;
+
+ if (left < 0)
+ {
+ left = 0;
+ eye.setAttribute("direction", "1");
+ }
+ }
+
+ eye.style.left = left + "px";
+
+ SetCylonTimer(cylonID, cylonEyeID);
+}
+
+function StartCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ {
+ cylon.setAttribute("cylonactive", "true");
+
+ var eye = document.getElementById(cylonEyeID);
+ if (eye)
+ {
+ eye.style.left = "0px";
+ eye.style.visibility = "visible";
+ }
+
+ SetCylonTimer(cylonID, cylonEyeID);
+ }
+}
+
+function StopCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (cylon)
+ cylon.removeAttribute("cylonactive");
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (eye)
+ eye.style.visibility = "hidden";
+}
+
+function GetProgressMeterValue(progMeterID)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return -1;
+
+ return parseInt(progMeter.getAttribute("value"));
+}
+
+function SetProgressMeterValue(progMeterID, value)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter || value < 0)
+ return;
+
+ if (value > 100)
+ value = 100;
+
+ var progBar = progMeter.firstChild;
+
+ if (value == 0)
+ {
+ progBar.style.width = "0px";
+ progBar.style.visibility = "hidden";
+ progMeter.setAttribute("value", 0);
+ return;
+ }
+
+ progBar.style.visibility = "visible";
+
+ var newWidth = parseInt(progMeter.style.width) * value / 100 - 2;
+
+ progBar.style.width = newWidth + "px";
+ progMeter.setAttribute("value", value);
+}
+
+function SetProgressMeterStatus(progMeterID, statusMsg)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return;
+
+ var progBar = progMeter.firstChild;
+
+ // If it exists, the meter status should be
+ // div that is the next sibling of the progressMeter.
+
+ var meterStatus = progBar.nextSibling;
+
+ // Just replace the data in the text node, it's much faster,
+ // and reduces flashing!
+
+ meterStatus.firstChild.replaceData(0, meterStatus.firstChild.length, statusMsg);
+}
+
+function ClearProgressBar(progMeterID)
+{
+ SetProgressMeterValue(progMeterID, 0);
+ SetProgressMeterStatus(progMeterID, "");
+}
+
+function KeyToProgressBarID(keyType, keyID)
+{
+ return "PM" + keyType + "-" + keyID;
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions that contact the server or talk directly to
+// ASC native code.
+//
+// ASC Native Functions:
+//
+// netkey.GetAvailableCOOLKeys()
+//
+// - Returns an ActiveX Variant SafeArray containing the ID for each key
+// that is currentlly plugged into the computer. Before accessing any
+// data in this array you must convert it to a JScript Array with a
+// call to ConvertVariantArrayToJScriptArray().
+//
+// netkey.GetCOOLKeyIsEnrolled(keyType, keyID)
+//
+// - Returns true if a key has been initialized, false if it hasn't.
+// Initialized means the card has been formatted with certificates
+// for either an COOL HouseKey or NetKey.
+//
+// netkey.EnrollCOOLKey(keyType, keyID, enrollmentType, screenName, pin)
+//
+// - Initiates an async connection to the RA to initialize a specific
+// key. If you want the key to be initialized as a HouseKey, you should
+// pass "houseKey" as the enrollmentType, and null values for both
+// screenName and pin. For a NetKey, use "netKey" as the enrollmentType,
+// and pass a valid screenName and pin.
+//
+// netkey.ChallengeCOOLKey(keyType, keyID, data)
+//
+// - Signs some data with the specified key, and returns the results
+// in an AcviteX Variant SafeArray. Before accessing any data in
+// this array, you must convert it to a JScript Array with a
+// call to ConvertVariantArrayToJScriptArray(). The elements in the
+// array are as follows:
+//
+// array[0] --> Length of the signed challenge data in binary form.
+// array[1] --> The signed challenge data as hex.
+// array[0] --> Length of the nonce data in binary form.
+// array[0] --> The nonce data as hex.
+//
+// netkey.BlinkCOOLKey(keyType, keyID, rate, duration)
+//
+// - Make a specific key blink at a given rate for a given duration.
+// rate and duration are specified in milliseconds.
+//
+////////////////////////////////////////////////////////////////
+
+function GetScreenNameValue()
+{
+ var sname = document.getElementById("snametf").value;
+
+ if (! sname)
+ {
+ alert("You must provide a valid screen name!");
+ return null;
+ }
+
+ return sname;
+}
+
+function GetPINValue()
+{
+ var pinVal = document.getElementById("pintf").value;
+ var rpinVal = document.getElementById("reenterpintf").value;
+
+ if (! pinVal)
+ {
+ alert("You must provide a valid PIN!");
+ return null;
+ }
+
+ if ( pinVal != rpinVal)
+ {
+ alert("The PIN values you entered don't match!");
+ return null;
+ }
+
+ return pinVal;
+}
+
+function GetScreenNamePwd()
+{
+
+ var pwd = document.getElementById("snamepwd").value;
+
+ if(!pwd)
+ {
+ alert("You must provide a valid User Password!");
+ return null;
+ }
+ return pwd;
+}
+
+function GetTokenCode()
+{
+
+ return null;
+}
+function DoEnrollCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ {
+ alert("Please select a key.");
+ return;
+ }
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ if (type == "userKey")
+ {
+ screenname = null; //GetScreenNameValue();
+
+ pin = GetPINValue();
+
+
+ screennamepwd = null; // GetScreenNamePwd();
+
+
+ tokencode = GetTokenCode();
+
+ SetStatusMessage("Enrolling UserKey \"" + KeyToUIString(keyType, keyID) + "\"...");
+ }
+ else
+ SetStatusMessage("Enrolling DeviceKey \"" + KeyToUIString(keyType, keyID) + "\"...");
+
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!EnrollCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+}
+
+function DoResetSelectedCOOLKeyPIN()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ // if(!Validate())
+ // return;
+
+ //alert("In DoResetSelectedCOOLKeyPIN!");
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var screenname = null;
+ var pin = null;
+ var screennamepwd = null;
+
+ if (GetCOOLKeyIsEnrolled(keyType, keyID))
+ {
+
+ SetStatusMessage("Resetting PIN for \"" + keyID + "\"...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!ResetCOOLKeyPIN(keyType, keyID, screenname, pin,screennamepwd))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+ }
+}
+
+function DoFormatCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+
+ // if(!Validate())
+ // return;
+
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ SetStatusMessage("Formatting \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!FormatCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+}
+function DoCancelOperation()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ SetStatusMessage("Cancel operation for \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ CancelCOOLKeyOperation(keyType, keyID);
+
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+}
+
+function DoChallengeSelectedKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Generating Challenge ...");
+
+ var challengeArray = ChallengeCOOLKey(keyType, keyID, document.forms[0].challengedata.value);
+
+ if (challengeArray.length != 4)
+ {
+ alert("Challenge for key \"" + KeyToUIString(keyType, keyID) + "\" failed!");
+ SetStatusMessage("");
+ return;
+ }
+
+ alert("ChallengeCOOLKey(\""+ KeyToUIString(keyType, keyID) + "\") returned:\n\n" +
+ "challenge[0]: " + challengeArray[0] + "\n" +
+ "challenge[1]: " + challengeArray[1] + "\n" +
+ "challenge[2]: " + challengeArray[2] + "\n" +
+ "challenge[3]: " + challengeArray[3] + "\n");
+
+ SetStatusMessage("");
+}
+
+function DoBlinkCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Blinking \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ BlinkCOOLKey(keyType, keyID, 400, 5000);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+}
+
+function OnCOOLKeyBlinkComplete(keyType,keyID)
+{
+ //StopCylonAnimation("cylon1", "eye1");
+ //SetStatusMessage(" ");
+}
+
+function DoHelp()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ var policy = GetCOOLKeyPolicy(keyType, keyID);
+ var type = PolicyToKeyType(policy);
+ alert("Policy: " + policy + "\n" + "Type: " + type);
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions called directly from ASC native code.
+//
+////////////////////////////////////////////////////////////////
+
+function OnCOOLKeyInserted(keyType, keyID)
+{
+ var row = InsertCOOLKeyIntoBindingTable(keyType, keyID);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(keyType, keyID);
+}
+
+
+function OnCOOLKeyRemoved(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ var table = document.getElementById("BindingTable");
+
+ if (row && table)
+ {
+ RemoveRow(table,row);
+
+ if (row == gCurrentSelectedRow)
+ gCurrentSelectedRow = null;
+ }
+
+ UpdateButtonStates();
+}
+
+var gKnownPolicies = [
+
+ // OID Value, precedence, name value
+
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.4", 4, "NETKEY" ], // Platinum - MyDoctor
+
+ // XXX: Remove the Old OIDs below, after the RA starts generating
+ // certificates with the OIDs listed above!
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.4", 4, "NETKEY" ] // Platinum - MyDoctor
+];
+
+function PolicyToKeyType(policy)
+{
+ return "ENROLLED";
+}
+
+function OldPolicyToKeyType(policy)
+{
+ var i, j;
+
+ var knownPoliciesIndex = -1;
+
+
+ var policies;
+
+
+ if (policy.indexOf(",")== -1)
+ {
+ policies = new Array(1);
+ policies[0] = policy;
+ }
+ else
+ {
+ policies = policy.split(",");
+ }
+
+ for (j = 0; j < policies.length; j++)
+ {
+ for (i = 0; i < gKnownPolicies.length; i++)
+ {
+ if (gKnownPolicies[i][0] == policies[j])
+ {
+ if (knownPoliciesIndex < gKnownPolicies[i][1])
+ knownPoliciesIndex = i;
+ }
+ }
+ }
+
+ if (knownPoliciesIndex == -1)
+ return "INITIALIZED";
+
+ return gKnownPolicies[knownPoliciesIndex][2];
+}
+
+function BoolToYesNoStr(b)
+{
+ if (b)
+ return "YES";
+ return "NO";
+}
+
+function OnCOOLKeyEnrollmentComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ alert("Enrollment for \"" + KeyToUIString(keyType, keyID) + "\" was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyPINResetComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ alert("PIN Reset was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyFormatComplete(keyType, keyID)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ alert("Format of \"" + KeyToUIString(keyType, keyID)+ "\" was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyStateError(keyType, keyID, keyState, errorCode)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ if(curChildWindow)
+ {
+ curChildWindow.close();
+ curChildWindow = null;
+
+ }
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+
+ var typeStr = "Error(" + errorCode + ")";
+
+ var messageStr = " \n\n Server Response: " + MyGetErrorMessage(errorCode) ;
+
+ var keyIDStr = KeyToUIString(keyType, keyID);
+
+ if (keyState == 1004)
+ typeStr = "Enrollment of key (" + keyIDStr + ") failed. " + typeStr + messageStr ;
+ else if (keyState == 1016)
+ typeStr = "Formatting of key (" + keyIDStr + ") failed. " + typeStr + messageStr;
+ else if (keyState == 1010)
+ typeStr = "PIN Reset for key (" + keyIDStr + ") failed. " + typeStr + messageStr;
+ else if (keyState == 1020)
+ typeStr = "Operation for key (" + keyIDStr + ") canceled.";
+
+ alert(typeStr);
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyStatusUpdate(progMeterID, statusUpdate)
+{
+ SetProgressMeterValue(progMeterID, statusUpdate);
+ SetProgressMeterStatus(progMeterID, statusUpdate + "%");
+}
+
+function Validate()
+{
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ if (type == "userKey")
+ {
+// screenname = GetScreenNameValue();
+// if (! screenname)
+ // return 0;
+
+ pin = GetPINValue();
+
+ if (! pin)
+ return 0;
+
+// screennamepwd = GetScreenNamePwd();
+
+// if(! screennamepwd)
+ // return 0;
+
+ }
+
+ return 1;
+}
+
+function OnCOOLKeyStateChange(keyType, keyID, keyState, data,strData)
+{
+ // alert("KeyID: " + keyID + "\n" +
+ // "KeyState: " + keyState + "\n" +
+ // "Data: " + data);
+ //alert("State Change ="+keyState);
+
+ switch(keyState)
+ {
+ case 1000: // KeyInserted
+ OnCOOLKeyInserted(keyType, keyID);
+ break;
+ case 1001: // KeyRemoved
+ OnCOOLKeyRemoved(keyType, keyID);
+ break;
+ case 1002: // EnrollmentStart
+ // OnCOOLKeyEnrollmentStart(keyType, keyID);
+ break;
+ case 1003: // EnrollmentComplete
+ OnCOOLKeyEnrollmentComplete(keyType, keyID);
+ break;
+ case 1004: // EnrollmentError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1008: // PINResetStart
+ // OnCOOLKeyPINResetStart(keyType, keyID);
+ break;
+ case 1009: // PINResetComplete
+ OnCOOLKeyPINResetComplete(keyType, keyID);
+ break;
+ case 1010: // PINResetError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1014: // FormatStart
+ // OnCOOLKeyFormatStart(keyType, keyID);
+ break;
+ case 1015: // FormatComplete
+ OnCOOLKeyFormatComplete(keyType, keyID);
+ break;
+ case 1016: // FormatError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1017: // BlinkStatus Update?
+ //OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1018:
+ OnCOOLKeyBlinkComplete(keyType, keyID);
+ break;
+ case 1020: // OperationCancelled
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1021: // OperationStatusUpdate
+ OnCOOLKeyStatusUpdate(KeyToProgressBarID(keyType, keyID), data);
+ break;
+
+ case 1022: //Need Auth
+
+
+ gCurKeyID = keyID;
+ gCurKeyType = keyType;
+
+ GetAuthDataFromPopUp(keyType,keyID,strData);
+
+ break;
+
+ }
+}
+
+function refresh()
+{
+ window.resizeBy(0,1);
+ window.resizeBy(0,-1);
+
+}
+
+</script>
+
+</head>
+<body onload="InitializeBindingTable();" onunload=cleanup()>
+
+<table width="100%">
+ <tr>
+ <td>
+<img src="../images/logo.gif"> </td>
+ <td>
+ <p class="headerText"><a href="esc.cgi?screenname=">Enterprise Security Client</a></p>
+ </td>
+ <tr>
+</table>
+
+ <br>
+ <table id="BindingTable" width="100%"><tbody>
+ <tr id="HeaderRow">
+ <th><p class="titleText">Key ID</p></th>
+ <th><p class="titleText">Key Status</p></th>
+<!-- <th><p class="titleText">Requires Auth</p></th>
+ <th><p class="titleText">Did Auth</p></th>
+
+-->
+ <th width="100"><p class="titleText">Progress</p></th>
+ </tr>
+ </tbody></table>
+ <form action="esc.cgi">
+ <input type="hidden" id="action" name="action" value="bind">
+ <input type="hidden" id="screenname" name="screenname" value="">
+ <input type="hidden" id="challengedata" name="challengedata" value="QVNDIHJvY2tzIHRoZSBwYXJ0eSE=">
+ <input type="hidden" id="signedchallenge" name="signedchallenge" value="">
+ <input type="hidden" id="signedchallengelength" name="signedchallengelength" value="">
+ <input type="hidden" id="nonce" name="nonce" value="">
+ <input type="hidden" id="noncelength" name="noncelength" value="">
+ <input type="hidden" id="keytype" name="keytype" value="">
+ <input type="hidden" id="keyid" name="keyid" value="">
+ <input type="hidden" id="keylabel" name="keylabel" value="">
+ <br>
+ <table width="100%">
+ <tr>
+ <td valign="center" align="left">
+ <input type="button" id="formatbtn" name="formatbtn" value="Format" onClick="DoFormatCOOLKey();">
+ <!-- <input type="button" id="challengebtn" name="challengebtn" value="Challenge" onClick="DoChallengeSelectedKey();"> -->
+ <input type="button" id="blinkbtn" name="blinkbtn" value="Blink" onClick="DoBlinkCOOLKey();">
+
+ <input type="button" id="canclebtn" name="canclebtn" value="Cancel" onClick="DoCancelOperation();">
+
+
+ <!-- <input type="button" id="helpbtn" name="helpbtn" value="Help" onClick="DoHelp();"> -->
+ </td>
+ </tr>
+ </table>
+ <table width="100%">
+ <tr>
+ <!-- <td valign="center" align="right">
+ <h5><a href="esc.cgi?">Enterprise Security Admin Page</a></h5>
+ </td> -->
+ </tr>
+ </table>
+ </form>
+ <table width="100%">
+ <tr>
+ <td valign="center" align="left" style="width: 200px;">
+ <div id="cylon1" class="cylon" style="width: 200px; height: 10px;">
+ <div id="eye1" class="cylonEye" style="top: 0px; left: 0px; width: 28px; height: 8px; visibility: hidden;"></div>
+ </div>
+ </td>
+ <td valign="center" align="left" id="statusMsg"></td>
+ </tr>
+ </table>
+</body></html>
diff --git a/pki/linux/tps-ui/shared/docroot/esc/TokenPin.html b/pki/linux/tps-ui/shared/docroot/esc/TokenPin.html
new file mode 100755
index 000000000..c73d6f108
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/TokenPin.html
@@ -0,0 +1,77 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 --- -->
+<html>
+<head>
+<style>
+body {
+ background-color: rgb(32%,71%,75%);
+ font-family: "Arial";
+ font-size: 8pt; }
+</style>
+
+<script language = "Javascript">
+function DoSubmitData()
+{
+ var pin = document.getElementById("tokenpin").value;
+
+ var pin_confirm = document.getElementById("tokenpincf").value;
+
+ if(!pin || !pin_confirm )
+ {
+ alert("Please Enter Valid Token Pin and confirmation value!");
+
+ return;
+ }
+ var parent = window.opener;
+
+ if(parent)
+ {
+ parent.COOLKeySetTokenPin(pin);
+
+ }
+ window.close();
+}
+</script>
+</head>
+<body>
+<b>Please Enter Your Token Pin:</b>
+<form>
+<table>
+<TR>
+<TD align="left">
+<font size=-2>Token Pin:</font><BR>
+<INPUT input type="password" id="tokenpin" name="tokenpin" value="" size=25><BR>
+</TD>
+</TR>
+<TR>
+<TD align="left">
+<font size=-2>Token Pin:(Confirm)</font><br>
+<INPUT type="password" id="tokenpincf" name="tokenpincf" value="" size=25><BR>
+</TD>
+</TR>
+<BR>
+<TR>
+<TD>
+<INPUT type ="button" id="Submit" value="Submit" onClick="DoSubmitData();"
+</TD>
+</TR>
+</table>
+</form>
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/docroot/esc/demo/EnrollSuccess.html b/pki/linux/tps-ui/shared/docroot/esc/demo/EnrollSuccess.html
new file mode 100644
index 000000000..c266efef4
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/demo/EnrollSuccess.html
@@ -0,0 +1,52 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<link rel=stylesheet href="/demo/style.css" type="text/css">
+<title>Success!</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
+<table width="100%" border="0" cellspacing="0" cellpadding="0" class="logobar">
+ <tr>
+ <td bgcolor="#000000">&nbsp;&nbsp;&nbsp;<img src="/demo/logo.jpg" width="250" height="50"></td>
+ </tr>
+</table>
+
+<p class="bodyText" >
+Congratulations! You have successfully Enrolled your Veracity Investments Security Smartcard! Now that you have enrolled, you will be able to use your smartcard to allow you and only you to log onto the Vercacity Investments On-Line Account Manager.
+
+</p>
+<p class="bodyText">
+
+Begin your journey into the world of safe and secure account access by logging on to the Veracity Investments On-Line Account Manager.
+
+</p>
+
+<!--
+<a href="https://veracity.test.com/login.cgi?">Veracity Investments Account Manager</a></p>
+
+-->
+
+</body>
+
+</html>
+
diff --git a/pki/linux/tps-ui/shared/docroot/esc/demo/GenericAuth.html b/pki/linux/tps-ui/shared/docroot/esc/demo/GenericAuth.html
new file mode 100755
index 000000000..7c3189a10
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/demo/GenericAuth.html
@@ -0,0 +1,538 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<style>
+
+body {
+background: #ffffff url(../images/bg.jpg) repeat-x;
+ font-family: arial;
+ font-size: 7pt;
+
+}
+
+h1
+{
+ text-align: left;
+
+ font-weight: bold;
+
+ font-size: 13pt;
+
+
+}
+
+
+h2 {
+
+ text-align: left;
+ font-size: 10pt;
+
+ font-weight: lighter;
+}
+
+</style>
+<script language = "Javascript">
+
+var test_ui = "id=USER_ID&name=User ID&desc=User ID&type=string&option=option1,option2,option3&&id=USER_PWD&name=User Password&desc=User Password&type=password&option=&&id=USER_PIN&name=PIN&desc=One time PIN received via mail&type=password&option=";
+
+var theForm = null;
+var curKeyID = null;
+var curKeyType = 0;
+
+
+var gTitle = null;
+var gDescription = null;
+
+
+
+function ConfirmPassword(password_element)
+{
+
+ if(!password_element)
+ return 0;
+
+ password_id = password_element.id;
+
+ if(!password_id)
+ return 0;
+
+ confirm_id = "RE_" + password_element.id;
+
+ var size = theForm.length;
+
+ if(theForm)
+ {
+ for(i = 0; i < size ; i++)
+ {
+ var cur_element = theForm.elements[i];
+
+ if(cur_element.id == confirm_id)
+ {
+ if(cur_element.value != password_element.value)
+ {
+ alert("Value " + password_element.name + " must match " + cur_element.name);
+ return 0;
+
+ }
+ else
+ {
+ return 1;
+ }
+
+ }
+
+ }
+
+ }
+
+ return 1;
+}
+
+function Validate()
+{
+ if(theForm)
+ {
+ var size = theForm.length;
+
+ for( i = 0; i < size ; i++)
+ {
+ var element = theForm.elements[i];
+
+ if(element.type == "text" )
+ {
+ if(element.value == "")
+ {
+ alert("Please enter value for " + element.name);
+ return 0;
+ }
+ }
+
+ if(element.type == "password")
+ {
+ if(element.value == "")
+ {
+ alert("Please enter value for " + element.name);
+ return 0;
+ }
+
+ if(!ConfirmPassword(element))
+ {
+ return 0;
+ }
+
+ }
+ }
+
+ }
+
+ return 1;
+}
+
+function FormSubmit()
+{
+ var result = Validate();
+
+ var thisParent = window.opener;
+
+ if(!parent)
+ {
+ alert("No parent window.");
+ window.close();
+ return;
+ }
+
+ if(!result)
+ {
+ return;
+ }
+
+ if(theForm)
+ {
+ var size = theForm.length;
+ for( i = 0; i < size ; i++)
+ {
+ var element = theForm.elements[i];
+
+ var value = element.value;
+
+ if(element.type == "text" )
+ {
+ var id = element.id;
+ value = element.value;
+
+ if(thisParent)
+ {
+ //alert("about to set data value key " + curKeyID + " id " + id + " value " + value);
+ thisParent.COOLKeySetDataValue(curKeyType,curKeyID,id,value);
+
+ }
+ }
+
+ if(element.type == "password")
+ {
+ var p_id = new String(element.id);
+
+ if(p_id.indexOf("RE_") == -1)
+ {
+ if(thisParent)
+ {
+ thisParent.COOLKeySetDataValue(curKeyType,curKeyID,p_id,value);
+ }
+ }
+ }
+ }
+
+ }
+
+ window.close();
+}
+
+function GetUIObjectList(uiData)
+{
+ var str = new String(uiData);
+ var splits = str.split("&&");
+
+// alert("Get " + splits + " len " + splits.length);
+
+ var params = new Array();
+ var size = splits.length;
+
+ for(i = 0 ; i < size ; i++)
+ {
+ params[i] = splits[i].split("&");
+ }
+
+ size = params.length;
+ var name_value_objects = new Array();
+
+ for(i = 0 ; i < size; i++)
+ {
+ var name_values = new Array();
+
+ pISize = params[i].length;
+ for(j = 0 ; j < pISize ; j ++)
+ {
+ var pair = params[i][j].split("=");
+
+ //alert(" pair " + pair[0] + " pair1 " + pair[1]);
+
+ if(pair[0] == "option")
+ {
+ var options = pair[1].split(",");
+ }
+
+ name_values[pair[0]] = pair[1];
+ }
+
+ name_value_objects[i] = name_values;
+ }
+
+ return name_value_objects;
+
+}
+
+function AddBRToNode(theNode)
+{
+
+ if(!theNode)
+ return;
+
+ var br = document.createElement("br");
+
+ theNode.appendChild(br);
+
+}
+
+function AddTextToNode(theNode,theText)
+{
+
+ if(!theNode || !theText)
+ return;
+
+
+ var text = document.createTextNode(theText);
+
+ theNode.appendChild(text);
+
+
+
+
+}
+function AddTextToDocument(theText)
+{
+ if(!theText)
+ return;
+
+ var p = document.createElement("p");
+
+ if(p)
+ {
+ p.appendChild(document.createTextNode(theText));
+ }
+
+ document.body.appendChild(p);
+}
+
+function CreateForm()
+{
+ var form = document.createElement("form");
+ document.body.appendChild(form);
+ return form;
+}
+
+function CreateTable()
+{
+ var table = document.createElement("table");
+ document.body.appendChild(table);
+ tbody = document.createElement("tbody");
+ table.appendChild(tbody);
+
+ return table;
+}
+
+function AddRowToTable(table)
+{
+ if(!table)
+ return null;
+
+ var tr = document.createElement("tr");
+ (table.tBodies[0]).appendChild(tr);
+
+ return tr;
+}
+
+function AddColumnToRow(row)
+{
+ if(!row)
+ return null;
+
+ var td = document.createElement("td");
+ row.appendChild(td);
+
+ return td;
+}
+
+function AddTextToColumn(column,text)
+{
+ if(!column || !text)
+ return;
+
+ var text_node = document.createTextNode(text);
+ column.appendChild(text_node);
+
+ return text_node;
+}
+
+function AddInputField(type,id, name,value)
+{
+ var field = document.createElement("input");
+
+ if(!field)
+ return null;
+
+ field.type = type;
+ field.id =id;
+ field.name =name;
+ field.value =value;
+
+ return field;
+}
+
+function ConstructUI(aKeyType,aKeyID,uiData)
+{
+
+ //alert("Construct UI data " + uiData);
+ var name_value_objects = GetUIObjectList(uiData);
+ var len = name_value_objects.length;
+
+ gTitle = document.createElement("h1");
+
+ gDescription = document.createElement("h2");
+
+
+ document.body.appendChild(gTitle);
+
+
+ document.body.appendChild(gDescription);
+
+
+ form = CreateForm();
+ theForm = form;
+ curKeyID = aKeyID;
+ curKeyType = aKeyType;
+
+ table = CreateTable();
+
+ form.appendChild(table);
+
+ for(i = 0 ; i < len ; i ++)
+ {
+ curParameter = name_value_objects[i];
+
+ if(curParameter)
+ {
+
+ title = curParameter["title"];
+
+
+ if(title)
+ {
+ //alert("title " + title);
+
+ AddTextToNode(gTitle,title);
+
+
+ }
+
+ description = curParameter["description"];
+
+ if(description)
+ {
+ AddBRToNode(document.body);
+ AddBRToNode(document.body);
+
+ AddTextToNode(gDescription,description);
+
+ AddBRToNode(document.body);
+
+ }
+
+ id = curParameter["id"];
+ name = curParameter["name"];
+ type = curParameter["type"];
+ desc = curParameter["desc"];
+
+ //alert(" id " + id + " name " + name + " type " + type + " desc " + desc);
+
+ if(id)
+ {
+ if(table)
+ {
+ row = AddRowToTable(table);
+ }
+
+ if(row)
+ {
+ column = AddColumnToRow(row);
+ }
+
+ if(column)
+ {
+ AddTextToColumn(column,name);
+ }
+
+ if(type == "string" || type == "integer")
+ {
+ field = AddInputField("text",id,name,"");
+ }
+
+ re_field = null;
+
+ if(type == "password")
+ {
+ field = AddInputField("password",id,name,"");
+ }
+
+ if(type == "hidden")
+ {
+ field = AddInputField("hidden",id,name,"");
+ }
+
+ if(field)
+ {
+ field_col = AddColumnToRow(row);
+ if(field_col)
+ {
+ field_col.appendChild(field);
+ }
+ }
+
+ if(re_field)
+ {
+ re_text = AddColumnToRow(row);
+
+ if(re_text)
+ {
+ AddTextToColumn(re_text,"Confirm " + name);
+ re_field_col = AddColumnToRow(row);
+ if(re_field_col)
+ {
+ re_field_col.appendChild(re_field);
+ }
+
+ }
+
+ }
+ }
+
+ }
+
+ }
+
+ var last_row = AddRowToTable(table);
+
+ if(last_row)
+ {
+ var button_field = AddColumnToRow(last_row);
+
+ if(button_field)
+ {
+ var button = AddInputField("button","Submit","Submit","Submit");
+ button.onclick = FormSubmit;
+ button_field.appendChild(button);
+
+ }
+
+ }
+}
+
+function UiLoad()
+{
+
+
+ var thisParent = window.opener;
+
+
+ if(!thisParent)
+ {
+ alert("Auth dialog has no parent!");
+ return;
+ }
+
+ var keyID = this.name;
+
+ var ui = thisParent.getUIForKey(keyID);
+
+ var type = thisParent.getTypeForKey(keyID);
+
+ //alert("UiLoad " + ui);
+
+ if(ui)
+ {
+ ConstructUI(type,keyID,ui);
+ }
+}
+
+</script>
+</head>
+<body onload = "UiLoad()">
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/docroot/esc/demo/logo.jpg b/pki/linux/tps-ui/shared/docroot/esc/demo/logo.jpg
new file mode 100644
index 000000000..7cb31affc
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/demo/logo.jpg
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/demo/style.css b/pki/linux/tps-ui/shared/docroot/esc/demo/style.css
new file mode 100755
index 000000000..e9d7d9bf7
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/demo/style.css
@@ -0,0 +1,214 @@
+/* --- BEGIN COPYRIGHT BLOCK ---
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; 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 ---
+ */
+
+body {
+background-color: grey;
+ font-family: arial;
+ font-size: 7p
+
+}
+
+form {
+ margin: 0px;
+ padding: 0px;
+};
+
+* {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+h2 {
+ font-size: 12pt;
+}
+
+.logobar {
+
+ background-color:black;
+ font-family: "Arial";
+ font-size: 7p;
+
+}
+
+.headerText {
+ font-family: "Arial";
+ font-size: 14pt;
+ font-weight: bold;
+ color: white;
+}
+
+.titleText {
+ font-family: "Arial";
+ font-size: 10pt;
+}
+
+.bodyText {
+ font-family: "Arial";
+ font-size: 10pt;
+ color: white;
+}
+
+.formText {
+ font-family: "Arial";
+ font-size: 9pt;
+ color: black;
+
+}
+
+.linkText {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+#BindingTable {
+ background-color: #ffffff ;
+ font-size: 7pt;
+}
+
+#BindingTable th {
+ color: rgb(0, 0, 0);
+ background-color: #fffffe;
+ font-size: 7pt;
+}
+
+#BindingTable tr {
+ background-color: #fffffe;
+ font-size: 7pt;
+}
+
+tr [COOLKeyPresent="yes"]{
+ background-color: rgb(255, 0, 0);
+}
+
+.cylon {
+ font-size: 4pt;
+ position: relative;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: #ffffff;
+}
+
+.cylonEye {
+ font-size: 4pt;
+ position: relative;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: rgb(0, 128, 192);
+}
+
+#statusMsg {
+ font-weight: bold;
+}
+
+.ProgressMeter {
+ position: relative;
+ padding: 0px;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: #ffffff;
+ text-align: center;
+}
+
+.ProgressBar {
+ position: absolute;
+ z-index: 0;
+ top: 0px;
+ left: 0px;
+ border-right: 1px solid rgb(60, 60, 60);
+ background-color: rgb(0, 128, 192);
+ margin: 0px;
+}
+
+.ProgressBarStatus {
+ position: relative;
+ z-index: 10;
+ margin: 0px;
+ padding: 0px;
+
+}
+
+.KeyTableHeader {
+ color: rgb(0,0, 0);
+ background-color: #ffffff;
+ text-align: left;
+}
+
+#KeyTable td {
+ background-color: #ffffff;
+ padding-left: 3px;
+ padding-right: 3px;
+};
+
+.TableDescriptionPanel {
+ background-color: #ffffff);
+ margin-right: 5px;
+ margin-left: 5px;
+ margin-bottom: 0px;
+ margin-bottom: 5px;
+ padding: 5px;
+}
+
+.PurchasePanel {
+ width: 100%;
+ text-align: center;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+
+.NeedQuestionText {
+ font-size: 16pt;
+ font-weight: bold;
+}
+
+.COOLHeaderText {
+ font-family: "Arial";
+ font-size: 20pt;
+ font-weight: bold;
+}
+
+.ContentTable {
+ background-color: #ffffff;
+ margin: 0px;
+}
+
+form {
+ margin: 0px;
+ padding: 0px;
+};
+
+* {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+
+table {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+.TableTitle {
+ font-size: 12pt;
+ font-weight: bold;
+}
+
+.PageHeader {
+ width: 100%;
+ border-bottom: solid black 1px;
+ vertical-align: center;
+ background-color: #ffffff;
+}
diff --git a/pki/linux/tps-ui/shared/docroot/esc/demo/util.js b/pki/linux/tps-ui/shared/docroot/esc/demo/util.js
new file mode 100755
index 000000000..f4a854fd3
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/demo/util.js
@@ -0,0 +1,1504 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; 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 ---
+
+//
+// initialize netkey globals
+var netkey;
+
+
+var keyUITable = new Array();
+var keyTypeTable = new Array();
+var curChildWindow = null;
+
+var gWindow = null;
+
+const ErrorText = "For additional assistance contact Veracify Investments Technical Support at 1-555-555-VERACI";
+
+
+function getUIForKey(aKeyID)
+{
+ return keyUITable[aKeyID];
+
+}
+
+function getTypeForKey(aKeyID)
+{
+ return keyTypeTable[aKeyID];
+}
+
+
+//
+// Notify callback for GECKO
+//
+function jsNotify() {}
+
+jsNotify.prototype = {
+
+ rhNotifyKeyStateChange: function(aKeyType,aKeyID,aKeyState,aData,strData)
+ {
+ OnCOOLKeyStateChange(aKeyType, aKeyID, aKeyState, aData,strData);
+ },
+
+ QueryInterface: function(iid)
+ {
+ <!-- alert("iid: " + iid); -->
+ if(!iid.equals(Components.interfaces.rhIKeyNotify) &&
+ !iid.equals(Components.interfaces.nsISupports))
+ {
+ MyAlert("Can't find jsNotify interface");
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+ }
+ return this;
+ }
+};
+
+//
+// Attach to the object.
+//
+ // GECKO ONLY initialization
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey = Components.classes["@redhat.com/rhCoolKey"].getService();
+ netkey = netkey.QueryInterface(Components.interfaces.rhICoolKey);
+ gNotify = new jsNotify;
+ netkey.rhCoolKeySetNotifyCallback(gNotify);
+ } catch(e) {
+ MyAlert("Can't get UniversalXPConnect: " + e);
+ }
+
+//
+// unregister our notify event
+//
+function cleanup()
+{
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.rhCoolKeyUnSetNotifyCallback(gNotify);
+ } catch(e) {
+ MyAlert("Can't get UniversalXPConnect: " + e);
+ }
+}
+
+var gScreenName = "";
+var gKeyEnrollmentType = "userKey";
+
+var gCurrentSelectedRow = null;
+
+
+var gCurKeyType = null;
+var gCurKeyID = null;
+
+////////////////////////////////////////////////////////////////
+//
+// Utility functions specific to this page.
+//
+////////////////////////////////////////////////////////////////
+
+
+// List of Error Messages to be printed out
+
+var Status_Messages = new Array(
+
+ "Operation Completed Successfully.",
+ "Smartcard Server error.",
+ "Problem communicating with the smartcard.",
+ "Problem communicating with the smartcard.",
+ "Problem resetting smartcard's pin.",
+ "Internal Smartcard Server error.",
+ "Internal Smartcard Server error.",
+ "Smartcard enrollment error.",
+ "Can not communicate with the smartcard.",
+ "Internal Smartcard Server error.",
+ "Problem communicating with the Certificattion Authority.",
+ "Internal Smartcard Server error.",
+ "Error resetting the smartcard's password.",
+ "Internal Smartcard Server error.",
+ "Smartcard Server authentication failure.",
+ "Internal Smartcard Server error.",
+ "Your Smartcard is listed as disabled.",
+ "Problem communicating with the smartcard.",
+ "Internal Smartcard Server error.",
+ "Cannot upgrade smartcard software.",
+ "Internal Smartcard Server error.",
+ "Problem communicating with the smartcard.",
+ "Invalid smartcard type.",
+ "Invalid smartcard type.",
+ "Cannot publish smartcard information.",
+ "Cannot communicate with smartcard database.",
+ "Smartcard is disabled.",
+ "Cannot reset password value for the smartcard.",
+ "Connection to Smartcard Server lost.",
+ "Cannot create entry for smartcard in smartcard database.",
+ "Smartcard found to be in an inconsistent state.",
+ "Invalid reason for lost smartcard submitted.",
+ "Smartcard found to be unusable due to compromise.",
+ "No such inactive smartcard found.",
+ "Cannot process more than one active smartcard.",
+ "Internal Smartcard Server error.",
+ "Smartcard key recovery has been processed.",
+ "Smartcard key recovery failed.",
+ "Cannot process this smartcard, which has been reported lost.",
+ "Smartcard key archival error.",
+ "Problem connecting to the Smartcard TKS Server.",
+ "Failed to update smartcard database.",
+ "Internal certificate revocation error discovered.",
+ "User does not own this smartcard.",
+ "Smart Card Manager has been misconfigured.",
+ "Smart Card Manager can not talk to smart card reader.",
+ "Smart Card Manager can not establish a session with the smart card.",
+ "Smart Card Manager can not talk to Smart Card Server.",
+ "Smart Card Manager can not talk to smart card reader."
+ );
+
+function GetAuthDataFromPopUp(aKeyType,aKeyID,aUiData)
+{
+
+ keyUITable[aKeyID] = aUiData;
+ keyTypeTable[aKeyID] = aKeyType;
+
+ //alert("GetAuthDataFromPopUp data " + aUiData);
+ var child = window.open("/GenericAuth.html",aKeyID,"height=400,width=400");
+
+ //alert("Attempted to create child window " + child);
+
+ curChildWindow = child;
+
+}
+
+function COOLKeySetDataValue(aKeyType,aKeyID,name,value)
+{
+ //alert("In COOLKeySetDataValue aKeyType " + aKeyType + " aKeyID " + aKeyID + " name " + name + " value " + value);
+ if(netkey)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.SetCoolKeyDataValue(aKeyType,aKeyID,name,value);
+
+
+ } catch(e) {
+ MyAlert("Error Setting data values: " + e);
+ }
+ }
+
+}
+
+function COOLKeySetTokenPin(pin)
+{
+ if(netkey)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"TokenPin",pin);
+
+
+ } catch(e) {
+ MyAlert("Error Setting data values: " + e);
+ }
+ }
+}
+
+function COOLKeySetUidPassword(uid,pwd)
+{
+
+ if(netkey)
+ {
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"UserId",uid);
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"Password",pwd);
+
+ } catch(e) {
+ MyAlert("Error Setting data values: " + e);
+ }
+
+ }
+
+}
+
+
+function MyGetErrorMessage(status_code)
+{
+
+ var result = "Internal Server Error";
+
+ if(status_code < 0 && status_code >= Status_Messages.length)
+ {
+ return result;
+
+ }
+
+ return Status_Messages[status_code];
+
+}
+
+function KeyToRowID(keyType, keyID)
+{
+ return keyType + "--" + keyID;
+}
+
+function RowIDToKeyInfo(rowID)
+{
+ return rowID.split("--");
+}
+
+function GetRowForKey(keyType, keyID)
+{
+ return document.getElementById(KeyToRowID(keyType, keyID));
+}
+
+function ReportException(msg, e)
+{
+ MyAlert(msg + " " + e.description + "(" + e.number + ")");
+}
+
+function GetCOOLKeyStatus(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyStatus(keyType, keyID);
+ } catch (e) {
+ ReportException("netkey.GetCOOLKeyStatus() failed!", e);
+ return 0;
+ }
+}
+
+function GetCOOLKeyPolicy(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyPolicy(keyType, keyID);
+ } catch (e) {
+ // ReportException("netkey.GetCOOLKeyPolicy() failed!", e);
+ return "";
+ }
+}
+
+function GetCOOLKeyRequiresAuth(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyRequiresAuthentication(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyRequiresAuthentication() failed!", e);
+ return false;
+ }
+}
+
+function GetCOOLKeyIsAuthed(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyIsAuthenticated(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyIsAuthenticated() failed!", e);
+ return false;
+ }
+}
+
+function GetAvailableCOOLKeys()
+{
+ try {
+ var keyArr;
+
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var inArray = netkey.GetAvailableCoolKeys( {} );
+ keyArr = new Array(inArray.length);
+ var i;
+
+ for (i=0; i < keyArr.length; i++) {
+ keyArr[i] = new Array( "1", inArray[i]);
+ }
+ return keyArr;
+ } catch(e) {
+ ReportException("netkey.GetAvailableCoolKeys() failed!", e);
+ return [];
+ }
+}
+
+function EnrollCOOLKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.EnrollCoolKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode);
+ } catch(e) {
+ ReportException("netkey.EnrollCoolKey() failed!", e);
+ return false;
+ }
+
+ return true;
+}
+
+function GetCOOLKeyIsEnrolled(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyIsEnrolled(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyIsEnrolled() failed!", e);
+ return false;
+ }
+}
+
+function CancelCOOLKeyOperation(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.CancelCoolKeyOperation(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.CancelCoolKeyOperation() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+function MyAlert(message)
+{
+ if(message)
+ DoMyAlert(message,"Veracify Investments");
+
+}
+function DoMyAlert(message,title)
+{
+
+ if(!message || !title)
+ return;
+
+ try {
+
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
+
+
+ prompts.alert(window,title,message);
+
+ } catch(e) {
+
+
+ alert("Problem with nsIPromptService " + e);
+ }
+
+}
+
+//
+// MSHTML/GECKO compatibility functions.
+//
+function RemoveRow(table, row)
+{
+ table.deleteRow(row.rowIndex);
+}
+
+function GetCell(row, index)
+{
+ var cell;
+
+ cell = row.cells[index];
+ return cell;
+}
+
+function GetNode(parent, index)
+{
+ var node;
+ node = parent.childNodes[index];
+ return node;
+}
+
+function InsertRow(table)
+{
+ var row;
+
+ row = table.insertRow(table.rows.length);
+ return row;
+}
+
+function InsertCell(row)
+{
+ var cell;
+
+ cell = row.insertCell(row.cells.length);
+ return cell;
+}
+
+function RemoveAllChildNodes(parent)
+{
+ var numChildren = parent.childNodes.length;
+ var i;
+
+ i = numChildren;
+ while (numChildren)
+ {
+ parent.removeChild(GetNode(parent,0));
+ numChildren--;
+ }
+
+}
+
+
+function UpdateInfoForKeyID(keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ return;
+
+ var cell = GetCell(row,1)
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(keyStatus));
+
+// cell = GetCell(row,2);
+ // RemoveAllChildNodes(cell);
+ // cell.appendChild(document.createTextNode(reqAuth));
+
+ // cell = GetCell(row,3);
+ // RemoveAllChildNodes(cell);
+ // cell.appendChild(document.createTextNode(isAuthed));
+}
+
+function GetStatusForKeyID(keyType, keyID)
+{
+ var keyStatus = "BLANK";
+
+ var status;
+
+ try {
+ status = GetCOOLKeyStatus(keyType, keyID);
+ } catch(e) {
+ status = 0;
+ }
+
+ switch (status) {
+ case 0: // Unavailable
+ keyStatus = "UNAVAILABLE";
+ break;
+ case 1: // AppletNotFound
+ keyStatus = "NO APPLET";
+ break;
+ case 2: // Uninitialized
+ keyStatus = "UNINITIALIZED";
+ break;
+ case 3: // Unknown
+ keyStatus = "UNKNOWN";
+ break;
+ case 4: // Available
+ case 6: // UnblockInProgress
+ case 7: // PINResetInProgress
+ case 8: // RenewInProgress
+ keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ break;
+ case 5: // EnrollmentInProgress
+ keyStatus = "BUSY";
+ break;
+ break;
+ case 9: // FormatInProgress
+ keyStatus = "BUSY";
+ break;
+ }
+
+ return keyStatus;
+}
+
+function InsertCOOLKeyIntoBindingTable(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ gWindow = window;
+ if (!row)
+ {
+ var table = document.getElementById("BindingTable");
+ if (table)
+ {
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ row = CreateTableRow(table, keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ }
+
+ if (!row)
+ return null;
+ }
+
+ return row;
+}
+
+function ConvertVariantArrayToJScriptArray(varr)
+{
+ // C++ native methods, like netkey.GetAvailableCOOLKeys(), can only
+ // return variant SafeArrays, so to access the data inside, you must
+ // first convert it to a VBArray, and then call toArray() to convert
+ // it to a JScript array. Lame, but that's what it takes to
+ // use an array returned from an ActiveX component.
+
+ return new VBArray(varr).toArray();
+}
+
+function UpdateBindingTableAvailability()
+{
+ var arr = GetAvailableCOOLKeys();
+
+ if (!arr || arr.length < 1)
+ return;
+
+ var i;
+
+ for (i=0; i < arr.length; i++)
+ {
+ InsertCOOLKeyIntoBindingTable(arr[i][0], arr[i][1]);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(arr[i][0], arr[i][1]);
+ }
+}
+
+function InitializeBindingTable()
+{
+ UpdateBindingTableAvailability();
+ UpdateButtonStates();
+}
+
+function KeyIsPresent(keyType, keyID)
+{
+ row = document.all.item(keyType, keyID);
+
+ if (!row)
+ return false;
+
+ return true;
+}
+
+function SetStatusMessage(str)
+{
+ var cell = document.getElementById("statusMsg");
+
+ if (!cell)
+ return;
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(str));
+}
+
+function UpdateButtonStates()
+{
+ if (gCurrentSelectedRow)
+ {
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+
+ document.getElementById("enrollbtn").disabled = false;
+ }
+ else
+ {
+ document.getElementById("enrollbtn").disabled = true;
+ }
+
+ refresh();
+}
+
+function SetEnrollmentType(type)
+{
+ gKeyEnrollmentType = type;
+ UpdateButtonStates();
+}
+
+function FindRow(node)
+{
+ while (node && node.tagName != "TR")
+ {
+ node = node.parentNode;
+ }
+
+ return node;
+}
+
+function SelectRow(row)
+{
+ if (!row || gCurrentSelectedRow == row)
+ return;
+
+ if (gCurrentSelectedRow)
+ gCurrentSelectedRow.removeAttribute("style");
+
+ gCurrentSelectedRow = row;
+ gCurrentSelectedRow.style.backgroundColor="rgb(200,200,200)";
+ UpdateButtonStates();
+}
+
+function SelectRowByKeyID(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ SelectRow(row);
+}
+
+function DoSelectRow(event)
+{
+ var row;
+
+ row = FindRow(event.parentNode);
+ SelectRow(row);
+}
+
+function KeyToUIString(keyType, keyID)
+{
+ // If it's an COOLKey, format the keyID string.
+
+ if (keyType == 1 && keyID.length == 20)
+ {
+ var re = /([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})/i;
+ keyID = keyID.replace(re, "$1-$2-$3-$4-$5").toLowerCase();
+ }
+
+ return keyID;
+}
+
+
+
+function CreateTableRow(table, keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+ var row = InsertRow(table);
+ if (!row)
+ return null;
+
+ row.setAttribute("id", KeyToRowID(keyType, keyID));
+
+ row.onclick = DoSelectRow;
+
+ // Create the key ID cell.
+ //cell = InsertCell(row);
+ //cell.appendChild(document.createTextNode(KeyToUIString(keyType, keyID)));
+
+ //cell.setAttribute("onClick", "DoSelectRow(this);");
+
+ // Create the keyStatus cell.
+ //cell = InsertCell(row);
+ //cell.appendChild(document.createTextNode(keyStatus));
+
+ // Create the requires auth cell.
+ // cell = InsertCell(row);
+ // cell.appendChild(document.createTextNode(reqAuth));
+
+ cell = InsertCell(row);
+ cell.appendChild(document.createTextNode("Enrollment Progress"));
+
+ // Create the status bar cell
+
+ cell = InsertCell(row);
+
+ var progressMeter = document.createElement("div");
+ progressMeter.setAttribute("id", KeyToProgressBarID(keyType, keyID));
+ progressMeter.className = "ProgressMeter";
+ progressMeter.style.width = "100px";
+ progressMeter.style.height = "1.5em";
+// progressMeter.style.visibility = "hidden";
+ progressMeter.setAttribute("value", 0);
+
+ var progressBar = document.createElement("div");
+ progressBar.className = "ProgressBar";
+ progressBar.style.width = "0px";
+ progressBar.style.height = "100%";
+// progressBar.style.visibility = "hidden";
+
+ var progressBarStatus = document.createElement("div");
+ progressBarStatus.className = "ProgressBarStatus";
+ progressBarStatus.appendChild(document.createTextNode(""));
+
+ progressMeter.appendChild(progressBar);
+ progressMeter.appendChild(progressBarStatus);
+ cell.appendChild(progressMeter);
+
+ //row.style.display ="none";
+
+ return row;
+}
+
+gAnimationMSecs = 1000/30;
+
+function SetCylonTimer(cylonID, cylonEyeID)
+{
+ setTimeout("AnimateCylonStatusBar(\"" + cylonID +
+ "\", \"" + cylonEyeID + "\");", gAnimationMSecs);
+}
+
+function AnimateCylonStatusBar(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID);
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ return;
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (!eye)
+ return;
+
+ var dir = eye.getAttribute("direction");
+ var wid = parseInt(eye.style.width);
+ var cywid = parseInt(cylon.style.width);
+ var left = parseInt(eye.style.left);
+
+ var dx = 10;
+
+ if (!dir || dir >= 0)
+ {
+ left += dx;
+
+ if (left + wid > cywid)
+ {
+ left = cywid - wid;
+ eye.setAttribute("direction", "-1");
+ }
+ }
+ else
+ {
+ left -= dx;
+
+ if (left < 0)
+ {
+ left = 0;
+ eye.setAttribute("direction", "1");
+ }
+ }
+
+ eye.style.left = left + "px";
+
+ SetCylonTimer(cylonID, cylonEyeID);
+}
+
+function StartCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ {
+ cylon.setAttribute("cylonactive", "true");
+
+ var eye = document.getElementById(cylonEyeID);
+ if (eye)
+ {
+ eye.style.left = "0px";
+ eye.style.visibility = "visible";
+ }
+
+ SetCylonTimer(cylonID, cylonEyeID);
+ }
+}
+
+function StopCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (cylon)
+ cylon.removeAttribute("cylonactive");
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (eye)
+ eye.style.visibility = "hidden";
+}
+
+function GetProgressMeterValue(progMeterID)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return -1;
+
+ return parseInt(progMeter.getAttribute("value"));
+}
+
+function SetProgressMeterValue(progMeterID, value)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter || value < 0)
+ return;
+
+ if (value > 100)
+ value = 100;
+
+ var progBar = progMeter.firstChild;
+
+ if (value == 0)
+ {
+ progBar.style.width = "0px";
+ progBar.style.visibility = "hidden";
+ progMeter.setAttribute("value", 0);
+ return;
+ }
+
+ progBar.style.visibility = "visible";
+
+ var newWidth = parseInt(progMeter.style.width) * value / 100 - 2;
+
+ progBar.style.width = newWidth + "px";
+ progMeter.setAttribute("value", value);
+}
+
+function SetProgressMeterStatus(progMeterID, statusMsg)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return;
+
+ var progBar = progMeter.firstChild;
+
+ // If it exists, the meter status should be
+ // div that is the next sibling of the progressMeter.
+
+ var meterStatus = progBar.nextSibling;
+
+ // Just replace the data in the text node, it's much faster,
+ // and reduces flashing!
+
+ meterStatus.firstChild.replaceData(0, meterStatus.firstChild.length, statusMsg);
+}
+
+function ClearProgressBar(progMeterID)
+{
+ SetProgressMeterValue(progMeterID, 0);
+ SetProgressMeterStatus(progMeterID, "");
+}
+
+function KeyToProgressBarID(keyType, keyID)
+{
+ return "PM" + keyType + "-" + keyID;
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions that contact the server or talk directly to
+// ESC native code.
+//
+// ESC Native Functions:
+//
+// netkey.GetAvailableCOOLKeys()
+//
+// - Returns an ActiveX Variant SafeArray containing the ID for each key
+// that is currentlly plugged into the computer. Before accessing any
+// data in this array you must convert it to a JScript Array with a
+// call to ConvertVariantArrayToJScriptArray().
+//
+// netkey.GetCOOLKeyIsEnrolled(keyType, keyID)
+//
+// - Returns true if a key has been initialized, false if it hasn't.
+// Initialized means the card has been formatted with certificates
+// for either an COOL HouseKey or NetKey.
+//
+// netkey.EnrollCOOLKey(keyType, keyID, enrollmentType, screenName, pin)
+//
+// - Initiates an async connection to the RA to initialize a specific
+// key. If you want the key to be initialized as a HouseKey, you should
+// pass "houseKey" as the enrollmentType, and null values for both
+// screenName and pin. For a NetKey, use "netKey" as the enrollmentType,
+// and pass a valid screenName and pin.
+//
+//
+////////////////////////////////////////////////////////////////
+
+function GetScreenNameValue()
+{
+ var sname = document.getElementById("snametf").value;
+
+ if (! sname)
+ {
+ MyAlert("You must provide a valid Veracify Account Name!");
+ return null;
+ }
+
+ return sname;
+}
+
+function GetPINValue()
+{
+ var pinVal = document.getElementById("pintf").value;
+ var rpinVal = document.getElementById("reenterpintf").value;
+
+ if (! pinVal)
+ {
+ MyAlert("You must provide a valid Veracify Key Password!");
+ return null;
+ }
+
+ if ( pinVal != rpinVal)
+ {
+ MyAlert("The Veracify Key Password values you entered do not match!");
+ return null;
+ }
+
+ return pinVal;
+}
+
+function GetScreenNamePwd()
+{
+
+ var pwd = document.getElementById("snamepwd").value;
+
+ if(!pwd)
+ {
+ MyAlert("You must provide a valid Veracify Account Number !");
+ return null;
+ }
+ return pwd;
+}
+
+function GetTokenCode()
+{
+
+ return null;
+}
+function DoEnrollCOOLKey()
+{
+
+ if (!gCurrentSelectedRow)
+ {
+ MyAlert("Please select a key.");
+ return;
+ }
+
+
+ if(!Validate())
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ if (type == "userKey")
+ {
+ screenname = GetScreenNameValue();
+
+ pin = GetPINValue();
+
+
+ screennamepwd = GetScreenNamePwd();
+
+ tokencode = GetTokenCode();
+
+ //SetStatusMessage("Enrolling UserKey \"" + KeyToUIString(keyType, keyID) + "\"...");
+ }
+
+ StartCylonAnimation("cylon1", "eye1");
+
+ var doShow = true;
+
+ ShowProgressBar(keyType,keyID,doShow );
+
+ if (!EnrollCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ var doShow = false;
+ ShowProgressBar(aKeyType,aKeyID,doShow );
+ }
+}
+
+function DoResetSelectedCOOLKeyPIN()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ if(!Validate())
+ return;
+
+ //alert("In DoResetSelectedCOOLKeyPIN!");
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var screenname = null;
+ var pin = null;
+ var screennamepwd = null;
+
+ if (GetCOOLKeyIsEnrolled(keyType, keyID))
+ {
+
+ SetStatusMessage("Resetting PIN for \"" + keyID + "\"...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!ResetCOOLKeyPIN(keyType, keyID, screenname, pin,screennamepwd))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+ }
+}
+
+function DoFormatCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+
+ if(!Validate())
+ return;
+
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ SetStatusMessage("Formatting \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!FormatCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+}
+function DoCancelOperation()
+{
+
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ SetStatusMessage("Cancel operation for \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ CancelCOOLKeyOperation(keyType, keyID);
+
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+}
+
+function DoChallengeSelectedKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Generating Challenge ...");
+
+ var challengeArray = ChallengeCOOLKey(keyType, keyID, document.forms[0].challengedata.value);
+
+ if (challengeArray.length != 4)
+ {
+ MyAlert("Challenge for key \"" + KeyToUIString(keyType, keyID) + "\" failed!");
+ SetStatusMessage("");
+ return;
+ }
+
+ MyAlert("ChallengeCOOLKey(\""+ KeyToUIString(keyType, keyID) + "\") returned:\n\n" +
+ "challenge[0]: " + challengeArray[0] + "\n" +
+ "challenge[1]: " + challengeArray[1] + "\n" +
+ "challenge[2]: " + challengeArray[2] + "\n" +
+ "challenge[3]: " + challengeArray[3] + "\n");
+
+ SetStatusMessage("");
+}
+
+function DoBlinkCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Blinking \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ BlinkCOOLKey(keyType, keyID, 400, 5000);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+}
+
+function OnCOOLKeyBlinkComplete(keyType,keyID)
+{
+ //StopCylonAnimation("cylon1", "eye1");
+ //SetStatusMessage(" ");
+}
+
+function DoHelp()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ var policy = GetCOOLKeyPolicy(keyType, keyID);
+ var type = PolicyToKeyType(policy);
+ MyAlert("Policy: " + policy + "\n" + "Type: " + type);
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions called directly from ASC native code.
+//
+////////////////////////////////////////////////////////////////
+
+function OnCOOLKeyInserted(keyType, keyID)
+{
+ var row = InsertCOOLKeyIntoBindingTable(keyType, keyID);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(keyType, keyID);
+}
+
+
+function OnCOOLKeyRemoved(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ var table = document.getElementById("BindingTable");
+
+ if (row && table)
+ {
+ RemoveRow(table,row);
+
+ if (row == gCurrentSelectedRow)
+ gCurrentSelectedRow = null;
+ }
+
+ UpdateButtonStates();
+}
+
+var gKnownPolicies = [
+
+ // OID Value, precedence, name value
+
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.4", 4, "NETKEY" ], // Platinum - MyDoctor
+
+ // XXX: Remove the Old OIDs below, after the RA starts generating
+ // certificates with the OIDs listed above!
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.4", 4, "NETKEY" ] // Platinum - MyDoctor
+];
+
+function PolicyToKeyType(policy)
+{
+ return "ENROLLED";
+}
+
+function OldPolicyToKeyType(policy)
+{
+ var i, j;
+
+ var knownPoliciesIndex = -1;
+
+
+ var policies;
+
+
+ if (policy.indexOf(",")== -1)
+ {
+ policies = new Array(1);
+ policies[0] = policy;
+ }
+ else
+ {
+ policies = policy.split(",");
+ }
+
+ for (j = 0; j < policies.length; j++)
+ {
+ for (i = 0; i < gKnownPolicies.length; i++)
+ {
+ if (gKnownPolicies[i][0] == policies[j])
+ {
+ if (knownPoliciesIndex < gKnownPolicies[i][1])
+ knownPoliciesIndex = i;
+ }
+ }
+ }
+
+ if (knownPoliciesIndex == -1)
+ return "INITIALIZED";
+
+ return gKnownPolicies[knownPoliciesIndex][2];
+}
+
+function BoolToYesNoStr(b)
+{
+ if (b)
+ return "YES";
+ return "NO";
+}
+
+function OnCOOLKeyEnrollmentComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ //UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ var doShow = false;
+ ShowProgressBar(keyType,keyID, doShow);
+ SetStatusMessage("");
+ MyAlert("Enrollment of smartcard complete!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+
+ window.setTimeout("loadSuccessPage()",4);
+}
+
+function OnCOOLKeyPINResetComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ MyAlert("Password Reset was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyFormatComplete(keyType, keyID)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ MyAlert("Format of \"" + KeyToUIString(keyType, keyID)+ "\" was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyStateError(keyType, keyID, keyState, errorCode)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ if(curChildWindow)
+ {
+ curChildWindow.close();
+ curChildWindow = null;
+
+ }
+
+ var doShow = false;
+ ShowProgressBar(keyType,keyID, doShow);
+
+ //UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+
+ var typeStr = "Error(" + errorCode + ")";
+
+ var messageStr = " \n\n Error Response: " + MyGetErrorMessage(errorCode) ;
+
+ var keyIDStr = KeyToUIString(keyType, keyID);
+
+ if (keyState == 1004)
+ typeStr = "Enrollment of key failed. " + typeStr + messageStr ;
+ else if (keyState == 1016)
+ typeStr = "Formatting of key failed. " + typeStr + messageStr;
+ else if (keyState == 1010)
+ typeStr = "PIN Reset for key failed. " + typeStr + messageStr;
+ else if (keyState == 1020)
+ typeStr = "Operation for key canceled.";
+
+ typeStr += " \n " + ErrorText;
+ MyAlert(typeStr);
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyStatusUpdate(progMeterID, statusUpdate)
+{
+ SetProgressMeterValue(progMeterID, statusUpdate);
+ SetProgressMeterStatus(progMeterID, statusUpdate + "%");
+}
+
+function Validate()
+{
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ if (type == "userKey")
+ {
+ screenname = GetScreenNameValue();
+ if (! screenname)
+ return 0;
+
+ screennamepwd = GetScreenNamePwd();
+
+ if(! screennamepwd)
+ return 0;
+
+ pin = GetPINValue();
+
+ if (! pin)
+ return 0;
+
+ }
+
+ return 1;
+}
+
+function OnCOOLKeyStateChange(keyType, keyID, keyState, data,strData)
+{
+ // alert("KeyID: " + keyID + "\n" +
+ // "KeyState: " + keyState + "\n" +
+ // "Data: " + data);
+ //alert("State Change ="+keyState);
+
+ switch(keyState)
+ {
+ case 1000: // KeyInserted
+ OnCOOLKeyInserted(keyType, keyID);
+ break;
+ case 1001: // KeyRemoved
+ OnCOOLKeyRemoved(keyType, keyID);
+ break;
+ case 1002: // EnrollmentStart
+ // OnCOOLKeyEnrollmentStart(keyType, keyID);
+ break;
+ case 1003: // EnrollmentComplete
+ OnCOOLKeyEnrollmentComplete(keyType, keyID);
+ break;
+ case 1004: // EnrollmentError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1008: // PINResetStart
+ // OnCOOLKeyPINResetStart(keyType, keyID);
+ break;
+ case 1009: // PINResetComplete
+ OnCOOLKeyPINResetComplete(keyType, keyID);
+ break;
+ case 1010: // PINResetError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1014: // FormatStart
+ // OnCOOLKeyFormatStart(keyType, keyID);
+ break;
+ case 1015: // FormatComplete
+ OnCOOLKeyFormatComplete(keyType, keyID);
+ break;
+ case 1016: // FormatError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1017: // BlinkStatus Update?
+ //OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1018:
+ OnCOOLKeyBlinkComplete(keyType, keyID);
+ break;
+ case 1020: // OperationCancelled
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1021: // OperationStatusUpdate
+ OnCOOLKeyStatusUpdate(KeyToProgressBarID(keyType, keyID), data);
+ break;
+
+ case 1022: //Need Auth
+
+
+ gCurKeyID = keyID;
+ gCurKeyType = keyType;
+
+ GetAuthDataFromPopUp(keyType,keyID,strData);
+
+ break;
+
+ }
+}
+
+function refresh()
+{
+ window.resizeBy(0,1);
+ window.resizeBy(0,-1);
+
+}
+
+function loadSuccessPage()
+{
+ window.location="/demo/EnrollSuccess.html";
+}
+
+function ShowProgressBar(aKeyType,aKeyID, doShow)
+{
+ if(!gCurrentSelectedRow)
+ return;
+
+ if(doShow)
+ gCurrentSelectedRow.style.display="table-row";
+ else
+ {
+ gCurrentSelectedRow.style.display="none";
+ }
+}
diff --git a/pki/linux/tps-ui/shared/docroot/esc/home/EnrollSuccess.html b/pki/linux/tps-ui/shared/docroot/esc/home/EnrollSuccess.html
new file mode 100644
index 000000000..57fd1053c
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/home/EnrollSuccess.html
@@ -0,0 +1,47 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<link rel=stylesheet href="/home/style.css" type="text/css">
+<title>Success!</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
+<table width="100%" border="0" cellspacing="0" cellpadding="0" class="logobar">
+ <tr>
+ <td bgcolor="#000000">&nbsp;&nbsp;&nbsp;<img src="/home/logo.jpg" width="250" height="50"></td>
+ </tr>
+</table>
+
+<p class="bodyText" >
+Congratulations! You have successfully Enrolled your Smartcard! Now that you have enrolled, you will be able to use your smartcard to allow you and only you to log onto the available Smartcard-protected services.
+
+</p>
+<p class="bodyText">
+
+Begin your journey into the world of safe and secure account access by logging on to the available Smartcard-protected services.
+
+</p>
+
+</body>
+
+</html>
+
diff --git a/pki/linux/tps-ui/shared/docroot/esc/home/GenericAuth.html b/pki/linux/tps-ui/shared/docroot/esc/home/GenericAuth.html
new file mode 100755
index 000000000..5660a7c50
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/home/GenericAuth.html
@@ -0,0 +1,539 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<style>
+
+body {
+background: #ffffff url(../images/bg.jpg) repeat-x;
+ font-family: arial;
+ font-size: 7pt;
+
+}
+
+h1
+{
+ text-align: left;
+
+ font-weight: bold;
+
+ font-size: 13pt;
+
+
+}
+
+
+h2 {
+
+ text-align: left;
+ font-size: 10pt;
+
+ font-weight: lighter;
+}
+
+</style>
+<script language = "Javascript">
+
+var test_ui = "id=USER_ID&name=User ID&desc=User ID&type=string&option=option1,option2,option3&&id=USER_PWD&name=User Password&desc=User Password&type=password&option=&&id=USER_PIN&name=PIN&desc=One time PIN received via mail&type=password&option=";
+
+var theForm = null;
+var curKeyID = null;
+var curKeyType = 0;
+
+
+var gTitle = null;
+var gDescription = null;
+
+
+
+function ConfirmPassword(password_element)
+{
+
+ if(!password_element)
+ return 0;
+
+ password_id = password_element.id;
+
+ if(!password_id)
+ return 0;
+
+ confirm_id = "RE_" + password_element.id;
+
+ var size = theForm.length;
+
+ if(theForm)
+ {
+ for(i = 0; i < size ; i++)
+ {
+ var cur_element = theForm.elements[i];
+
+ if(cur_element.id == confirm_id)
+ {
+ if(cur_element.value != password_element.value)
+ {
+ alert("Value " + password_element.name + " must match " + cur_element.name);
+ return 0;
+
+ }
+ else
+ {
+ return 1;
+ }
+
+ }
+
+ }
+
+ }
+
+ return 1;
+}
+
+function Validate()
+{
+ if(theForm)
+ {
+ var size = theForm.length;
+
+ for( i = 0; i < size ; i++)
+ {
+ var element = theForm.elements[i];
+
+ if(element.type == "text" )
+ {
+ if(element.value == "")
+ {
+ alert("Please enter value for " + element.name);
+ return 0;
+ }
+ }
+
+ if(element.type == "password")
+ {
+ if(element.value == "")
+ {
+ alert("Please enter value for " + element.name);
+ return 0;
+ }
+
+ if(!ConfirmPassword(element))
+ {
+ return 0;
+ }
+
+ }
+ }
+
+ }
+
+ return 1;
+}
+
+function FormSubmit()
+{
+ var result = Validate();
+
+ var thisParent = window.opener;
+
+ if(!parent)
+ {
+ alert("No parent window.");
+ window.close();
+ return;
+ }
+
+ if(!result)
+ {
+ return;
+ }
+
+ if(theForm)
+ {
+ var size = theForm.length;
+ for( i = 0; i < size ; i++)
+ {
+ var element = theForm.elements[i];
+
+ var value = element.value;
+
+ if(element.type == "text" )
+ {
+ var id = element.id;
+ value = element.value;
+
+ if(thisParent)
+ {
+ //alert("about to set data value key " + curKeyID + " id " + id + " value " + value);
+ thisParent.COOLKeySetDataValue(curKeyType,curKeyID,id,value);
+
+ }
+ }
+
+ if(element.type == "password")
+ {
+ var p_id = new String(element.id);
+
+ if(p_id.indexOf("RE_") == -1)
+ {
+ if(thisParent)
+ {
+ thisParent.COOLKeySetDataValue(curKeyType,curKeyID,p_id,value);
+ }
+ }
+ }
+ }
+
+ }
+
+ window.close();
+}
+
+function GetUIObjectList(uiData)
+{
+ var str = new String(uiData);
+ var splits = str.split("&&");
+
+// alert("Get " + splits + " len " + splits.length);
+
+ var params = new Array();
+ var size = splits.length;
+
+ for(i = 0 ; i < size ; i++)
+ {
+ params[i] = splits[i].split("&");
+ }
+
+ size = params.length;
+ var name_value_objects = new Array();
+
+ for(i = 0 ; i < size; i++)
+ {
+ var name_values = new Array();
+
+ pISize = params[i].length;
+ for(j = 0 ; j < pISize ; j ++)
+ {
+ var pair = params[i][j].split("=");
+
+ //alert(" pair " + pair[0] + " pair1 " + pair[1]);
+
+ if(pair[0] == "option")
+ {
+ var options = pair[1].split(",");
+ }
+
+ name_values[pair[0]] = pair[1];
+ }
+
+ name_value_objects[i] = name_values;
+ }
+
+ return name_value_objects;
+
+}
+
+function AddBRToNode(theNode)
+{
+
+ if(!theNode)
+ return;
+
+ var br = document.createElement("br");
+
+ theNode.appendChild(br);
+
+}
+
+function AddTextToNode(theNode,theText)
+{
+
+ if(!theNode || !theText)
+ return;
+
+
+ var text = document.createTextNode(theText);
+
+ theNode.appendChild(text);
+
+
+
+
+}
+function AddTextToDocument(theText)
+{
+ if(!theText)
+ return;
+
+ var p = document.createElement("p");
+
+ if(p)
+ {
+ p.appendChild(document.createTextNode(theText));
+ }
+
+ document.body.appendChild(p);
+}
+
+function CreateForm()
+{
+ var form = document.createElement("form");
+ document.body.appendChild(form);
+ return form;
+}
+
+function CreateTable()
+{
+ var table = document.createElement("table");
+ document.body.appendChild(table);
+ tbody = document.createElement("tbody");
+ table.appendChild(tbody);
+
+ return table;
+}
+
+function AddRowToTable(table)
+{
+ if(!table)
+ return null;
+
+ var tr = document.createElement("tr");
+ (table.tBodies[0]).appendChild(tr);
+
+ return tr;
+}
+
+function AddColumnToRow(row)
+{
+ if(!row)
+ return null;
+
+ var td = document.createElement("td");
+ row.appendChild(td);
+
+ return td;
+}
+
+function AddTextToColumn(column,text)
+{
+ if(!column || !text)
+ return;
+
+ var text_node = document.createTextNode(text);
+ column.appendChild(text_node);
+
+ return text_node;
+}
+
+function AddInputField(type,id, name,value)
+{
+ var field = document.createElement("input");
+
+ if(!field)
+ return null;
+
+ field.type = type;
+ field.id =id;
+ field.name =name;
+ field.value =value;
+
+ return field;
+}
+
+function ConstructUI(aKeyType,aKeyID,uiData)
+{
+
+ //alert("Construct UI data " + uiData);
+ var name_value_objects = GetUIObjectList(uiData);
+ var len = name_value_objects.length;
+
+ gTitle = document.createElement("h1");
+
+ gDescription = document.createElement("h2");
+
+
+ document.body.appendChild(gTitle);
+
+
+ document.body.appendChild(gDescription);
+
+
+ form = CreateForm();
+ theForm = form;
+ curKeyID = aKeyID;
+ curKeyType = aKeyType;
+
+ table = CreateTable();
+
+ form.appendChild(table);
+
+ for(i = 0 ; i < len ; i ++)
+ {
+ curParameter = name_value_objects[i];
+
+ if(curParameter)
+ {
+
+ title = curParameter["title"];
+
+
+ if(title)
+ {
+ //alert("title " + title);
+
+ AddTextToNode(gTitle,title);
+
+
+ }
+
+ description = curParameter["description"];
+
+ if(description)
+ {
+ AddBRToNode(document.body);
+ AddBRToNode(document.body);
+
+ AddTextToNode(gDescription,description);
+
+ AddBRToNode(document.body);
+
+ }
+
+ id = curParameter["id"];
+ name = curParameter["name"];
+ type = curParameter["type"];
+ desc = curParameter["desc"];
+
+ //alert(" id " + id + " name " + name + " type " + type + " desc " + desc);
+
+ if(id)
+ {
+ if(table)
+ {
+ row = AddRowToTable(table);
+ }
+
+ if(row)
+ {
+ column = AddColumnToRow(row);
+ }
+
+ if(column)
+ {
+ AddTextToColumn(column,name);
+ }
+
+ if(type == "string" || type == "integer")
+ {
+ field = AddInputField("text",id,name,"");
+ }
+
+ re_field = null;
+
+ if(type == "password")
+ {
+ field = AddInputField("password",id,name,"");
+ }
+
+ if(type == "hidden")
+ {
+ field = AddInputField("hidden",id,name,"");
+ }
+
+ if(field)
+ {
+ field_col = AddColumnToRow(row);
+ if(field_col)
+ {
+ field_col.appendChild(field);
+ }
+ }
+
+ if(re_field)
+ {
+ re_text = AddColumnToRow(row);
+
+ if(re_text)
+ {
+ AddTextToColumn(re_text,"Confirm " + name);
+ re_field_col = AddColumnToRow(row);
+ if(re_field_col)
+ {
+ re_field_col.appendChild(re_field);
+ }
+
+ }
+
+ }
+ }
+
+ }
+
+ }
+
+ var last_row = AddRowToTable(table);
+
+ if(last_row)
+ {
+ var button_field = AddColumnToRow(last_row);
+
+ if(button_field)
+ {
+ var button = AddInputField("button","Submit","Submit","Submit");
+ button.onclick = FormSubmit;
+ button_field.appendChild(button);
+
+ }
+
+ }
+}
+
+function UiLoad()
+{
+
+
+ var thisParent = window.opener;
+
+
+ if(!thisParent)
+ {
+ alert("Auth dialog has no parent!");
+ return;
+ }
+
+ var keyID = this.name;
+
+ var ui = thisParent.getUIForKey(keyID);
+
+ var type = thisParent.getTypeForKey(keyID);
+
+ //alert("UiLoad " + ui);
+
+ if(ui)
+ {
+ ConstructUI(type,keyID,ui);
+ }
+}
+
+</script>
+</head>
+<body onload = "UiLoad()">
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/docroot/esc/home/logo.jpg b/pki/linux/tps-ui/shared/docroot/esc/home/logo.jpg
new file mode 100644
index 000000000..7cb31affc
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/home/logo.jpg
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/home/style.css b/pki/linux/tps-ui/shared/docroot/esc/home/style.css
new file mode 100755
index 000000000..e9d7d9bf7
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/home/style.css
@@ -0,0 +1,214 @@
+/* --- BEGIN COPYRIGHT BLOCK ---
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; 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 ---
+ */
+
+body {
+background-color: grey;
+ font-family: arial;
+ font-size: 7p
+
+}
+
+form {
+ margin: 0px;
+ padding: 0px;
+};
+
+* {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+h2 {
+ font-size: 12pt;
+}
+
+.logobar {
+
+ background-color:black;
+ font-family: "Arial";
+ font-size: 7p;
+
+}
+
+.headerText {
+ font-family: "Arial";
+ font-size: 14pt;
+ font-weight: bold;
+ color: white;
+}
+
+.titleText {
+ font-family: "Arial";
+ font-size: 10pt;
+}
+
+.bodyText {
+ font-family: "Arial";
+ font-size: 10pt;
+ color: white;
+}
+
+.formText {
+ font-family: "Arial";
+ font-size: 9pt;
+ color: black;
+
+}
+
+.linkText {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+#BindingTable {
+ background-color: #ffffff ;
+ font-size: 7pt;
+}
+
+#BindingTable th {
+ color: rgb(0, 0, 0);
+ background-color: #fffffe;
+ font-size: 7pt;
+}
+
+#BindingTable tr {
+ background-color: #fffffe;
+ font-size: 7pt;
+}
+
+tr [COOLKeyPresent="yes"]{
+ background-color: rgb(255, 0, 0);
+}
+
+.cylon {
+ font-size: 4pt;
+ position: relative;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: #ffffff;
+}
+
+.cylonEye {
+ font-size: 4pt;
+ position: relative;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: rgb(0, 128, 192);
+}
+
+#statusMsg {
+ font-weight: bold;
+}
+
+.ProgressMeter {
+ position: relative;
+ padding: 0px;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: #ffffff;
+ text-align: center;
+}
+
+.ProgressBar {
+ position: absolute;
+ z-index: 0;
+ top: 0px;
+ left: 0px;
+ border-right: 1px solid rgb(60, 60, 60);
+ background-color: rgb(0, 128, 192);
+ margin: 0px;
+}
+
+.ProgressBarStatus {
+ position: relative;
+ z-index: 10;
+ margin: 0px;
+ padding: 0px;
+
+}
+
+.KeyTableHeader {
+ color: rgb(0,0, 0);
+ background-color: #ffffff;
+ text-align: left;
+}
+
+#KeyTable td {
+ background-color: #ffffff;
+ padding-left: 3px;
+ padding-right: 3px;
+};
+
+.TableDescriptionPanel {
+ background-color: #ffffff);
+ margin-right: 5px;
+ margin-left: 5px;
+ margin-bottom: 0px;
+ margin-bottom: 5px;
+ padding: 5px;
+}
+
+.PurchasePanel {
+ width: 100%;
+ text-align: center;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+
+.NeedQuestionText {
+ font-size: 16pt;
+ font-weight: bold;
+}
+
+.COOLHeaderText {
+ font-family: "Arial";
+ font-size: 20pt;
+ font-weight: bold;
+}
+
+.ContentTable {
+ background-color: #ffffff;
+ margin: 0px;
+}
+
+form {
+ margin: 0px;
+ padding: 0px;
+};
+
+* {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+
+table {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+.TableTitle {
+ font-size: 12pt;
+ font-weight: bold;
+}
+
+.PageHeader {
+ width: 100%;
+ border-bottom: solid black 1px;
+ vertical-align: center;
+ background-color: #ffffff;
+}
diff --git a/pki/linux/tps-ui/shared/docroot/esc/home/util.js b/pki/linux/tps-ui/shared/docroot/esc/home/util.js
new file mode 100755
index 000000000..7bc627b44
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/home/util.js
@@ -0,0 +1,1504 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; 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 ---
+
+//
+// initialize netkey globals
+var netkey;
+
+
+var keyUITable = new Array();
+var keyTypeTable = new Array();
+var curChildWindow = null;
+
+var gWindow = null;
+
+const ErrorText = "For additional assistance contact your Technical Support";
+
+
+function getUIForKey(aKeyID)
+{
+ return keyUITable[aKeyID];
+
+}
+
+function getTypeForKey(aKeyID)
+{
+ return keyTypeTable[aKeyID];
+}
+
+
+//
+// Notify callback for GECKO
+//
+function jsNotify() {}
+
+jsNotify.prototype = {
+
+ rhNotifyKeyStateChange: function(aKeyType,aKeyID,aKeyState,aData,strData)
+ {
+ OnCOOLKeyStateChange(aKeyType, aKeyID, aKeyState, aData,strData);
+ },
+
+ QueryInterface: function(iid)
+ {
+ <!-- alert("iid: " + iid); -->
+ if(!iid.equals(Components.interfaces.rhIKeyNotify) &&
+ !iid.equals(Components.interfaces.nsISupports))
+ {
+ MyAlert("Can't find jsNotify interface");
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+ }
+ return this;
+ }
+};
+
+//
+// Attach to the object.
+//
+ // GECKO ONLY initialization
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey = Components.classes["@redhat.com/rhCoolKey"].getService();
+ netkey = netkey.QueryInterface(Components.interfaces.rhICoolKey);
+ gNotify = new jsNotify;
+ netkey.rhCoolKeySetNotifyCallback(gNotify);
+ } catch(e) {
+ MyAlert("Can't get UniversalXPConnect: " + e);
+ }
+
+//
+// unregister our notify event
+//
+function cleanup()
+{
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.rhCoolKeyUnSetNotifyCallback(gNotify);
+ } catch(e) {
+ MyAlert("Can't get UniversalXPConnect: " + e);
+ }
+}
+
+var gScreenName = "";
+var gKeyEnrollmentType = "userKey";
+
+var gCurrentSelectedRow = null;
+
+
+var gCurKeyType = null;
+var gCurKeyID = null;
+
+////////////////////////////////////////////////////////////////
+//
+// Utility functions specific to this page.
+//
+////////////////////////////////////////////////////////////////
+
+
+// List of Error Messages to be printed out
+
+var Status_Messages = new Array(
+
+ "Operation Completed Successfully.",
+ "Smartcard Server error.",
+ "Problem communicating with the smartcard.",
+ "Problem communicating with the smartcard.",
+ "Problem resetting smartcard's pin.",
+ "Internal Smartcard Server error.",
+ "Internal Smartcard Server error.",
+ "Smartcard enrollment error.",
+ "Can not communicate with the smartcard.",
+ "Internal Smartcard Server error.",
+ "Problem communicating with the Certificattion Authority.",
+ "Internal Smartcard Server error.",
+ "Error resetting the smartcard's password.",
+ "Internal Smartcard Server error.",
+ "Smartcard Server authentication failure.",
+ "Internal Smartcard Server error.",
+ "Your Smartcard is listed as disabled.",
+ "Problem communicating with the smartcard.",
+ "Internal Smartcard Server error.",
+ "Cannot upgrade smartcard software.",
+ "Internal Smartcard Server error.",
+ "Problem communicating with the smartcard.",
+ "Invalid smartcard type.",
+ "Invalid smartcard type.",
+ "Cannot publish smartcard information.",
+ "Cannot communicate with smartcard database.",
+ "Smartcard is disabled.",
+ "Cannot reset password value for the smartcard.",
+ "Connection to Smartcard Server lost.",
+ "Cannot create entry for smartcard in smartcard database.",
+ "Smartcard found to be in an inconsistent state.",
+ "Invalid reason for lost smartcard submitted.",
+ "Smartcard found to be unusable due to compromise.",
+ "No such inactive smartcard found.",
+ "Cannot process more than one active smartcard.",
+ "Internal Smartcard Server error.",
+ "Smartcard key recovery has been processed.",
+ "Smartcard key recovery failed.",
+ "Cannot process this smartcard, which has been reported lost.",
+ "Smartcard key archival error.",
+ "Problem connecting to the Smartcard TKS Server.",
+ "Failed to update smartcard database.",
+ "Internal certificate revocation error discovered.",
+ "User does not own this smartcard.",
+ "Smart Card Manager has been misconfigured.",
+ "Smart Card Manager can not talk to smart card reader.",
+ "Smart Card Manager can not establish a session with the smart card.",
+ "Smart Card Manager can not talk to Smart Card Server.",
+ "Smart Card Manager can not talk to smart card reader."
+ );
+
+function GetAuthDataFromPopUp(aKeyType,aKeyID,aUiData)
+{
+
+ keyUITable[aKeyID] = aUiData;
+ keyTypeTable[aKeyID] = aKeyType;
+
+ //alert("GetAuthDataFromPopUp data " + aUiData);
+ var child = window.open("/GenericAuth.html",aKeyID,"height=400,width=400");
+
+ //alert("Attempted to create child window " + child);
+
+ curChildWindow = child;
+
+}
+
+function COOLKeySetDataValue(aKeyType,aKeyID,name,value)
+{
+ //alert("In COOLKeySetDataValue aKeyType " + aKeyType + " aKeyID " + aKeyID + " name " + name + " value " + value);
+ if(netkey)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.SetCoolKeyDataValue(aKeyType,aKeyID,name,value);
+
+
+ } catch(e) {
+ MyAlert("Error Setting data values: " + e);
+ }
+ }
+
+}
+
+function COOLKeySetTokenPin(pin)
+{
+ if(netkey)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"TokenPin",pin);
+
+
+ } catch(e) {
+ MyAlert("Error Setting data values: " + e);
+ }
+ }
+}
+
+function COOLKeySetUidPassword(uid,pwd)
+{
+
+ if(netkey)
+ {
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"UserId",uid);
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"Password",pwd);
+
+ } catch(e) {
+ MyAlert("Error Setting data values: " + e);
+ }
+
+ }
+
+}
+
+
+function MyGetErrorMessage(status_code)
+{
+
+ var result = "Internal Server Error";
+
+ if(status_code < 0 && status_code >= Status_Messages.length)
+ {
+ return result;
+
+ }
+
+ return Status_Messages[status_code];
+
+}
+
+function KeyToRowID(keyType, keyID)
+{
+ return keyType + "--" + keyID;
+}
+
+function RowIDToKeyInfo(rowID)
+{
+ return rowID.split("--");
+}
+
+function GetRowForKey(keyType, keyID)
+{
+ return document.getElementById(KeyToRowID(keyType, keyID));
+}
+
+function ReportException(msg, e)
+{
+ MyAlert(msg + " " + e.description + "(" + e.number + ")");
+}
+
+function GetCOOLKeyStatus(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyStatus(keyType, keyID);
+ } catch (e) {
+ ReportException("netkey.GetCOOLKeyStatus() failed!", e);
+ return 0;
+ }
+}
+
+function GetCOOLKeyPolicy(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyPolicy(keyType, keyID);
+ } catch (e) {
+ // ReportException("netkey.GetCOOLKeyPolicy() failed!", e);
+ return "";
+ }
+}
+
+function GetCOOLKeyRequiresAuth(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyRequiresAuthentication(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyRequiresAuthentication() failed!", e);
+ return false;
+ }
+}
+
+function GetCOOLKeyIsAuthed(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyIsAuthenticated(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyIsAuthenticated() failed!", e);
+ return false;
+ }
+}
+
+function GetAvailableCOOLKeys()
+{
+ try {
+ var keyArr;
+
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var inArray = netkey.GetAvailableCoolKeys( {} );
+ keyArr = new Array(inArray.length);
+ var i;
+
+ for (i=0; i < keyArr.length; i++) {
+ keyArr[i] = new Array( "1", inArray[i]);
+ }
+ return keyArr;
+ } catch(e) {
+ ReportException("netkey.GetAvailableCoolKeys() failed!", e);
+ return [];
+ }
+}
+
+function EnrollCOOLKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.EnrollCoolKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode);
+ } catch(e) {
+ ReportException("netkey.EnrollCoolKey() failed!", e);
+ return false;
+ }
+
+ return true;
+}
+
+function GetCOOLKeyIsEnrolled(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyIsEnrolled(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyIsEnrolled() failed!", e);
+ return false;
+ }
+}
+
+function CancelCOOLKeyOperation(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.CancelCoolKeyOperation(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.CancelCoolKeyOperation() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+function MyAlert(message)
+{
+ if(message)
+ DoMyAlert(message,"Smart Card Manager");
+
+}
+function DoMyAlert(message,title)
+{
+
+ if(!message || !title)
+ return;
+
+ try {
+
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
+
+
+ prompts.alert(window,title,message);
+
+ } catch(e) {
+
+
+ alert("Problem with nsIPromptService " + e);
+ }
+
+}
+
+//
+// MSHTML/GECKO compatibility functions.
+//
+function RemoveRow(table, row)
+{
+ table.deleteRow(row.rowIndex);
+}
+
+function GetCell(row, index)
+{
+ var cell;
+
+ cell = row.cells[index];
+ return cell;
+}
+
+function GetNode(parent, index)
+{
+ var node;
+ node = parent.childNodes[index];
+ return node;
+}
+
+function InsertRow(table)
+{
+ var row;
+
+ row = table.insertRow(table.rows.length);
+ return row;
+}
+
+function InsertCell(row)
+{
+ var cell;
+
+ cell = row.insertCell(row.cells.length);
+ return cell;
+}
+
+function RemoveAllChildNodes(parent)
+{
+ var numChildren = parent.childNodes.length;
+ var i;
+
+ i = numChildren;
+ while (numChildren)
+ {
+ parent.removeChild(GetNode(parent,0));
+ numChildren--;
+ }
+
+}
+
+
+function UpdateInfoForKeyID(keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ return;
+
+ var cell = GetCell(row,1)
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(keyStatus));
+
+// cell = GetCell(row,2);
+ // RemoveAllChildNodes(cell);
+ // cell.appendChild(document.createTextNode(reqAuth));
+
+ // cell = GetCell(row,3);
+ // RemoveAllChildNodes(cell);
+ // cell.appendChild(document.createTextNode(isAuthed));
+}
+
+function GetStatusForKeyID(keyType, keyID)
+{
+ var keyStatus = "BLANK";
+
+ var status;
+
+ try {
+ status = GetCOOLKeyStatus(keyType, keyID);
+ } catch(e) {
+ status = 0;
+ }
+
+ switch (status) {
+ case 0: // Unavailable
+ keyStatus = "UNAVAILABLE";
+ break;
+ case 1: // AppletNotFound
+ keyStatus = "NO APPLET";
+ break;
+ case 2: // Uninitialized
+ keyStatus = "UNINITIALIZED";
+ break;
+ case 3: // Unknown
+ keyStatus = "UNKNOWN";
+ break;
+ case 4: // Available
+ case 6: // UnblockInProgress
+ case 7: // PINResetInProgress
+ case 8: // RenewInProgress
+ keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ break;
+ case 5: // EnrollmentInProgress
+ keyStatus = "BUSY";
+ break;
+ break;
+ case 9: // FormatInProgress
+ keyStatus = "BUSY";
+ break;
+ }
+
+ return keyStatus;
+}
+
+function InsertCOOLKeyIntoBindingTable(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ gWindow = window;
+ if (!row)
+ {
+ var table = document.getElementById("BindingTable");
+ if (table)
+ {
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ row = CreateTableRow(table, keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ }
+
+ if (!row)
+ return null;
+ }
+
+ return row;
+}
+
+function ConvertVariantArrayToJScriptArray(varr)
+{
+ // C++ native methods, like netkey.GetAvailableCOOLKeys(), can only
+ // return variant SafeArrays, so to access the data inside, you must
+ // first convert it to a VBArray, and then call toArray() to convert
+ // it to a JScript array. Lame, but that's what it takes to
+ // use an array returned from an ActiveX component.
+
+ return new VBArray(varr).toArray();
+}
+
+function UpdateBindingTableAvailability()
+{
+ var arr = GetAvailableCOOLKeys();
+
+ if (!arr || arr.length < 1)
+ return;
+
+ var i;
+
+ for (i=0; i < arr.length; i++)
+ {
+ InsertCOOLKeyIntoBindingTable(arr[i][0], arr[i][1]);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(arr[i][0], arr[i][1]);
+ }
+}
+
+function InitializeBindingTable()
+{
+ UpdateBindingTableAvailability();
+ UpdateButtonStates();
+}
+
+function KeyIsPresent(keyType, keyID)
+{
+ row = document.all.item(keyType, keyID);
+
+ if (!row)
+ return false;
+
+ return true;
+}
+
+function SetStatusMessage(str)
+{
+ var cell = document.getElementById("statusMsg");
+
+ if (!cell)
+ return;
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(str));
+}
+
+function UpdateButtonStates()
+{
+ if (gCurrentSelectedRow)
+ {
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+
+ document.getElementById("enrollbtn").disabled = false;
+ }
+ else
+ {
+ document.getElementById("enrollbtn").disabled = true;
+ }
+
+ refresh();
+}
+
+function SetEnrollmentType(type)
+{
+ gKeyEnrollmentType = type;
+ UpdateButtonStates();
+}
+
+function FindRow(node)
+{
+ while (node && node.tagName != "TR")
+ {
+ node = node.parentNode;
+ }
+
+ return node;
+}
+
+function SelectRow(row)
+{
+ if (!row || gCurrentSelectedRow == row)
+ return;
+
+ if (gCurrentSelectedRow)
+ gCurrentSelectedRow.removeAttribute("style");
+
+ gCurrentSelectedRow = row;
+ gCurrentSelectedRow.style.backgroundColor="rgb(200,200,200)";
+ UpdateButtonStates();
+}
+
+function SelectRowByKeyID(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ SelectRow(row);
+}
+
+function DoSelectRow(event)
+{
+ var row;
+
+ row = FindRow(event.parentNode);
+ SelectRow(row);
+}
+
+function KeyToUIString(keyType, keyID)
+{
+ // If it's an COOLKey, format the keyID string.
+
+ if (keyType == 1 && keyID.length == 20)
+ {
+ var re = /([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})/i;
+ keyID = keyID.replace(re, "$1-$2-$3-$4-$5").toLowerCase();
+ }
+
+ return keyID;
+}
+
+
+
+function CreateTableRow(table, keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+ var row = InsertRow(table);
+ if (!row)
+ return null;
+
+ row.setAttribute("id", KeyToRowID(keyType, keyID));
+
+ row.onclick = DoSelectRow;
+
+ // Create the key ID cell.
+ //cell = InsertCell(row);
+ //cell.appendChild(document.createTextNode(KeyToUIString(keyType, keyID)));
+
+ //cell.setAttribute("onClick", "DoSelectRow(this);");
+
+ // Create the keyStatus cell.
+ //cell = InsertCell(row);
+ //cell.appendChild(document.createTextNode(keyStatus));
+
+ // Create the requires auth cell.
+ // cell = InsertCell(row);
+ // cell.appendChild(document.createTextNode(reqAuth));
+
+ cell = InsertCell(row);
+ cell.appendChild(document.createTextNode("Enrollment Progress"));
+
+ // Create the status bar cell
+
+ cell = InsertCell(row);
+
+ var progressMeter = document.createElement("div");
+ progressMeter.setAttribute("id", KeyToProgressBarID(keyType, keyID));
+ progressMeter.className = "ProgressMeter";
+ progressMeter.style.width = "100px";
+ progressMeter.style.height = "1.5em";
+// progressMeter.style.visibility = "hidden";
+ progressMeter.setAttribute("value", 0);
+
+ var progressBar = document.createElement("div");
+ progressBar.className = "ProgressBar";
+ progressBar.style.width = "0px";
+ progressBar.style.height = "100%";
+// progressBar.style.visibility = "hidden";
+
+ var progressBarStatus = document.createElement("div");
+ progressBarStatus.className = "ProgressBarStatus";
+ progressBarStatus.appendChild(document.createTextNode(""));
+
+ progressMeter.appendChild(progressBar);
+ progressMeter.appendChild(progressBarStatus);
+ cell.appendChild(progressMeter);
+
+ //row.style.display ="none";
+
+ return row;
+}
+
+gAnimationMSecs = 1000/30;
+
+function SetCylonTimer(cylonID, cylonEyeID)
+{
+ setTimeout("AnimateCylonStatusBar(\"" + cylonID +
+ "\", \"" + cylonEyeID + "\");", gAnimationMSecs);
+}
+
+function AnimateCylonStatusBar(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID);
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ return;
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (!eye)
+ return;
+
+ var dir = eye.getAttribute("direction");
+ var wid = parseInt(eye.style.width);
+ var cywid = parseInt(cylon.style.width);
+ var left = parseInt(eye.style.left);
+
+ var dx = 10;
+
+ if (!dir || dir >= 0)
+ {
+ left += dx;
+
+ if (left + wid > cywid)
+ {
+ left = cywid - wid;
+ eye.setAttribute("direction", "-1");
+ }
+ }
+ else
+ {
+ left -= dx;
+
+ if (left < 0)
+ {
+ left = 0;
+ eye.setAttribute("direction", "1");
+ }
+ }
+
+ eye.style.left = left + "px";
+
+ SetCylonTimer(cylonID, cylonEyeID);
+}
+
+function StartCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ {
+ cylon.setAttribute("cylonactive", "true");
+
+ var eye = document.getElementById(cylonEyeID);
+ if (eye)
+ {
+ eye.style.left = "0px";
+ eye.style.visibility = "visible";
+ }
+
+ SetCylonTimer(cylonID, cylonEyeID);
+ }
+}
+
+function StopCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (cylon)
+ cylon.removeAttribute("cylonactive");
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (eye)
+ eye.style.visibility = "hidden";
+}
+
+function GetProgressMeterValue(progMeterID)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return -1;
+
+ return parseInt(progMeter.getAttribute("value"));
+}
+
+function SetProgressMeterValue(progMeterID, value)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter || value < 0)
+ return;
+
+ if (value > 100)
+ value = 100;
+
+ var progBar = progMeter.firstChild;
+
+ if (value == 0)
+ {
+ progBar.style.width = "0px";
+ progBar.style.visibility = "hidden";
+ progMeter.setAttribute("value", 0);
+ return;
+ }
+
+ progBar.style.visibility = "visible";
+
+ var newWidth = parseInt(progMeter.style.width) * value / 100 - 2;
+
+ progBar.style.width = newWidth + "px";
+ progMeter.setAttribute("value", value);
+}
+
+function SetProgressMeterStatus(progMeterID, statusMsg)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return;
+
+ var progBar = progMeter.firstChild;
+
+ // If it exists, the meter status should be
+ // div that is the next sibling of the progressMeter.
+
+ var meterStatus = progBar.nextSibling;
+
+ // Just replace the data in the text node, it's much faster,
+ // and reduces flashing!
+
+ meterStatus.firstChild.replaceData(0, meterStatus.firstChild.length, statusMsg);
+}
+
+function ClearProgressBar(progMeterID)
+{
+ SetProgressMeterValue(progMeterID, 0);
+ SetProgressMeterStatus(progMeterID, "");
+}
+
+function KeyToProgressBarID(keyType, keyID)
+{
+ return "PM" + keyType + "-" + keyID;
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions that contact the server or talk directly to
+// ESC native code.
+//
+// ESC Native Functions:
+//
+// netkey.GetAvailableCOOLKeys()
+//
+// - Returns an ActiveX Variant SafeArray containing the ID for each key
+// that is currentlly plugged into the computer. Before accessing any
+// data in this array you must convert it to a JScript Array with a
+// call to ConvertVariantArrayToJScriptArray().
+//
+// netkey.GetCOOLKeyIsEnrolled(keyType, keyID)
+//
+// - Returns true if a key has been initialized, false if it hasn't.
+// Initialized means the card has been formatted with certificates
+// for either an COOL HouseKey or NetKey.
+//
+// netkey.EnrollCOOLKey(keyType, keyID, enrollmentType, screenName, pin)
+//
+// - Initiates an async connection to the RA to initialize a specific
+// key. If you want the key to be initialized as a HouseKey, you should
+// pass "houseKey" as the enrollmentType, and null values for both
+// screenName and pin. For a NetKey, use "netKey" as the enrollmentType,
+// and pass a valid screenName and pin.
+//
+//
+////////////////////////////////////////////////////////////////
+
+function GetScreenNameValue()
+{
+ var sname = document.getElementById("snametf").value;
+
+ if (! sname)
+ {
+ MyAlert("You must provide a valid LDAP User ID!");
+ return null;
+ }
+
+ return sname;
+}
+
+function GetPINValue()
+{
+ var pinVal = document.getElementById("pintf").value;
+ var rpinVal = document.getElementById("reenterpintf").value;
+
+ if (! pinVal)
+ {
+ MyAlert("You must provide a valid Key Password!");
+ return null;
+ }
+
+ if ( pinVal != rpinVal)
+ {
+ MyAlert("The Key Password values you entered do not match!");
+ return null;
+ }
+
+ return pinVal;
+}
+
+function GetScreenNamePwd()
+{
+
+ var pwd = document.getElementById("snamepwd").value;
+
+ if(!pwd)
+ {
+ MyAlert("You must provide a valid LDAP User ID !");
+ return null;
+ }
+ return pwd;
+}
+
+function GetTokenCode()
+{
+
+ return null;
+}
+function DoEnrollCOOLKey()
+{
+
+ if (!gCurrentSelectedRow)
+ {
+ MyAlert("Please select a key.");
+ return;
+ }
+
+
+ if(!Validate())
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ if (type == "userKey")
+ {
+ screenname = GetScreenNameValue();
+
+ pin = GetPINValue();
+
+
+ screennamepwd = GetScreenNamePwd();
+
+ tokencode = GetTokenCode();
+
+ //SetStatusMessage("Enrolling UserKey \"" + KeyToUIString(keyType, keyID) + "\"...");
+ }
+
+ StartCylonAnimation("cylon1", "eye1");
+
+ var doShow = true;
+
+ ShowProgressBar(keyType,keyID,doShow );
+
+ if (!EnrollCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ var doShow = false;
+ ShowProgressBar(aKeyType,aKeyID,doShow );
+ }
+}
+
+function DoResetSelectedCOOLKeyPIN()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ if(!Validate())
+ return;
+
+ //alert("In DoResetSelectedCOOLKeyPIN!");
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var screenname = null;
+ var pin = null;
+ var screennamepwd = null;
+
+ if (GetCOOLKeyIsEnrolled(keyType, keyID))
+ {
+
+ SetStatusMessage("Resetting PIN for \"" + keyID + "\"...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!ResetCOOLKeyPIN(keyType, keyID, screenname, pin,screennamepwd))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+ }
+}
+
+function DoFormatCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+
+ if(!Validate())
+ return;
+
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ SetStatusMessage("Formatting \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!FormatCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+}
+function DoCancelOperation()
+{
+
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ SetStatusMessage("Cancel operation for \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ CancelCOOLKeyOperation(keyType, keyID);
+
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+}
+
+function DoChallengeSelectedKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Generating Challenge ...");
+
+ var challengeArray = ChallengeCOOLKey(keyType, keyID, document.forms[0].challengedata.value);
+
+ if (challengeArray.length != 4)
+ {
+ MyAlert("Challenge for key \"" + KeyToUIString(keyType, keyID) + "\" failed!");
+ SetStatusMessage("");
+ return;
+ }
+
+ MyAlert("ChallengeCOOLKey(\""+ KeyToUIString(keyType, keyID) + "\") returned:\n\n" +
+ "challenge[0]: " + challengeArray[0] + "\n" +
+ "challenge[1]: " + challengeArray[1] + "\n" +
+ "challenge[2]: " + challengeArray[2] + "\n" +
+ "challenge[3]: " + challengeArray[3] + "\n");
+
+ SetStatusMessage("");
+}
+
+function DoBlinkCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Blinking \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ BlinkCOOLKey(keyType, keyID, 400, 5000);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+}
+
+function OnCOOLKeyBlinkComplete(keyType,keyID)
+{
+ //StopCylonAnimation("cylon1", "eye1");
+ //SetStatusMessage(" ");
+}
+
+function DoHelp()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ var policy = GetCOOLKeyPolicy(keyType, keyID);
+ var type = PolicyToKeyType(policy);
+ MyAlert("Policy: " + policy + "\n" + "Type: " + type);
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions called directly from ASC native code.
+//
+////////////////////////////////////////////////////////////////
+
+function OnCOOLKeyInserted(keyType, keyID)
+{
+ var row = InsertCOOLKeyIntoBindingTable(keyType, keyID);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(keyType, keyID);
+}
+
+
+function OnCOOLKeyRemoved(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ var table = document.getElementById("BindingTable");
+
+ if (row && table)
+ {
+ RemoveRow(table,row);
+
+ if (row == gCurrentSelectedRow)
+ gCurrentSelectedRow = null;
+ }
+
+ UpdateButtonStates();
+}
+
+var gKnownPolicies = [
+
+ // OID Value, precedence, name value
+
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.4", 4, "NETKEY" ], // Platinum - MyDoctor
+
+ // XXX: Remove the Old OIDs below, after the RA starts generating
+ // certificates with the OIDs listed above!
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.4", 4, "NETKEY" ] // Platinum - MyDoctor
+];
+
+function PolicyToKeyType(policy)
+{
+ return "ENROLLED";
+}
+
+function OldPolicyToKeyType(policy)
+{
+ var i, j;
+
+ var knownPoliciesIndex = -1;
+
+
+ var policies;
+
+
+ if (policy.indexOf(",")== -1)
+ {
+ policies = new Array(1);
+ policies[0] = policy;
+ }
+ else
+ {
+ policies = policy.split(",");
+ }
+
+ for (j = 0; j < policies.length; j++)
+ {
+ for (i = 0; i < gKnownPolicies.length; i++)
+ {
+ if (gKnownPolicies[i][0] == policies[j])
+ {
+ if (knownPoliciesIndex < gKnownPolicies[i][1])
+ knownPoliciesIndex = i;
+ }
+ }
+ }
+
+ if (knownPoliciesIndex == -1)
+ return "INITIALIZED";
+
+ return gKnownPolicies[knownPoliciesIndex][2];
+}
+
+function BoolToYesNoStr(b)
+{
+ if (b)
+ return "YES";
+ return "NO";
+}
+
+function OnCOOLKeyEnrollmentComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ //UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ var doShow = false;
+ ShowProgressBar(keyType,keyID, doShow);
+ SetStatusMessage("");
+ MyAlert("Enrollment of smartcard complete!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+
+ window.setTimeout("loadSuccessPage()",4);
+}
+
+function OnCOOLKeyPINResetComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ MyAlert("Password Reset was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyFormatComplete(keyType, keyID)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ MyAlert("Format of \"" + KeyToUIString(keyType, keyID)+ "\" was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyStateError(keyType, keyID, keyState, errorCode)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ if(curChildWindow)
+ {
+ curChildWindow.close();
+ curChildWindow = null;
+
+ }
+
+ var doShow = false;
+ ShowProgressBar(keyType,keyID, doShow);
+
+ //UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+
+ var typeStr = "Error(" + errorCode + ")";
+
+ var messageStr = " \n\n Error Response: " + MyGetErrorMessage(errorCode) ;
+
+ var keyIDStr = KeyToUIString(keyType, keyID);
+
+ if (keyState == 1004)
+ typeStr = "Enrollment of key failed. " + typeStr + messageStr ;
+ else if (keyState == 1016)
+ typeStr = "Formatting of key failed. " + typeStr + messageStr;
+ else if (keyState == 1010)
+ typeStr = "PIN Reset for key failed. " + typeStr + messageStr;
+ else if (keyState == 1020)
+ typeStr = "Operation for key canceled.";
+
+ typeStr += " \n " + ErrorText;
+ MyAlert(typeStr);
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyStatusUpdate(progMeterID, statusUpdate)
+{
+ SetProgressMeterValue(progMeterID, statusUpdate);
+ SetProgressMeterStatus(progMeterID, statusUpdate + "%");
+}
+
+function Validate()
+{
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ if (type == "userKey")
+ {
+ screenname = GetScreenNameValue();
+ if (! screenname)
+ return 0;
+
+ screennamepwd = GetScreenNamePwd();
+
+ if(! screennamepwd)
+ return 0;
+
+ pin = GetPINValue();
+
+ if (! pin)
+ return 0;
+
+ }
+
+ return 1;
+}
+
+function OnCOOLKeyStateChange(keyType, keyID, keyState, data,strData)
+{
+ // alert("KeyID: " + keyID + "\n" +
+ // "KeyState: " + keyState + "\n" +
+ // "Data: " + data);
+ //alert("State Change ="+keyState);
+
+ switch(keyState)
+ {
+ case 1000: // KeyInserted
+ OnCOOLKeyInserted(keyType, keyID);
+ break;
+ case 1001: // KeyRemoved
+ OnCOOLKeyRemoved(keyType, keyID);
+ break;
+ case 1002: // EnrollmentStart
+ // OnCOOLKeyEnrollmentStart(keyType, keyID);
+ break;
+ case 1003: // EnrollmentComplete
+ OnCOOLKeyEnrollmentComplete(keyType, keyID);
+ break;
+ case 1004: // EnrollmentError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1008: // PINResetStart
+ // OnCOOLKeyPINResetStart(keyType, keyID);
+ break;
+ case 1009: // PINResetComplete
+ OnCOOLKeyPINResetComplete(keyType, keyID);
+ break;
+ case 1010: // PINResetError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1014: // FormatStart
+ // OnCOOLKeyFormatStart(keyType, keyID);
+ break;
+ case 1015: // FormatComplete
+ OnCOOLKeyFormatComplete(keyType, keyID);
+ break;
+ case 1016: // FormatError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1017: // BlinkStatus Update?
+ //OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1018:
+ OnCOOLKeyBlinkComplete(keyType, keyID);
+ break;
+ case 1020: // OperationCancelled
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1021: // OperationStatusUpdate
+ OnCOOLKeyStatusUpdate(KeyToProgressBarID(keyType, keyID), data);
+ break;
+
+ case 1022: //Need Auth
+
+
+ gCurKeyID = keyID;
+ gCurKeyType = keyType;
+
+ GetAuthDataFromPopUp(keyType,keyID,strData);
+
+ break;
+
+ }
+}
+
+function refresh()
+{
+ window.resizeBy(0,1);
+ window.resizeBy(0,-1);
+
+}
+
+function loadSuccessPage()
+{
+ window.location="/home/EnrollSuccess.html";
+}
+
+function ShowProgressBar(aKeyType,aKeyID, doShow)
+{
+ if(!gCurrentSelectedRow)
+ return;
+
+ if(doShow)
+ gCurrentSelectedRow.style.display="table-row";
+ else
+ {
+ gCurrentSelectedRow.style.display="none";
+ }
+}
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/BannerBackground.gif b/pki/linux/tps-ui/shared/docroot/esc/images/BannerBackground.gif
new file mode 100755
index 000000000..55d41f6ea
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/BannerBackground.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/CancelButton.gif b/pki/linux/tps-ui/shared/docroot/esc/images/CancelButton.gif
new file mode 100755
index 000000000..5b2f7e53a
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/CancelButton.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/CloseButton.gif b/pki/linux/tps-ui/shared/docroot/esc/images/CloseButton.gif
new file mode 100755
index 000000000..f0a8230a1
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/CloseButton.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/ContinueButton.gif b/pki/linux/tps-ui/shared/docroot/esc/images/ContinueButton.gif
new file mode 100755
index 000000000..3a6867258
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/ContinueButton.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/HelpButton.gif b/pki/linux/tps-ui/shared/docroot/esc/images/HelpButton.gif
new file mode 100755
index 000000000..43e55dce2
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/HelpButton.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/NetKey-Small.gif b/pki/linux/tps-ui/shared/docroot/esc/images/NetKey-Small.gif
new file mode 100755
index 000000000..6fed0d5ce
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/NetKey-Small.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyInsert.gif b/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyInsert.gif
new file mode 100755
index 000000000..4fb74b2b7
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyInsert.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyLogo.gif b/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyLogo.gif
new file mode 100755
index 000000000..53af00410
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyLogo.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyPair.gif b/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyPair.gif
new file mode 100755
index 000000000..b1ff91b5e
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyPair.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyProgress.gif b/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyProgress.gif
new file mode 100755
index 000000000..aaadf358f
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyProgress.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyQuestionMark.gif b/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyQuestionMark.gif
new file mode 100755
index 000000000..b12a77908
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/NetKeyQuestionMark.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/OKButton.gif b/pki/linux/tps-ui/shared/docroot/esc/images/OKButton.gif
new file mode 100755
index 000000000..64d69e440
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/OKButton.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/PadLock.gif b/pki/linux/tps-ui/shared/docroot/esc/images/PadLock.gif
new file mode 100755
index 000000000..5e4e044c8
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/PadLock.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/PurchaseButton.gif b/pki/linux/tps-ui/shared/docroot/esc/images/PurchaseButton.gif
new file mode 100755
index 000000000..beb0dacab
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/PurchaseButton.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/ReactivateButton.gif b/pki/linux/tps-ui/shared/docroot/esc/images/ReactivateButton.gif
new file mode 100755
index 000000000..86de2eb68
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/ReactivateButton.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/ReleaseButton.gif b/pki/linux/tps-ui/shared/docroot/esc/images/ReleaseButton.gif
new file mode 100755
index 000000000..7ab79be8c
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/ReleaseButton.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/SecureButton.gif b/pki/linux/tps-ui/shared/docroot/esc/images/SecureButton.gif
new file mode 100755
index 000000000..fc37f2a77
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/SecureButton.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/SuspendButton.gif b/pki/linux/tps-ui/shared/docroot/esc/images/SuspendButton.gif
new file mode 100755
index 000000000..24ac0337a
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/SuspendButton.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/TryAgainButton.gif b/pki/linux/tps-ui/shared/docroot/esc/images/TryAgainButton.gif
new file mode 100755
index 000000000..e71934677
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/TryAgainButton.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/bg.jpg b/pki/linux/tps-ui/shared/docroot/esc/images/bg.jpg
new file mode 100755
index 000000000..56a4af048
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/bg.jpg
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/images/logo.gif b/pki/linux/tps-ui/shared/docroot/esc/images/logo.gif
new file mode 100644
index 000000000..2d1ea5579
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/images/logo.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/so/EnrollSuccess.html b/pki/linux/tps-ui/shared/docroot/esc/so/EnrollSuccess.html
new file mode 100644
index 000000000..edfa30e6b
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/so/EnrollSuccess.html
@@ -0,0 +1,45 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<link rel=stylesheet href="/home/style.css" type="text/css">
+<title>Success!</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
+<table width="100%" border="0" cellspacing="0" cellpadding="0" class="logobar">
+ <tr>
+ <td bgcolor="#000000">&nbsp;&nbsp;&nbsp;<img src="/home/logo.jpg" width="250" height="50"></td>
+ </tr>
+</table>
+
+<p class="bodyText" >
+Congratulations! You have successfully Enrolled your Security Officer Smartcard! Now that you have enrolled, you will be able to access the Security Officer Workstation.
+
+</p>
+<p class="bodyText">
+
+</p>
+
+</body>
+
+</html>
+
diff --git a/pki/linux/tps-ui/shared/docroot/esc/so/GenericAuth.html b/pki/linux/tps-ui/shared/docroot/esc/so/GenericAuth.html
new file mode 100755
index 000000000..5660a7c50
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/so/GenericAuth.html
@@ -0,0 +1,539 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<style>
+
+body {
+background: #ffffff url(../images/bg.jpg) repeat-x;
+ font-family: arial;
+ font-size: 7pt;
+
+}
+
+h1
+{
+ text-align: left;
+
+ font-weight: bold;
+
+ font-size: 13pt;
+
+
+}
+
+
+h2 {
+
+ text-align: left;
+ font-size: 10pt;
+
+ font-weight: lighter;
+}
+
+</style>
+<script language = "Javascript">
+
+var test_ui = "id=USER_ID&name=User ID&desc=User ID&type=string&option=option1,option2,option3&&id=USER_PWD&name=User Password&desc=User Password&type=password&option=&&id=USER_PIN&name=PIN&desc=One time PIN received via mail&type=password&option=";
+
+var theForm = null;
+var curKeyID = null;
+var curKeyType = 0;
+
+
+var gTitle = null;
+var gDescription = null;
+
+
+
+function ConfirmPassword(password_element)
+{
+
+ if(!password_element)
+ return 0;
+
+ password_id = password_element.id;
+
+ if(!password_id)
+ return 0;
+
+ confirm_id = "RE_" + password_element.id;
+
+ var size = theForm.length;
+
+ if(theForm)
+ {
+ for(i = 0; i < size ; i++)
+ {
+ var cur_element = theForm.elements[i];
+
+ if(cur_element.id == confirm_id)
+ {
+ if(cur_element.value != password_element.value)
+ {
+ alert("Value " + password_element.name + " must match " + cur_element.name);
+ return 0;
+
+ }
+ else
+ {
+ return 1;
+ }
+
+ }
+
+ }
+
+ }
+
+ return 1;
+}
+
+function Validate()
+{
+ if(theForm)
+ {
+ var size = theForm.length;
+
+ for( i = 0; i < size ; i++)
+ {
+ var element = theForm.elements[i];
+
+ if(element.type == "text" )
+ {
+ if(element.value == "")
+ {
+ alert("Please enter value for " + element.name);
+ return 0;
+ }
+ }
+
+ if(element.type == "password")
+ {
+ if(element.value == "")
+ {
+ alert("Please enter value for " + element.name);
+ return 0;
+ }
+
+ if(!ConfirmPassword(element))
+ {
+ return 0;
+ }
+
+ }
+ }
+
+ }
+
+ return 1;
+}
+
+function FormSubmit()
+{
+ var result = Validate();
+
+ var thisParent = window.opener;
+
+ if(!parent)
+ {
+ alert("No parent window.");
+ window.close();
+ return;
+ }
+
+ if(!result)
+ {
+ return;
+ }
+
+ if(theForm)
+ {
+ var size = theForm.length;
+ for( i = 0; i < size ; i++)
+ {
+ var element = theForm.elements[i];
+
+ var value = element.value;
+
+ if(element.type == "text" )
+ {
+ var id = element.id;
+ value = element.value;
+
+ if(thisParent)
+ {
+ //alert("about to set data value key " + curKeyID + " id " + id + " value " + value);
+ thisParent.COOLKeySetDataValue(curKeyType,curKeyID,id,value);
+
+ }
+ }
+
+ if(element.type == "password")
+ {
+ var p_id = new String(element.id);
+
+ if(p_id.indexOf("RE_") == -1)
+ {
+ if(thisParent)
+ {
+ thisParent.COOLKeySetDataValue(curKeyType,curKeyID,p_id,value);
+ }
+ }
+ }
+ }
+
+ }
+
+ window.close();
+}
+
+function GetUIObjectList(uiData)
+{
+ var str = new String(uiData);
+ var splits = str.split("&&");
+
+// alert("Get " + splits + " len " + splits.length);
+
+ var params = new Array();
+ var size = splits.length;
+
+ for(i = 0 ; i < size ; i++)
+ {
+ params[i] = splits[i].split("&");
+ }
+
+ size = params.length;
+ var name_value_objects = new Array();
+
+ for(i = 0 ; i < size; i++)
+ {
+ var name_values = new Array();
+
+ pISize = params[i].length;
+ for(j = 0 ; j < pISize ; j ++)
+ {
+ var pair = params[i][j].split("=");
+
+ //alert(" pair " + pair[0] + " pair1 " + pair[1]);
+
+ if(pair[0] == "option")
+ {
+ var options = pair[1].split(",");
+ }
+
+ name_values[pair[0]] = pair[1];
+ }
+
+ name_value_objects[i] = name_values;
+ }
+
+ return name_value_objects;
+
+}
+
+function AddBRToNode(theNode)
+{
+
+ if(!theNode)
+ return;
+
+ var br = document.createElement("br");
+
+ theNode.appendChild(br);
+
+}
+
+function AddTextToNode(theNode,theText)
+{
+
+ if(!theNode || !theText)
+ return;
+
+
+ var text = document.createTextNode(theText);
+
+ theNode.appendChild(text);
+
+
+
+
+}
+function AddTextToDocument(theText)
+{
+ if(!theText)
+ return;
+
+ var p = document.createElement("p");
+
+ if(p)
+ {
+ p.appendChild(document.createTextNode(theText));
+ }
+
+ document.body.appendChild(p);
+}
+
+function CreateForm()
+{
+ var form = document.createElement("form");
+ document.body.appendChild(form);
+ return form;
+}
+
+function CreateTable()
+{
+ var table = document.createElement("table");
+ document.body.appendChild(table);
+ tbody = document.createElement("tbody");
+ table.appendChild(tbody);
+
+ return table;
+}
+
+function AddRowToTable(table)
+{
+ if(!table)
+ return null;
+
+ var tr = document.createElement("tr");
+ (table.tBodies[0]).appendChild(tr);
+
+ return tr;
+}
+
+function AddColumnToRow(row)
+{
+ if(!row)
+ return null;
+
+ var td = document.createElement("td");
+ row.appendChild(td);
+
+ return td;
+}
+
+function AddTextToColumn(column,text)
+{
+ if(!column || !text)
+ return;
+
+ var text_node = document.createTextNode(text);
+ column.appendChild(text_node);
+
+ return text_node;
+}
+
+function AddInputField(type,id, name,value)
+{
+ var field = document.createElement("input");
+
+ if(!field)
+ return null;
+
+ field.type = type;
+ field.id =id;
+ field.name =name;
+ field.value =value;
+
+ return field;
+}
+
+function ConstructUI(aKeyType,aKeyID,uiData)
+{
+
+ //alert("Construct UI data " + uiData);
+ var name_value_objects = GetUIObjectList(uiData);
+ var len = name_value_objects.length;
+
+ gTitle = document.createElement("h1");
+
+ gDescription = document.createElement("h2");
+
+
+ document.body.appendChild(gTitle);
+
+
+ document.body.appendChild(gDescription);
+
+
+ form = CreateForm();
+ theForm = form;
+ curKeyID = aKeyID;
+ curKeyType = aKeyType;
+
+ table = CreateTable();
+
+ form.appendChild(table);
+
+ for(i = 0 ; i < len ; i ++)
+ {
+ curParameter = name_value_objects[i];
+
+ if(curParameter)
+ {
+
+ title = curParameter["title"];
+
+
+ if(title)
+ {
+ //alert("title " + title);
+
+ AddTextToNode(gTitle,title);
+
+
+ }
+
+ description = curParameter["description"];
+
+ if(description)
+ {
+ AddBRToNode(document.body);
+ AddBRToNode(document.body);
+
+ AddTextToNode(gDescription,description);
+
+ AddBRToNode(document.body);
+
+ }
+
+ id = curParameter["id"];
+ name = curParameter["name"];
+ type = curParameter["type"];
+ desc = curParameter["desc"];
+
+ //alert(" id " + id + " name " + name + " type " + type + " desc " + desc);
+
+ if(id)
+ {
+ if(table)
+ {
+ row = AddRowToTable(table);
+ }
+
+ if(row)
+ {
+ column = AddColumnToRow(row);
+ }
+
+ if(column)
+ {
+ AddTextToColumn(column,name);
+ }
+
+ if(type == "string" || type == "integer")
+ {
+ field = AddInputField("text",id,name,"");
+ }
+
+ re_field = null;
+
+ if(type == "password")
+ {
+ field = AddInputField("password",id,name,"");
+ }
+
+ if(type == "hidden")
+ {
+ field = AddInputField("hidden",id,name,"");
+ }
+
+ if(field)
+ {
+ field_col = AddColumnToRow(row);
+ if(field_col)
+ {
+ field_col.appendChild(field);
+ }
+ }
+
+ if(re_field)
+ {
+ re_text = AddColumnToRow(row);
+
+ if(re_text)
+ {
+ AddTextToColumn(re_text,"Confirm " + name);
+ re_field_col = AddColumnToRow(row);
+ if(re_field_col)
+ {
+ re_field_col.appendChild(re_field);
+ }
+
+ }
+
+ }
+ }
+
+ }
+
+ }
+
+ var last_row = AddRowToTable(table);
+
+ if(last_row)
+ {
+ var button_field = AddColumnToRow(last_row);
+
+ if(button_field)
+ {
+ var button = AddInputField("button","Submit","Submit","Submit");
+ button.onclick = FormSubmit;
+ button_field.appendChild(button);
+
+ }
+
+ }
+}
+
+function UiLoad()
+{
+
+
+ var thisParent = window.opener;
+
+
+ if(!thisParent)
+ {
+ alert("Auth dialog has no parent!");
+ return;
+ }
+
+ var keyID = this.name;
+
+ var ui = thisParent.getUIForKey(keyID);
+
+ var type = thisParent.getTypeForKey(keyID);
+
+ //alert("UiLoad " + ui);
+
+ if(ui)
+ {
+ ConstructUI(type,keyID,ui);
+ }
+}
+
+</script>
+</head>
+<body onload = "UiLoad()">
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/docroot/esc/so/logo.jpg b/pki/linux/tps-ui/shared/docroot/esc/so/logo.jpg
new file mode 100644
index 000000000..7cb31affc
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/so/logo.jpg
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/so/style.css b/pki/linux/tps-ui/shared/docroot/esc/so/style.css
new file mode 100755
index 000000000..e9d7d9bf7
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/so/style.css
@@ -0,0 +1,214 @@
+/* --- BEGIN COPYRIGHT BLOCK ---
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; 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 ---
+ */
+
+body {
+background-color: grey;
+ font-family: arial;
+ font-size: 7p
+
+}
+
+form {
+ margin: 0px;
+ padding: 0px;
+};
+
+* {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+h2 {
+ font-size: 12pt;
+}
+
+.logobar {
+
+ background-color:black;
+ font-family: "Arial";
+ font-size: 7p;
+
+}
+
+.headerText {
+ font-family: "Arial";
+ font-size: 14pt;
+ font-weight: bold;
+ color: white;
+}
+
+.titleText {
+ font-family: "Arial";
+ font-size: 10pt;
+}
+
+.bodyText {
+ font-family: "Arial";
+ font-size: 10pt;
+ color: white;
+}
+
+.formText {
+ font-family: "Arial";
+ font-size: 9pt;
+ color: black;
+
+}
+
+.linkText {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+#BindingTable {
+ background-color: #ffffff ;
+ font-size: 7pt;
+}
+
+#BindingTable th {
+ color: rgb(0, 0, 0);
+ background-color: #fffffe;
+ font-size: 7pt;
+}
+
+#BindingTable tr {
+ background-color: #fffffe;
+ font-size: 7pt;
+}
+
+tr [COOLKeyPresent="yes"]{
+ background-color: rgb(255, 0, 0);
+}
+
+.cylon {
+ font-size: 4pt;
+ position: relative;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: #ffffff;
+}
+
+.cylonEye {
+ font-size: 4pt;
+ position: relative;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: rgb(0, 128, 192);
+}
+
+#statusMsg {
+ font-weight: bold;
+}
+
+.ProgressMeter {
+ position: relative;
+ padding: 0px;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: #ffffff;
+ text-align: center;
+}
+
+.ProgressBar {
+ position: absolute;
+ z-index: 0;
+ top: 0px;
+ left: 0px;
+ border-right: 1px solid rgb(60, 60, 60);
+ background-color: rgb(0, 128, 192);
+ margin: 0px;
+}
+
+.ProgressBarStatus {
+ position: relative;
+ z-index: 10;
+ margin: 0px;
+ padding: 0px;
+
+}
+
+.KeyTableHeader {
+ color: rgb(0,0, 0);
+ background-color: #ffffff;
+ text-align: left;
+}
+
+#KeyTable td {
+ background-color: #ffffff;
+ padding-left: 3px;
+ padding-right: 3px;
+};
+
+.TableDescriptionPanel {
+ background-color: #ffffff);
+ margin-right: 5px;
+ margin-left: 5px;
+ margin-bottom: 0px;
+ margin-bottom: 5px;
+ padding: 5px;
+}
+
+.PurchasePanel {
+ width: 100%;
+ text-align: center;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+
+.NeedQuestionText {
+ font-size: 16pt;
+ font-weight: bold;
+}
+
+.COOLHeaderText {
+ font-family: "Arial";
+ font-size: 20pt;
+ font-weight: bold;
+}
+
+.ContentTable {
+ background-color: #ffffff;
+ margin: 0px;
+}
+
+form {
+ margin: 0px;
+ padding: 0px;
+};
+
+* {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+
+table {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+.TableTitle {
+ font-size: 12pt;
+ font-weight: bold;
+}
+
+.PageHeader {
+ width: 100%;
+ border-bottom: solid black 1px;
+ vertical-align: center;
+ background-color: #ffffff;
+}
diff --git a/pki/linux/tps-ui/shared/docroot/esc/so/util.js b/pki/linux/tps-ui/shared/docroot/esc/so/util.js
new file mode 100755
index 000000000..76e14014c
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/so/util.js
@@ -0,0 +1,1507 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; 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 ---
+
+//
+// initialize netkey globals
+var netkey;
+
+
+var keyUITable = new Array();
+var keyTypeTable = new Array();
+var curChildWindow = null;
+
+var gWindow = null;
+
+const ErrorText = "For additional assistance contact your Technical Support";
+
+
+function getUIForKey(aKeyID)
+{
+ return keyUITable[aKeyID];
+
+}
+
+function getTypeForKey(aKeyID)
+{
+ return keyTypeTable[aKeyID];
+}
+
+
+//
+// Notify callback for GECKO
+//
+function jsNotify() {}
+
+jsNotify.prototype = {
+
+ rhNotifyKeyStateChange: function(aKeyType,aKeyID,aKeyState,aData,strData)
+ {
+ OnCOOLKeyStateChange(aKeyType, aKeyID, aKeyState, aData,strData);
+ },
+
+ QueryInterface: function(iid)
+ {
+ <!-- alert("iid: " + iid); -->
+ if(!iid.equals(Components.interfaces.rhIKeyNotify) &&
+ !iid.equals(Components.interfaces.nsISupports))
+ {
+ MyAlert("Can't find jsNotify interface");
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+ }
+ return this;
+ }
+};
+
+//
+// Attach to the object.
+//
+ // GECKO ONLY initialization
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey = Components.classes["@redhat.com/rhCoolKey"].getService();
+ netkey = netkey.QueryInterface(Components.interfaces.rhICoolKey);
+ gNotify = new jsNotify;
+ netkey.rhCoolKeySetNotifyCallback(gNotify);
+ } catch(e) {
+ MyAlert("Can't get UniversalXPConnect: " + e);
+ }
+
+//
+// unregister our notify event
+//
+function cleanup()
+{
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.rhCoolKeyUnSetNotifyCallback(gNotify);
+ } catch(e) {
+ MyAlert("Can't get UniversalXPConnect: " + e);
+ }
+}
+
+var gScreenName = "";
+var gKeyEnrollmentType = "soKey";
+
+var gCurrentSelectedRow = null;
+
+
+var gCurKeyType = null;
+var gCurKeyID = null;
+
+////////////////////////////////////////////////////////////////
+//
+// Utility functions specific to this page.
+//
+////////////////////////////////////////////////////////////////
+
+
+// List of Error Messages to be printed out
+
+var Status_Messages = new Array(
+
+ "Operation Completed Successfully.",
+ "Smartcard Server error.",
+ "Problem communicating with the smartcard.",
+ "Problem communicating with the smartcard.",
+ "Problem resetting smartcard's pin.",
+ "Internal Smartcard Server error.",
+ "Internal Smartcard Server error.",
+ "Smartcard enrollment error.",
+ "Can not communicate with the smartcard.",
+ "Internal Smartcard Server error.",
+ "Problem communicating with the Certificattion Authority.",
+ "Internal Smartcard Server error.",
+ "Error resetting the smartcard's password.",
+ "Internal Smartcard Server error.",
+ "Smartcard Server authentication failure.",
+ "Internal Smartcard Server error.",
+ "Your Smartcard is listed as disabled.",
+ "Problem communicating with the smartcard.",
+ "Internal Smartcard Server error.",
+ "Cannot upgrade smartcard software.",
+ "Internal Smartcard Server error.",
+ "Problem communicating with the smartcard.",
+ "Invalid smartcard type.",
+ "Invalid smartcard type.",
+ "Cannot publish smartcard information.",
+ "Cannot communicate with smartcard database.",
+ "Smartcard is disabled.",
+ "Cannot reset password value for the smartcard.",
+ "Connection to Smartcard Server lost.",
+ "Cannot create entry for smartcard in smartcard database.",
+ "Smartcard found to be in an inconsistent state.",
+ "Invalid reason for lost smartcard submitted.",
+ "Smartcard found to be unusable due to compromise.",
+ "No such inactive smartcard found.",
+ "Cannot process more than one active smartcard.",
+ "Internal Smartcard Server error.",
+ "Smartcard key recovery has been processed.",
+ "Smartcard key recovery failed.",
+ "Cannot process this smartcard, which has been reported lost.",
+ "Smartcard key archival error.",
+ "Problem connecting to the Smartcard TKS Server.",
+ "Failed to update smartcard database.",
+ "Internal certificate revocation error discovered.",
+ "User does not own this smartcard.",
+ "Smart Card Manager has been misconfigured.",
+ "Smart Card Manager can not talk to smart card reader.",
+ "Smart Card Manager can not establish a session with the smart card.",
+ "Smart Card Manager can not talk to Smart Card Server.",
+ "Smart Card Manager can not talk to smart card reader."
+ );
+
+function GetAuthDataFromPopUp(aKeyType,aKeyID,aUiData)
+{
+
+ keyUITable[aKeyID] = aUiData;
+ keyTypeTable[aKeyID] = aKeyType;
+
+ //alert("GetAuthDataFromPopUp data " + aUiData);
+ var child = window.open("/GenericAuth.html",aKeyID,"height=400,width=400");
+
+ //alert("Attempted to create child window " + child);
+
+ curChildWindow = child;
+
+}
+
+function COOLKeySetDataValue(aKeyType,aKeyID,name,value)
+{
+ //alert("In COOLKeySetDataValue aKeyType " + aKeyType + " aKeyID " + aKeyID + " name " + name + " value " + value);
+ if(netkey)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.SetCoolKeyDataValue(aKeyType,aKeyID,name,value);
+
+
+ } catch(e) {
+ MyAlert("Error Setting data values: " + e);
+ }
+ }
+
+}
+
+function COOLKeySetTokenPin(pin)
+{
+ if(netkey)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"TokenPin",pin);
+
+
+ } catch(e) {
+ MyAlert("Error Setting data values: " + e);
+ }
+ }
+}
+
+function COOLKeySetUidPassword(uid,pwd)
+{
+
+ if(netkey)
+ {
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"UserId",uid);
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"Password",pwd);
+
+ } catch(e) {
+ MyAlert("Error Setting data values: " + e);
+ }
+
+ }
+
+}
+
+
+function MyGetErrorMessage(status_code)
+{
+
+ var result = "Internal Server Error";
+
+ if(status_code < 0 && status_code >= Status_Messages.length)
+ {
+ return result;
+
+ }
+
+ return Status_Messages[status_code];
+
+}
+
+function KeyToRowID(keyType, keyID)
+{
+ return keyType + "--" + keyID;
+}
+
+function RowIDToKeyInfo(rowID)
+{
+ return rowID.split("--");
+}
+
+function GetRowForKey(keyType, keyID)
+{
+ return document.getElementById(KeyToRowID(keyType, keyID));
+}
+
+function ReportException(msg, e)
+{
+ MyAlert(msg + " " + e.description + "(" + e.number + ")");
+}
+
+function GetCOOLKeyStatus(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyStatus(keyType, keyID);
+ } catch (e) {
+ ReportException("netkey.GetCOOLKeyStatus() failed!", e);
+ return 0;
+ }
+}
+
+function GetCOOLKeyPolicy(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyPolicy(keyType, keyID);
+ } catch (e) {
+ // ReportException("netkey.GetCOOLKeyPolicy() failed!", e);
+ return "";
+ }
+}
+
+function GetCOOLKeyRequiresAuth(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyRequiresAuthentication(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyRequiresAuthentication() failed!", e);
+ return false;
+ }
+}
+
+function GetCOOLKeyIsAuthed(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyIsAuthenticated(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyIsAuthenticated() failed!", e);
+ return false;
+ }
+}
+
+function GetAvailableCOOLKeys()
+{
+ try {
+ var keyArr;
+
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var inArray = netkey.GetAvailableCoolKeys( {} );
+ keyArr = new Array(inArray.length);
+ var i;
+
+ for (i=0; i < keyArr.length; i++) {
+ keyArr[i] = new Array( "1", inArray[i]);
+ }
+ return keyArr;
+ } catch(e) {
+ ReportException("netkey.GetAvailableCoolKeys() failed!", e);
+ return [];
+ }
+}
+
+function EnrollCOOLKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.EnrollCoolKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode);
+ } catch(e) {
+ ReportException("netkey.EnrollCoolKey() failed!", e);
+ return false;
+ }
+
+ return true;
+}
+
+function GetCOOLKeyIsEnrolled(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyIsEnrolled(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyIsEnrolled() failed!", e);
+ return false;
+ }
+}
+
+function CancelCOOLKeyOperation(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.CancelCoolKeyOperation(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.CancelCoolKeyOperation() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+function MyAlert(message)
+{
+ if(message)
+ DoMyAlert(message,"Smart Card Manager");
+
+}
+function DoMyAlert(message,title)
+{
+
+ if(!message || !title)
+ return;
+
+ try {
+
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
+
+
+ prompts.alert(window,title,message);
+
+ } catch(e) {
+
+
+ alert("Problem with nsIPromptService " + e);
+ }
+
+}
+
+//
+// MSHTML/GECKO compatibility functions.
+//
+function RemoveRow(table, row)
+{
+ table.deleteRow(row.rowIndex);
+}
+
+function GetCell(row, index)
+{
+ var cell;
+
+ cell = row.cells[index];
+ return cell;
+}
+
+function GetNode(parent, index)
+{
+ var node;
+ node = parent.childNodes[index];
+ return node;
+}
+
+function InsertRow(table)
+{
+ var row;
+
+ row = table.insertRow(table.rows.length);
+ return row;
+}
+
+function InsertCell(row)
+{
+ var cell;
+
+ cell = row.insertCell(row.cells.length);
+ return cell;
+}
+
+function RemoveAllChildNodes(parent)
+{
+ var numChildren = parent.childNodes.length;
+ var i;
+
+ i = numChildren;
+ while (numChildren)
+ {
+ parent.removeChild(GetNode(parent,0));
+ numChildren--;
+ }
+
+}
+
+
+function UpdateInfoForKeyID(keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ return;
+
+ var cell = GetCell(row,1)
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(keyStatus));
+
+// cell = GetCell(row,2);
+ // RemoveAllChildNodes(cell);
+ // cell.appendChild(document.createTextNode(reqAuth));
+
+ // cell = GetCell(row,3);
+ // RemoveAllChildNodes(cell);
+ // cell.appendChild(document.createTextNode(isAuthed));
+}
+
+function GetStatusForKeyID(keyType, keyID)
+{
+ var keyStatus = "BLANK";
+
+ var status;
+
+ try {
+ status = GetCOOLKeyStatus(keyType, keyID);
+ } catch(e) {
+ status = 0;
+ }
+
+ switch (status) {
+ case 0: // Unavailable
+ keyStatus = "UNAVAILABLE";
+ break;
+ case 1: // AppletNotFound
+ keyStatus = "NO APPLET";
+ break;
+ case 2: // Uninitialized
+ keyStatus = "UNINITIALIZED";
+ break;
+ case 3: // Unknown
+ keyStatus = "UNKNOWN";
+ break;
+ case 4: // Available
+ case 6: // UnblockInProgress
+ case 7: // PINResetInProgress
+ case 8: // RenewInProgress
+ keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ break;
+ case 5: // EnrollmentInProgress
+ keyStatus = "BUSY";
+ break;
+ break;
+ case 9: // FormatInProgress
+ keyStatus = "BUSY";
+ break;
+ }
+
+ return keyStatus;
+}
+
+function InsertCOOLKeyIntoBindingTable(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ gWindow = window;
+ if (!row)
+ {
+ var table = document.getElementById("BindingTable");
+ if (table)
+ {
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ row = CreateTableRow(table, keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ }
+
+ if (!row)
+ return null;
+ }
+
+ return row;
+}
+
+function ConvertVariantArrayToJScriptArray(varr)
+{
+ // C++ native methods, like netkey.GetAvailableCOOLKeys(), can only
+ // return variant SafeArrays, so to access the data inside, you must
+ // first convert it to a VBArray, and then call toArray() to convert
+ // it to a JScript array. Lame, but that's what it takes to
+ // use an array returned from an ActiveX component.
+
+ return new VBArray(varr).toArray();
+}
+
+function UpdateBindingTableAvailability()
+{
+ var arr = GetAvailableCOOLKeys();
+
+ if (!arr || arr.length < 1)
+ return;
+
+ var i;
+
+ for (i=0; i < arr.length; i++)
+ {
+ InsertCOOLKeyIntoBindingTable(arr[i][0], arr[i][1]);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(arr[i][0], arr[i][1]);
+ }
+}
+
+function InitializeBindingTable()
+{
+ UpdateBindingTableAvailability();
+ UpdateButtonStates();
+ if (UserOnDoneInitializeBindingTable) {
+ UserOnDoneInitializeBindingTable();
+ }
+}
+
+function KeyIsPresent(keyType, keyID)
+{
+ row = document.all.item(keyType, keyID);
+
+ if (!row)
+ return false;
+
+ return true;
+}
+
+function SetStatusMessage(str)
+{
+ var cell = document.getElementById("statusMsg");
+
+ if (!cell)
+ return;
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(str));
+}
+
+function UpdateButtonStates()
+{
+ if (gCurrentSelectedRow)
+ {
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+
+ document.getElementById("enrollbtn").disabled = false;
+ }
+ else
+ {
+ document.getElementById("enrollbtn").disabled = true;
+ }
+
+ refresh();
+}
+
+function SetEnrollmentType(type)
+{
+ gKeyEnrollmentType = type;
+ UpdateButtonStates();
+}
+
+function FindRow(node)
+{
+ while (node && node.tagName != "TR")
+ {
+ node = node.parentNode;
+ }
+
+ return node;
+}
+
+function SelectRow(row)
+{
+ if (!row || gCurrentSelectedRow == row)
+ return;
+
+ if (gCurrentSelectedRow)
+ gCurrentSelectedRow.removeAttribute("style");
+
+ gCurrentSelectedRow = row;
+ gCurrentSelectedRow.style.backgroundColor="rgb(200,200,200)";
+ UpdateButtonStates();
+}
+
+function SelectRowByKeyID(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ SelectRow(row);
+}
+
+function DoSelectRow(event)
+{
+ var row;
+
+ row = FindRow(event.parentNode);
+ SelectRow(row);
+}
+
+function KeyToUIString(keyType, keyID)
+{
+ // If it's an COOLKey, format the keyID string.
+
+ if (keyType == 1 && keyID.length == 20)
+ {
+ var re = /([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})/i;
+ keyID = keyID.replace(re, "$1-$2-$3-$4-$5").toLowerCase();
+ }
+
+ return keyID;
+}
+
+
+
+function CreateTableRow(table, keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+ var row = InsertRow(table);
+ if (!row)
+ return null;
+
+ row.setAttribute("id", KeyToRowID(keyType, keyID));
+
+ row.onclick = DoSelectRow;
+
+ // Create the key ID cell.
+ //cell = InsertCell(row);
+ //cell.appendChild(document.createTextNode(KeyToUIString(keyType, keyID)));
+
+ //cell.setAttribute("onClick", "DoSelectRow(this);");
+
+ // Create the keyStatus cell.
+ //cell = InsertCell(row);
+ //cell.appendChild(document.createTextNode(keyStatus));
+
+ // Create the requires auth cell.
+ // cell = InsertCell(row);
+ // cell.appendChild(document.createTextNode(reqAuth));
+
+ cell = InsertCell(row);
+ cell.appendChild(document.createTextNode("Enrollment Progress"));
+
+ // Create the status bar cell
+
+ cell = InsertCell(row);
+
+ var progressMeter = document.createElement("div");
+ progressMeter.setAttribute("id", KeyToProgressBarID(keyType, keyID));
+ progressMeter.className = "ProgressMeter";
+ progressMeter.style.width = "100px";
+ progressMeter.style.height = "1.5em";
+// progressMeter.style.visibility = "hidden";
+ progressMeter.setAttribute("value", 0);
+
+ var progressBar = document.createElement("div");
+ progressBar.className = "ProgressBar";
+ progressBar.style.width = "0px";
+ progressBar.style.height = "100%";
+// progressBar.style.visibility = "hidden";
+
+ var progressBarStatus = document.createElement("div");
+ progressBarStatus.className = "ProgressBarStatus";
+ progressBarStatus.appendChild(document.createTextNode(""));
+
+ progressMeter.appendChild(progressBar);
+ progressMeter.appendChild(progressBarStatus);
+ cell.appendChild(progressMeter);
+
+ //row.style.display ="none";
+
+ return row;
+}
+
+gAnimationMSecs = 1000/30;
+
+function SetCylonTimer(cylonID, cylonEyeID)
+{
+ setTimeout("AnimateCylonStatusBar(\"" + cylonID +
+ "\", \"" + cylonEyeID + "\");", gAnimationMSecs);
+}
+
+function AnimateCylonStatusBar(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID);
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ return;
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (!eye)
+ return;
+
+ var dir = eye.getAttribute("direction");
+ var wid = parseInt(eye.style.width);
+ var cywid = parseInt(cylon.style.width);
+ var left = parseInt(eye.style.left);
+
+ var dx = 10;
+
+ if (!dir || dir >= 0)
+ {
+ left += dx;
+
+ if (left + wid > cywid)
+ {
+ left = cywid - wid;
+ eye.setAttribute("direction", "-1");
+ }
+ }
+ else
+ {
+ left -= dx;
+
+ if (left < 0)
+ {
+ left = 0;
+ eye.setAttribute("direction", "1");
+ }
+ }
+
+ eye.style.left = left + "px";
+
+ SetCylonTimer(cylonID, cylonEyeID);
+}
+
+function StartCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ {
+ cylon.setAttribute("cylonactive", "true");
+
+ var eye = document.getElementById(cylonEyeID);
+ if (eye)
+ {
+ eye.style.left = "0px";
+ eye.style.visibility = "visible";
+ }
+
+ SetCylonTimer(cylonID, cylonEyeID);
+ }
+}
+
+function StopCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (cylon)
+ cylon.removeAttribute("cylonactive");
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (eye)
+ eye.style.visibility = "hidden";
+}
+
+function GetProgressMeterValue(progMeterID)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return -1;
+
+ return parseInt(progMeter.getAttribute("value"));
+}
+
+function SetProgressMeterValue(progMeterID, value)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter || value < 0)
+ return;
+
+ if (value > 100)
+ value = 100;
+
+ var progBar = progMeter.firstChild;
+
+ if (value == 0)
+ {
+ progBar.style.width = "0px";
+ progBar.style.visibility = "hidden";
+ progMeter.setAttribute("value", 0);
+ return;
+ }
+
+ progBar.style.visibility = "visible";
+
+ var newWidth = parseInt(progMeter.style.width) * value / 100 - 2;
+
+ progBar.style.width = newWidth + "px";
+ progMeter.setAttribute("value", value);
+}
+
+function SetProgressMeterStatus(progMeterID, statusMsg)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return;
+
+ var progBar = progMeter.firstChild;
+
+ // If it exists, the meter status should be
+ // div that is the next sibling of the progressMeter.
+
+ var meterStatus = progBar.nextSibling;
+
+ // Just replace the data in the text node, it's much faster,
+ // and reduces flashing!
+
+ meterStatus.firstChild.replaceData(0, meterStatus.firstChild.length, statusMsg);
+}
+
+function ClearProgressBar(progMeterID)
+{
+ SetProgressMeterValue(progMeterID, 0);
+ SetProgressMeterStatus(progMeterID, "");
+}
+
+function KeyToProgressBarID(keyType, keyID)
+{
+ return "PM" + keyType + "-" + keyID;
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions that contact the server or talk directly to
+// ESC native code.
+//
+// ESC Native Functions:
+//
+// netkey.GetAvailableCOOLKeys()
+//
+// - Returns an ActiveX Variant SafeArray containing the ID for each key
+// that is currentlly plugged into the computer. Before accessing any
+// data in this array you must convert it to a JScript Array with a
+// call to ConvertVariantArrayToJScriptArray().
+//
+// netkey.GetCOOLKeyIsEnrolled(keyType, keyID)
+//
+// - Returns true if a key has been initialized, false if it hasn't.
+// Initialized means the card has been formatted with certificates
+// for either an COOL HouseKey or NetKey.
+//
+// netkey.EnrollCOOLKey(keyType, keyID, enrollmentType, screenName, pin)
+//
+// - Initiates an async connection to the RA to initialize a specific
+// key. If you want the key to be initialized as a HouseKey, you should
+// pass "houseKey" as the enrollmentType, and null values for both
+// screenName and pin. For a NetKey, use "netKey" as the enrollmentType,
+// and pass a valid screenName and pin.
+//
+//
+////////////////////////////////////////////////////////////////
+
+function GetScreenNameValue()
+{
+ var sname = document.getElementById("snametf").value;
+
+ if (! sname)
+ {
+ MyAlert("You must provide a valid LDAP User ID!");
+ return null;
+ }
+
+ return sname;
+}
+
+function GetPINValue()
+{
+ var pinVal = document.getElementById("pintf").value;
+ var rpinVal = document.getElementById("reenterpintf").value;
+
+ if (! pinVal)
+ {
+ MyAlert("You must provide a valid Key Password!");
+ return null;
+ }
+
+ if ( pinVal != rpinVal)
+ {
+ MyAlert("The Key Password values you entered do not match!");
+ return null;
+ }
+
+ return pinVal;
+}
+
+function GetScreenNamePwd()
+{
+
+ var pwd = document.getElementById("snamepwd").value;
+
+ if(!pwd)
+ {
+ MyAlert("You must provide a valid LDAP User ID !");
+ return null;
+ }
+ return pwd;
+}
+
+function GetTokenCode()
+{
+
+ return null;
+}
+function DoEnrollCOOLKey()
+{
+
+ if (!gCurrentSelectedRow)
+ {
+ MyAlert("Please select a key.");
+ return;
+ }
+
+
+ if(!Validate())
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ if (type == "soKey")
+ {
+ screenname = GetScreenNameValue();
+
+ pin = GetPINValue();
+
+
+ screennamepwd = GetScreenNamePwd();
+
+ tokencode = GetTokenCode();
+
+ //SetStatusMessage("Enrolling UserKey \"" + KeyToUIString(keyType, keyID) + "\"...");
+ }
+
+ StartCylonAnimation("cylon1", "eye1");
+
+ var doShow = true;
+
+ ShowProgressBar(keyType,keyID,doShow );
+
+ if (!EnrollCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ var doShow = false;
+ ShowProgressBar(aKeyType,aKeyID,doShow );
+ }
+}
+
+function DoResetSelectedCOOLKeyPIN()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ if(!Validate())
+ return;
+
+ //alert("In DoResetSelectedCOOLKeyPIN!");
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var screenname = null;
+ var pin = null;
+ var screennamepwd = null;
+
+ if (GetCOOLKeyIsEnrolled(keyType, keyID))
+ {
+
+ SetStatusMessage("Resetting PIN for \"" + keyID + "\"...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!ResetCOOLKeyPIN(keyType, keyID, screenname, pin,screennamepwd))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+ }
+}
+
+function DoFormatCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+
+ if(!Validate())
+ return;
+
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ SetStatusMessage("Formatting \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!FormatCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+}
+function DoCancelOperation()
+{
+
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ SetStatusMessage("Cancel operation for \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ CancelCOOLKeyOperation(keyType, keyID);
+
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+}
+
+function DoChallengeSelectedKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Generating Challenge ...");
+
+ var challengeArray = ChallengeCOOLKey(keyType, keyID, document.forms[0].challengedata.value);
+
+ if (challengeArray.length != 4)
+ {
+ MyAlert("Challenge for key \"" + KeyToUIString(keyType, keyID) + "\" failed!");
+ SetStatusMessage("");
+ return;
+ }
+
+ MyAlert("ChallengeCOOLKey(\""+ KeyToUIString(keyType, keyID) + "\") returned:\n\n" +
+ "challenge[0]: " + challengeArray[0] + "\n" +
+ "challenge[1]: " + challengeArray[1] + "\n" +
+ "challenge[2]: " + challengeArray[2] + "\n" +
+ "challenge[3]: " + challengeArray[3] + "\n");
+
+ SetStatusMessage("");
+}
+
+function DoBlinkCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Blinking \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ BlinkCOOLKey(keyType, keyID, 400, 5000);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+}
+
+function OnCOOLKeyBlinkComplete(keyType,keyID)
+{
+ //StopCylonAnimation("cylon1", "eye1");
+ //SetStatusMessage(" ");
+}
+
+function DoHelp()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ var policy = GetCOOLKeyPolicy(keyType, keyID);
+ var type = PolicyToKeyType(policy);
+ MyAlert("Policy: " + policy + "\n" + "Type: " + type);
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions called directly from ASC native code.
+//
+////////////////////////////////////////////////////////////////
+
+function OnCOOLKeyInserted(keyType, keyID)
+{
+ var row = InsertCOOLKeyIntoBindingTable(keyType, keyID);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(keyType, keyID);
+}
+
+
+function OnCOOLKeyRemoved(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ var table = document.getElementById("BindingTable");
+
+ if (row && table)
+ {
+ RemoveRow(table,row);
+
+ if (row == gCurrentSelectedRow)
+ gCurrentSelectedRow = null;
+ }
+
+ UpdateButtonStates();
+}
+
+var gKnownPolicies = [
+
+ // OID Value, precedence, name value
+
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.4", 4, "NETKEY" ], // Platinum - MyDoctor
+
+ // XXX: Remove the Old OIDs below, after the RA starts generating
+ // certificates with the OIDs listed above!
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.4", 4, "NETKEY" ] // Platinum - MyDoctor
+];
+
+function PolicyToKeyType(policy)
+{
+ return "ENROLLED";
+}
+
+function OldPolicyToKeyType(policy)
+{
+ var i, j;
+
+ var knownPoliciesIndex = -1;
+
+
+ var policies;
+
+
+ if (policy.indexOf(",")== -1)
+ {
+ policies = new Array(1);
+ policies[0] = policy;
+ }
+ else
+ {
+ policies = policy.split(",");
+ }
+
+ for (j = 0; j < policies.length; j++)
+ {
+ for (i = 0; i < gKnownPolicies.length; i++)
+ {
+ if (gKnownPolicies[i][0] == policies[j])
+ {
+ if (knownPoliciesIndex < gKnownPolicies[i][1])
+ knownPoliciesIndex = i;
+ }
+ }
+ }
+
+ if (knownPoliciesIndex == -1)
+ return "INITIALIZED";
+
+ return gKnownPolicies[knownPoliciesIndex][2];
+}
+
+function BoolToYesNoStr(b)
+{
+ if (b)
+ return "YES";
+ return "NO";
+}
+
+function OnCOOLKeyEnrollmentComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ //UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ var doShow = false;
+ ShowProgressBar(keyType,keyID, doShow);
+ SetStatusMessage("");
+ MyAlert("Enrollment of smartcard complete!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+
+ window.setTimeout("loadSuccessPage()",4);
+}
+
+function OnCOOLKeyPINResetComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ MyAlert("Password Reset was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyFormatComplete(keyType, keyID)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ MyAlert("Format of \"" + KeyToUIString(keyType, keyID)+ "\" was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyStateError(keyType, keyID, keyState, errorCode)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ if(curChildWindow)
+ {
+ curChildWindow.close();
+ curChildWindow = null;
+
+ }
+
+ var doShow = false;
+ ShowProgressBar(keyType,keyID, doShow);
+
+ //UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+
+ var typeStr = "Error(" + errorCode + ")";
+
+ var messageStr = " \n\n Error Response: " + MyGetErrorMessage(errorCode) ;
+
+ var keyIDStr = KeyToUIString(keyType, keyID);
+
+ if (keyState == 1004)
+ typeStr = "Enrollment of key failed. " + typeStr + messageStr ;
+ else if (keyState == 1016)
+ typeStr = "Formatting of key failed. " + typeStr + messageStr;
+ else if (keyState == 1010)
+ typeStr = "PIN Reset for key failed. " + typeStr + messageStr;
+ else if (keyState == 1020)
+ typeStr = "Operation for key canceled.";
+
+ typeStr += " \n " + ErrorText;
+ MyAlert(typeStr);
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyStatusUpdate(progMeterID, statusUpdate)
+{
+ SetProgressMeterValue(progMeterID, statusUpdate);
+ SetProgressMeterStatus(progMeterID, statusUpdate + "%");
+}
+
+function Validate()
+{
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ if (type == "soKey")
+ {
+ screenname = GetScreenNameValue();
+ if (! screenname)
+ return 0;
+
+ screennamepwd = GetScreenNamePwd();
+
+ if(! screennamepwd)
+ return 0;
+
+ pin = GetPINValue();
+
+ if (! pin)
+ return 0;
+
+ }
+
+ return 1;
+}
+
+function OnCOOLKeyStateChange(keyType, keyID, keyState, data,strData)
+{
+ // alert("KeyID: " + keyID + "\n" +
+ // "KeyState: " + keyState + "\n" +
+ // "Data: " + data);
+ //alert("State Change ="+keyState);
+
+ switch(keyState)
+ {
+ case 1000: // KeyInserted
+ OnCOOLKeyInserted(keyType, keyID);
+ break;
+ case 1001: // KeyRemoved
+ OnCOOLKeyRemoved(keyType, keyID);
+ break;
+ case 1002: // EnrollmentStart
+ // OnCOOLKeyEnrollmentStart(keyType, keyID);
+ break;
+ case 1003: // EnrollmentComplete
+ OnCOOLKeyEnrollmentComplete(keyType, keyID);
+ break;
+ case 1004: // EnrollmentError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1008: // PINResetStart
+ // OnCOOLKeyPINResetStart(keyType, keyID);
+ break;
+ case 1009: // PINResetComplete
+ OnCOOLKeyPINResetComplete(keyType, keyID);
+ break;
+ case 1010: // PINResetError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1014: // FormatStart
+ // OnCOOLKeyFormatStart(keyType, keyID);
+ break;
+ case 1015: // FormatComplete
+ OnCOOLKeyFormatComplete(keyType, keyID);
+ break;
+ case 1016: // FormatError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1017: // BlinkStatus Update?
+ //OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1018:
+ OnCOOLKeyBlinkComplete(keyType, keyID);
+ break;
+ case 1020: // OperationCancelled
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1021: // OperationStatusUpdate
+ OnCOOLKeyStatusUpdate(KeyToProgressBarID(keyType, keyID), data);
+ break;
+
+ case 1022: //Need Auth
+
+
+ gCurKeyID = keyID;
+ gCurKeyType = keyType;
+
+ GetAuthDataFromPopUp(keyType,keyID,strData);
+
+ break;
+
+ }
+}
+
+function refresh()
+{
+ window.resizeBy(0,1);
+ window.resizeBy(0,-1);
+
+}
+
+function loadSuccessPage()
+{
+ window.location="/so/EnrollSuccess.html";
+}
+
+function ShowProgressBar(aKeyType,aKeyID, doShow)
+{
+ if(!gCurrentSelectedRow)
+ return;
+
+ if(doShow)
+ gCurrentSelectedRow.style.display="table-row";
+ else
+ {
+ gCurrentSelectedRow.style.display="none";
+ }
+}
diff --git a/pki/linux/tps-ui/shared/docroot/esc/sow/EnrollSuccess.html b/pki/linux/tps-ui/shared/docroot/esc/sow/EnrollSuccess.html
new file mode 100644
index 000000000..3b2096308
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/sow/EnrollSuccess.html
@@ -0,0 +1,52 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<link rel=stylesheet href="/sow/style.css" type="text/css">
+<title>Success!</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<link rel="stylesheet" href="/sow/css/style.css" media="screen" type="text/css">
+</head>
+
+<body>
+
+
+<div id="header">
+ <div id="logo">
+ <h3><img align=bottom src="/sow/images/badget.png">Security Officer Station</h3>
+ </div>
+</div>
+
+
+<div id="content">
+ <div id="maintext">
+ <div id="topmenu">
+ | <a href="/cgi-bin/sow/main.cgi">Main</a> |
+ </div>
+<blockquote><strong>Congratulations!</strong> This user has successfully enrolled the Smartcard! Now that this user has enrolled, he/she will be able to use the smartcard to log onto all available Smartcard-protected services.</blockquote>
+<br/>
+
+</div>
+</div>
+
+</body>
+
+</html>
+
diff --git a/pki/linux/tps-ui/shared/docroot/esc/sow/GenericAuth.html b/pki/linux/tps-ui/shared/docroot/esc/sow/GenericAuth.html
new file mode 100755
index 000000000..5660a7c50
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/sow/GenericAuth.html
@@ -0,0 +1,539 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<style>
+
+body {
+background: #ffffff url(../images/bg.jpg) repeat-x;
+ font-family: arial;
+ font-size: 7pt;
+
+}
+
+h1
+{
+ text-align: left;
+
+ font-weight: bold;
+
+ font-size: 13pt;
+
+
+}
+
+
+h2 {
+
+ text-align: left;
+ font-size: 10pt;
+
+ font-weight: lighter;
+}
+
+</style>
+<script language = "Javascript">
+
+var test_ui = "id=USER_ID&name=User ID&desc=User ID&type=string&option=option1,option2,option3&&id=USER_PWD&name=User Password&desc=User Password&type=password&option=&&id=USER_PIN&name=PIN&desc=One time PIN received via mail&type=password&option=";
+
+var theForm = null;
+var curKeyID = null;
+var curKeyType = 0;
+
+
+var gTitle = null;
+var gDescription = null;
+
+
+
+function ConfirmPassword(password_element)
+{
+
+ if(!password_element)
+ return 0;
+
+ password_id = password_element.id;
+
+ if(!password_id)
+ return 0;
+
+ confirm_id = "RE_" + password_element.id;
+
+ var size = theForm.length;
+
+ if(theForm)
+ {
+ for(i = 0; i < size ; i++)
+ {
+ var cur_element = theForm.elements[i];
+
+ if(cur_element.id == confirm_id)
+ {
+ if(cur_element.value != password_element.value)
+ {
+ alert("Value " + password_element.name + " must match " + cur_element.name);
+ return 0;
+
+ }
+ else
+ {
+ return 1;
+ }
+
+ }
+
+ }
+
+ }
+
+ return 1;
+}
+
+function Validate()
+{
+ if(theForm)
+ {
+ var size = theForm.length;
+
+ for( i = 0; i < size ; i++)
+ {
+ var element = theForm.elements[i];
+
+ if(element.type == "text" )
+ {
+ if(element.value == "")
+ {
+ alert("Please enter value for " + element.name);
+ return 0;
+ }
+ }
+
+ if(element.type == "password")
+ {
+ if(element.value == "")
+ {
+ alert("Please enter value for " + element.name);
+ return 0;
+ }
+
+ if(!ConfirmPassword(element))
+ {
+ return 0;
+ }
+
+ }
+ }
+
+ }
+
+ return 1;
+}
+
+function FormSubmit()
+{
+ var result = Validate();
+
+ var thisParent = window.opener;
+
+ if(!parent)
+ {
+ alert("No parent window.");
+ window.close();
+ return;
+ }
+
+ if(!result)
+ {
+ return;
+ }
+
+ if(theForm)
+ {
+ var size = theForm.length;
+ for( i = 0; i < size ; i++)
+ {
+ var element = theForm.elements[i];
+
+ var value = element.value;
+
+ if(element.type == "text" )
+ {
+ var id = element.id;
+ value = element.value;
+
+ if(thisParent)
+ {
+ //alert("about to set data value key " + curKeyID + " id " + id + " value " + value);
+ thisParent.COOLKeySetDataValue(curKeyType,curKeyID,id,value);
+
+ }
+ }
+
+ if(element.type == "password")
+ {
+ var p_id = new String(element.id);
+
+ if(p_id.indexOf("RE_") == -1)
+ {
+ if(thisParent)
+ {
+ thisParent.COOLKeySetDataValue(curKeyType,curKeyID,p_id,value);
+ }
+ }
+ }
+ }
+
+ }
+
+ window.close();
+}
+
+function GetUIObjectList(uiData)
+{
+ var str = new String(uiData);
+ var splits = str.split("&&");
+
+// alert("Get " + splits + " len " + splits.length);
+
+ var params = new Array();
+ var size = splits.length;
+
+ for(i = 0 ; i < size ; i++)
+ {
+ params[i] = splits[i].split("&");
+ }
+
+ size = params.length;
+ var name_value_objects = new Array();
+
+ for(i = 0 ; i < size; i++)
+ {
+ var name_values = new Array();
+
+ pISize = params[i].length;
+ for(j = 0 ; j < pISize ; j ++)
+ {
+ var pair = params[i][j].split("=");
+
+ //alert(" pair " + pair[0] + " pair1 " + pair[1]);
+
+ if(pair[0] == "option")
+ {
+ var options = pair[1].split(",");
+ }
+
+ name_values[pair[0]] = pair[1];
+ }
+
+ name_value_objects[i] = name_values;
+ }
+
+ return name_value_objects;
+
+}
+
+function AddBRToNode(theNode)
+{
+
+ if(!theNode)
+ return;
+
+ var br = document.createElement("br");
+
+ theNode.appendChild(br);
+
+}
+
+function AddTextToNode(theNode,theText)
+{
+
+ if(!theNode || !theText)
+ return;
+
+
+ var text = document.createTextNode(theText);
+
+ theNode.appendChild(text);
+
+
+
+
+}
+function AddTextToDocument(theText)
+{
+ if(!theText)
+ return;
+
+ var p = document.createElement("p");
+
+ if(p)
+ {
+ p.appendChild(document.createTextNode(theText));
+ }
+
+ document.body.appendChild(p);
+}
+
+function CreateForm()
+{
+ var form = document.createElement("form");
+ document.body.appendChild(form);
+ return form;
+}
+
+function CreateTable()
+{
+ var table = document.createElement("table");
+ document.body.appendChild(table);
+ tbody = document.createElement("tbody");
+ table.appendChild(tbody);
+
+ return table;
+}
+
+function AddRowToTable(table)
+{
+ if(!table)
+ return null;
+
+ var tr = document.createElement("tr");
+ (table.tBodies[0]).appendChild(tr);
+
+ return tr;
+}
+
+function AddColumnToRow(row)
+{
+ if(!row)
+ return null;
+
+ var td = document.createElement("td");
+ row.appendChild(td);
+
+ return td;
+}
+
+function AddTextToColumn(column,text)
+{
+ if(!column || !text)
+ return;
+
+ var text_node = document.createTextNode(text);
+ column.appendChild(text_node);
+
+ return text_node;
+}
+
+function AddInputField(type,id, name,value)
+{
+ var field = document.createElement("input");
+
+ if(!field)
+ return null;
+
+ field.type = type;
+ field.id =id;
+ field.name =name;
+ field.value =value;
+
+ return field;
+}
+
+function ConstructUI(aKeyType,aKeyID,uiData)
+{
+
+ //alert("Construct UI data " + uiData);
+ var name_value_objects = GetUIObjectList(uiData);
+ var len = name_value_objects.length;
+
+ gTitle = document.createElement("h1");
+
+ gDescription = document.createElement("h2");
+
+
+ document.body.appendChild(gTitle);
+
+
+ document.body.appendChild(gDescription);
+
+
+ form = CreateForm();
+ theForm = form;
+ curKeyID = aKeyID;
+ curKeyType = aKeyType;
+
+ table = CreateTable();
+
+ form.appendChild(table);
+
+ for(i = 0 ; i < len ; i ++)
+ {
+ curParameter = name_value_objects[i];
+
+ if(curParameter)
+ {
+
+ title = curParameter["title"];
+
+
+ if(title)
+ {
+ //alert("title " + title);
+
+ AddTextToNode(gTitle,title);
+
+
+ }
+
+ description = curParameter["description"];
+
+ if(description)
+ {
+ AddBRToNode(document.body);
+ AddBRToNode(document.body);
+
+ AddTextToNode(gDescription,description);
+
+ AddBRToNode(document.body);
+
+ }
+
+ id = curParameter["id"];
+ name = curParameter["name"];
+ type = curParameter["type"];
+ desc = curParameter["desc"];
+
+ //alert(" id " + id + " name " + name + " type " + type + " desc " + desc);
+
+ if(id)
+ {
+ if(table)
+ {
+ row = AddRowToTable(table);
+ }
+
+ if(row)
+ {
+ column = AddColumnToRow(row);
+ }
+
+ if(column)
+ {
+ AddTextToColumn(column,name);
+ }
+
+ if(type == "string" || type == "integer")
+ {
+ field = AddInputField("text",id,name,"");
+ }
+
+ re_field = null;
+
+ if(type == "password")
+ {
+ field = AddInputField("password",id,name,"");
+ }
+
+ if(type == "hidden")
+ {
+ field = AddInputField("hidden",id,name,"");
+ }
+
+ if(field)
+ {
+ field_col = AddColumnToRow(row);
+ if(field_col)
+ {
+ field_col.appendChild(field);
+ }
+ }
+
+ if(re_field)
+ {
+ re_text = AddColumnToRow(row);
+
+ if(re_text)
+ {
+ AddTextToColumn(re_text,"Confirm " + name);
+ re_field_col = AddColumnToRow(row);
+ if(re_field_col)
+ {
+ re_field_col.appendChild(re_field);
+ }
+
+ }
+
+ }
+ }
+
+ }
+
+ }
+
+ var last_row = AddRowToTable(table);
+
+ if(last_row)
+ {
+ var button_field = AddColumnToRow(last_row);
+
+ if(button_field)
+ {
+ var button = AddInputField("button","Submit","Submit","Submit");
+ button.onclick = FormSubmit;
+ button_field.appendChild(button);
+
+ }
+
+ }
+}
+
+function UiLoad()
+{
+
+
+ var thisParent = window.opener;
+
+
+ if(!thisParent)
+ {
+ alert("Auth dialog has no parent!");
+ return;
+ }
+
+ var keyID = this.name;
+
+ var ui = thisParent.getUIForKey(keyID);
+
+ var type = thisParent.getTypeForKey(keyID);
+
+ //alert("UiLoad " + ui);
+
+ if(ui)
+ {
+ ConstructUI(type,keyID,ui);
+ }
+}
+
+</script>
+</head>
+<body onload = "UiLoad()">
+</body>
+</html>
diff --git a/pki/linux/tps-ui/shared/docroot/esc/sow/images/logo.gif b/pki/linux/tps-ui/shared/docroot/esc/sow/images/logo.gif
new file mode 100644
index 000000000..2d1ea5579
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/sow/images/logo.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/sow/logo.jpg b/pki/linux/tps-ui/shared/docroot/esc/sow/logo.jpg
new file mode 100644
index 000000000..7cb31affc
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/sow/logo.jpg
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/esc/sow/style.css b/pki/linux/tps-ui/shared/docroot/esc/sow/style.css
new file mode 100755
index 000000000..e9d7d9bf7
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/sow/style.css
@@ -0,0 +1,214 @@
+/* --- BEGIN COPYRIGHT BLOCK ---
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; 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 ---
+ */
+
+body {
+background-color: grey;
+ font-family: arial;
+ font-size: 7p
+
+}
+
+form {
+ margin: 0px;
+ padding: 0px;
+};
+
+* {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+h2 {
+ font-size: 12pt;
+}
+
+.logobar {
+
+ background-color:black;
+ font-family: "Arial";
+ font-size: 7p;
+
+}
+
+.headerText {
+ font-family: "Arial";
+ font-size: 14pt;
+ font-weight: bold;
+ color: white;
+}
+
+.titleText {
+ font-family: "Arial";
+ font-size: 10pt;
+}
+
+.bodyText {
+ font-family: "Arial";
+ font-size: 10pt;
+ color: white;
+}
+
+.formText {
+ font-family: "Arial";
+ font-size: 9pt;
+ color: black;
+
+}
+
+.linkText {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+#BindingTable {
+ background-color: #ffffff ;
+ font-size: 7pt;
+}
+
+#BindingTable th {
+ color: rgb(0, 0, 0);
+ background-color: #fffffe;
+ font-size: 7pt;
+}
+
+#BindingTable tr {
+ background-color: #fffffe;
+ font-size: 7pt;
+}
+
+tr [COOLKeyPresent="yes"]{
+ background-color: rgb(255, 0, 0);
+}
+
+.cylon {
+ font-size: 4pt;
+ position: relative;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: #ffffff;
+}
+
+.cylonEye {
+ font-size: 4pt;
+ position: relative;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: rgb(0, 128, 192);
+}
+
+#statusMsg {
+ font-weight: bold;
+}
+
+.ProgressMeter {
+ position: relative;
+ padding: 0px;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: #ffffff;
+ text-align: center;
+}
+
+.ProgressBar {
+ position: absolute;
+ z-index: 0;
+ top: 0px;
+ left: 0px;
+ border-right: 1px solid rgb(60, 60, 60);
+ background-color: rgb(0, 128, 192);
+ margin: 0px;
+}
+
+.ProgressBarStatus {
+ position: relative;
+ z-index: 10;
+ margin: 0px;
+ padding: 0px;
+
+}
+
+.KeyTableHeader {
+ color: rgb(0,0, 0);
+ background-color: #ffffff;
+ text-align: left;
+}
+
+#KeyTable td {
+ background-color: #ffffff;
+ padding-left: 3px;
+ padding-right: 3px;
+};
+
+.TableDescriptionPanel {
+ background-color: #ffffff);
+ margin-right: 5px;
+ margin-left: 5px;
+ margin-bottom: 0px;
+ margin-bottom: 5px;
+ padding: 5px;
+}
+
+.PurchasePanel {
+ width: 100%;
+ text-align: center;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+
+.NeedQuestionText {
+ font-size: 16pt;
+ font-weight: bold;
+}
+
+.COOLHeaderText {
+ font-family: "Arial";
+ font-size: 20pt;
+ font-weight: bold;
+}
+
+.ContentTable {
+ background-color: #ffffff;
+ margin: 0px;
+}
+
+form {
+ margin: 0px;
+ padding: 0px;
+};
+
+* {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+
+table {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+.TableTitle {
+ font-size: 12pt;
+ font-weight: bold;
+}
+
+.PageHeader {
+ width: 100%;
+ border-bottom: solid black 1px;
+ vertical-align: center;
+ background-color: #ffffff;
+}
diff --git a/pki/linux/tps-ui/shared/docroot/esc/sow/util.js b/pki/linux/tps-ui/shared/docroot/esc/sow/util.js
new file mode 100755
index 000000000..2af341937
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/sow/util.js
@@ -0,0 +1,1698 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; 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 ---
+
+//
+// initialize netkey globals
+var netkey;
+
+
+var keyUITable = new Array();
+var keyTypeTable = new Array();
+var curChildWindow = null;
+
+var gWindow = null;
+
+const ErrorText = "For additional assistance contact your Technical Support";
+
+
+function getUIForKey(aKeyID)
+{
+ return keyUITable[aKeyID];
+
+}
+
+function getTypeForKey(aKeyID)
+{
+ return keyTypeTable[aKeyID];
+}
+
+
+//
+// Notify callback for GECKO
+//
+function jsNotify() {}
+
+jsNotify.prototype = {
+
+ rhNotifyKeyStateChange: function(aKeyType,aKeyID,aKeyState,aData,strData)
+ {
+ OnCOOLKeyStateChange(aKeyType, aKeyID, aKeyState, aData,strData);
+ },
+
+ QueryInterface: function(iid)
+ {
+ <!-- alert("iid: " + iid); -->
+ if(!iid.equals(Components.interfaces.rhIKeyNotify) &&
+ !iid.equals(Components.interfaces.nsISupports))
+ {
+ MyAlert("Can't find jsNotify interface");
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+ }
+ return this;
+ }
+};
+
+//
+// Attach to the object.
+//
+ // GECKO ONLY initialization
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey = Components.classes["@redhat.com/rhCoolKey"].getService();
+ netkey = netkey.QueryInterface(Components.interfaces.rhICoolKey);
+ gNotify = new jsNotify;
+ netkey.rhCoolKeySetNotifyCallback(gNotify);
+ } catch(e) {
+ MyAlert("Can't get UniversalXPConnect: " + e);
+ }
+
+//
+// unregister our notify event
+//
+function cleanup()
+{
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.rhCoolKeyUnSetNotifyCallback(gNotify);
+ } catch(e) {
+ MyAlert("Can't get UniversalXPConnect: " + e);
+ }
+}
+
+var gScreenName = "";
+var gKeyEnrollmentType = "userKey";
+
+var gCurrentSelectedRow = null;
+
+
+var gCurKeyType = null;
+var gCurKeyID = null;
+
+////////////////////////////////////////////////////////////////
+//
+// Utility functions specific to this page.
+//
+////////////////////////////////////////////////////////////////
+
+
+// List of Error Messages to be printed out
+
+var Status_Messages = new Array(
+
+ "Operation Completed Successfully.",
+ "Smartcard Server error.",
+ "Problem communicating with the smartcard.",
+ "Problem communicating with the smartcard.",
+ "Problem resetting smartcard's pin.",
+ "Internal Smartcard Server error.",
+ "Internal Smartcard Server error.",
+ "Smartcard enrollment error.",
+ "Can not communicate with the smartcard.",
+ "Internal Smartcard Server error.",
+ "Problem communicating with the Certificattion Authority.",
+ "Internal Smartcard Server error.",
+ "Error resetting the smartcard's password.",
+ "Internal Smartcard Server error.",
+ "Smartcard Server authentication failure.",
+ "Internal Smartcard Server error.",
+ "Your Smartcard is listed as disabled.",
+ "Problem communicating with the smartcard.",
+ "Internal Smartcard Server error.",
+ "Cannot upgrade smartcard software.",
+ "Internal Smartcard Server error.",
+ "Problem communicating with the smartcard.",
+ "Invalid smartcard type.",
+ "Invalid smartcard type.",
+ "Cannot publish smartcard information.",
+ "Cannot communicate with smartcard database.",
+ "Smartcard is disabled.",
+ "Cannot reset password value for the smartcard.",
+ "Connection to Smartcard Server lost.",
+ "Cannot create entry for smartcard in smartcard database.",
+ "Smartcard found to be in an inconsistent state.",
+ "Invalid reason for lost smartcard submitted.",
+ "Smartcard found to be unusable due to compromise.",
+ "No such inactive smartcard found.",
+ "Cannot process more than one active smartcard.",
+ "Internal Smartcard Server error.",
+ "Smartcard key recovery has been processed.",
+ "Smartcard key recovery failed.",
+ "Cannot process this smartcard, which has been reported lost.",
+ "Smartcard key archival error.",
+ "Problem connecting to the Smartcard TKS Server.",
+ "Failed to update smartcard database.",
+ "Internal certificate revocation error discovered.",
+ "User does not own this smartcard.",
+ "Smart Card Manager has been misconfigured.",
+ "Smart Card Manager can not talk to smart card reader.",
+ "Smart Card Manager can not establish a session with the smart card.",
+ "Smart Card Manager can not talk to Smart Card Server.",
+ "Smart Card Manager can not talk to smart card reader."
+ );
+
+function GetAuthDataFromPopUp(aKeyType,aKeyID,aUiData)
+{
+
+ keyUITable[aKeyID] = aUiData;
+ keyTypeTable[aKeyID] = aKeyType;
+
+ //alert("GetAuthDataFromPopUp data " + aUiData);
+ var child = window.open("/GenericAuth.html",aKeyID,"height=400,width=400");
+
+ //alert("Attempted to create child window " + child);
+
+ curChildWindow = child;
+
+}
+
+function COOLKeySetDataValue(aKeyType,aKeyID,name,value)
+{
+ //alert("In COOLKeySetDataValue aKeyType " + aKeyType + " aKeyID " + aKeyID + " name " + name + " value " + value);
+ if(netkey)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.SetCoolKeyDataValue(aKeyType,aKeyID,name,value);
+
+
+ } catch(e) {
+ MyAlert("Error Setting data values: " + e);
+ }
+ }
+
+}
+
+function COOLKeySetTokenPin(pin)
+{
+ if(netkey)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"TokenPin",pin);
+
+
+ } catch(e) {
+ MyAlert("Error Setting data values: " + e);
+ }
+ }
+}
+
+function COOLKeySetUidPassword(uid,pwd)
+{
+
+ if(netkey)
+ {
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"UserId",uid);
+
+ netkey.SetCoolKeyDataValue(gCurKeyType,gCurKeyID,"Password",pwd);
+
+ } catch(e) {
+ MyAlert("Error Setting data values: " + e);
+ }
+
+ }
+
+}
+
+
+function MyGetErrorMessage(status_code)
+{
+
+ var result = "Internal Server Error";
+
+ if(status_code < 0 && status_code >= Status_Messages.length)
+ {
+ return result;
+
+ }
+
+ return Status_Messages[status_code];
+
+}
+
+function KeyToRowID(keyType, keyID)
+{
+ return keyType + "--" + keyID;
+}
+
+function RowIDToKeyInfo(rowID)
+{
+ return rowID.split("--");
+}
+
+function GetRowForKey(keyType, keyID)
+{
+ return document.getElementById(KeyToRowID(keyType, keyID));
+}
+
+function ReportException(msg, e)
+{
+ MyAlert(msg + " " + e.description + "(" + e.number + ")");
+}
+
+function GetCOOLKeyStatus(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyStatus(keyType, keyID);
+ } catch (e) {
+ ReportException("netkey.GetCOOLKeyStatus() failed!", e);
+ return 0;
+ }
+}
+
+function GetCOOLKeyPolicy(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyPolicy(keyType, keyID);
+ } catch (e) {
+ // ReportException("netkey.GetCOOLKeyPolicy() failed!", e);
+ return "";
+ }
+}
+
+function GetCOOLKeyRequiresAuth(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyRequiresAuthentication(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyRequiresAuthentication() failed!", e);
+ return false;
+ }
+}
+
+function GetCOOLKeyIsAuthed(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyIsAuthenticated(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyIsAuthenticated() failed!", e);
+ return false;
+ }
+}
+
+function GetAvailableCOOLKeys()
+{
+ try {
+ var keyArr;
+
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var inArray = netkey.GetAvailableCoolKeys( {} );
+ keyArr = new Array(inArray.length);
+ var i;
+
+ for (i=0; i < keyArr.length; i++) {
+ keyArr[i] = new Array( "1", inArray[i]);
+ }
+ return keyArr;
+ } catch(e) {
+ ReportException("netkey.GetAvailableCoolKeys() failed!", e);
+ return [];
+ }
+}
+
+function EnrollCOOLKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.EnrollCoolKey(keyType, keyID, enrollmentType, screenname, pin,screennamepwd,tokencode);
+ } catch(e) {
+ ReportException("netkey.EnrollCoolKey() failed!", e);
+ return false;
+ }
+
+ return true;
+}
+
+function GetCOOLKeyIsEnrolled(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ return netkey.GetCoolKeyIsEnrolled(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.GetCoolKeyIsEnrolled() failed!", e);
+ return false;
+ }
+}
+
+function CancelCOOLKeyOperation(keyType, keyID)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.CancelCoolKeyOperation(keyType, keyID);
+ } catch(e) {
+ ReportException("netkey.CancelCoolKeyOperation() failed!", e);
+ return false;
+ }
+ return true;
+}
+
+function MyAlert(message)
+{
+ if(message)
+ DoMyAlert(message,"Smart Card Manager");
+
+}
+function DoMyAlert(message,title)
+{
+
+ if(!message || !title)
+ return;
+
+ try {
+
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
+
+
+ prompts.alert(window,title,message);
+
+ } catch(e) {
+
+
+ alert("Problem with nsIPromptService " + e);
+ }
+
+}
+
+//
+// MSHTML/GECKO compatibility functions.
+//
+function RemoveRow(table, row)
+{
+ table.deleteRow(row.rowIndex);
+}
+
+function GetCell(row, index)
+{
+ var cell;
+
+ cell = row.cells[index];
+ return cell;
+}
+
+function GetNode(parent, index)
+{
+ var node;
+ node = parent.childNodes[index];
+ return node;
+}
+
+function InsertRow(table)
+{
+ var row;
+
+ row = table.insertRow(table.rows.length);
+ return row;
+}
+
+function InsertCell(row)
+{
+ var cell;
+
+ cell = row.insertCell(row.cells.length);
+ return cell;
+}
+
+function RemoveAllChildNodes(parent)
+{
+ var numChildren = parent.childNodes.length;
+ var i;
+
+ i = numChildren;
+ while (numChildren)
+ {
+ parent.removeChild(GetNode(parent,0));
+ numChildren--;
+ }
+
+}
+
+
+function UpdateInfoForKeyID(keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ if (!row)
+ return;
+
+ var cell = GetCell(row,1)
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(keyStatus));
+
+// cell = GetCell(row,2);
+ // RemoveAllChildNodes(cell);
+ // cell.appendChild(document.createTextNode(reqAuth));
+
+ // cell = GetCell(row,3);
+ // RemoveAllChildNodes(cell);
+ // cell.appendChild(document.createTextNode(isAuthed));
+}
+
+function GetStatusForKeyID(keyType, keyID)
+{
+ var keyStatus = "BLANK";
+
+ var status;
+
+ try {
+ status = GetCOOLKeyStatus(keyType, keyID);
+ } catch(e) {
+ status = 0;
+ }
+
+ switch (status) {
+ case 0: // Unavailable
+ keyStatus = "UNAVAILABLE";
+ break;
+ case 1: // AppletNotFound
+ keyStatus = "NO APPLET";
+ break;
+ case 2: // Uninitialized
+ keyStatus = "UNINITIALIZED";
+ break;
+ case 3: // Unknown
+ keyStatus = "UNKNOWN";
+ break;
+ case 4: // Available
+ case 6: // UnblockInProgress
+ case 7: // PINResetInProgress
+ case 8: // RenewInProgress
+ keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ break;
+ case 5: // EnrollmentInProgress
+ keyStatus = "BUSY";
+ break;
+ break;
+ case 9: // FormatInProgress
+ keyStatus = "BUSY";
+ break;
+ }
+
+ return keyStatus;
+}
+
+function InsertCOOLKeyIntoBindingTable(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+
+ gWindow = window;
+ if (!row)
+ {
+ var table = document.getElementById("BindingTable");
+ if (table)
+ {
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ row = CreateTableRow(table, keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ }
+
+ if (!row)
+ return null;
+ }
+
+ return row;
+}
+
+function ConvertVariantArrayToJScriptArray(varr)
+{
+ // C++ native methods, like netkey.GetAvailableCOOLKeys(), can only
+ // return variant SafeArrays, so to access the data inside, you must
+ // first convert it to a VBArray, and then call toArray() to convert
+ // it to a JScript array. Lame, but that's what it takes to
+ // use an array returned from an ActiveX component.
+
+ return new VBArray(varr).toArray();
+}
+
+function UpdateBindingTableAvailability()
+{
+ var arr = GetAvailableCOOLKeys();
+
+ if (!arr || arr.length < 1)
+ return;
+
+ var i;
+
+ for (i=0; i < arr.length; i++)
+ {
+ InsertCOOLKeyIntoBindingTable(arr[i][0], arr[i][1]);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(arr[i][0], arr[i][1]);
+ }
+}
+
+function InitializeBindingTable()
+{
+ UpdateBindingTableAvailability();
+ UpdateButtonStates();
+ if (UserOnDoneInitializeBindingTable) {
+ UserOnDoneInitializeBindingTable();
+ }
+}
+
+function KeyIsPresent(keyType, keyID)
+{
+ row = document.all.item(keyType, keyID);
+
+ if (!row)
+ return false;
+
+ return true;
+}
+
+function SetStatusMessage(str)
+{
+ var cell = document.getElementById("statusMsg");
+
+ if (!cell)
+ return;
+ RemoveAllChildNodes(cell);
+ cell.appendChild(document.createTextNode(str));
+}
+
+function UpdateButtonStates()
+{
+ if (gCurrentSelectedRow)
+ {
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+
+ document.getElementById("enrollbtn").disabled = false;
+ }
+ else
+ {
+ document.getElementById("enrollbtn").disabled = true;
+ }
+
+ refresh();
+}
+
+function GetCurrentKeyID()
+{
+ if (gCurrentSelectedRow)
+ {
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+ return keyID;
+ } else {
+ return "No Key Found!";
+ }
+}
+
+function SetEnrollmentType(type)
+{
+ gKeyEnrollmentType = type;
+ UpdateButtonStates();
+}
+
+function FindRow(node)
+{
+ while (node && node.tagName != "TR")
+ {
+ node = node.parentNode;
+ }
+
+ return node;
+}
+
+function SelectRow(row)
+{
+ if (!row || gCurrentSelectedRow == row)
+ return;
+
+ if (gCurrentSelectedRow)
+ gCurrentSelectedRow.removeAttribute("style");
+
+ gCurrentSelectedRow = row;
+ gCurrentSelectedRow.style.backgroundColor="rgb(200,200,200)";
+ UpdateButtonStates();
+}
+
+function SelectRowByKeyID(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ SelectRow(row);
+}
+
+function DoSelectRow(event)
+{
+ var row;
+
+ row = FindRow(event.parentNode);
+ SelectRow(row);
+}
+
+function KeyToUIString(keyType, keyID)
+{
+ // If it's an COOLKey, format the keyID string.
+
+ if (keyType == 1 && keyID.length == 20)
+ {
+ var re = /([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})/i;
+ keyID = keyID.replace(re, "$1-$2-$3-$4-$5").toLowerCase();
+ }
+
+ return keyID;
+}
+
+
+
+function CreateTableRow(table, keyType, keyID, keyStatus, reqAuth, isAuthed)
+{
+ var row = InsertRow(table);
+ if (!row)
+ return null;
+
+ row.setAttribute("id", KeyToRowID(keyType, keyID));
+
+ row.onclick = DoSelectRow;
+
+ // Create the key ID cell.
+ //cell = InsertCell(row);
+ //cell.appendChild(document.createTextNode(KeyToUIString(keyType, keyID)));
+
+ //cell.setAttribute("onClick", "DoSelectRow(this);");
+
+ // Create the keyStatus cell.
+ //cell = InsertCell(row);
+ //cell.appendChild(document.createTextNode(keyStatus));
+
+ // Create the requires auth cell.
+ // cell = InsertCell(row);
+ // cell.appendChild(document.createTextNode(reqAuth));
+
+ cell = InsertCell(row);
+ cell.appendChild(document.createTextNode("Enrollment Progress"));
+
+ // Create the status bar cell
+
+ cell = InsertCell(row);
+
+ var progressMeter = document.createElement("div");
+ progressMeter.setAttribute("id", KeyToProgressBarID(keyType, keyID));
+ progressMeter.className = "ProgressMeter";
+ progressMeter.style.width = "100px";
+ progressMeter.style.height = "1.5em";
+// progressMeter.style.visibility = "hidden";
+ progressMeter.setAttribute("value", 0);
+
+ var progressBar = document.createElement("div");
+ progressBar.className = "ProgressBar";
+ progressBar.style.width = "0px";
+ progressBar.style.height = "100%";
+// progressBar.style.visibility = "hidden";
+
+ var progressBarStatus = document.createElement("div");
+ progressBarStatus.className = "ProgressBarStatus";
+ progressBarStatus.appendChild(document.createTextNode(""));
+
+ progressMeter.appendChild(progressBar);
+ progressMeter.appendChild(progressBarStatus);
+ cell.appendChild(progressMeter);
+
+ //row.style.display ="none";
+
+ return row;
+}
+
+gAnimationMSecs = 1000/30;
+
+function SetCylonTimer(cylonID, cylonEyeID)
+{
+ setTimeout("AnimateCylonStatusBar(\"" + cylonID +
+ "\", \"" + cylonEyeID + "\");", gAnimationMSecs);
+}
+
+function AnimateCylonStatusBar(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID);
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ return;
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (!eye)
+ return;
+
+ var dir = eye.getAttribute("direction");
+ var wid = parseInt(eye.style.width);
+ var cywid = parseInt(cylon.style.width);
+ var left = parseInt(eye.style.left);
+
+ var dx = 10;
+
+ if (!dir || dir >= 0)
+ {
+ left += dx;
+
+ if (left + wid > cywid)
+ {
+ left = cywid - wid;
+ eye.setAttribute("direction", "-1");
+ }
+ }
+ else
+ {
+ left -= dx;
+
+ if (left < 0)
+ {
+ left = 0;
+ eye.setAttribute("direction", "1");
+ }
+ }
+
+ eye.style.left = left + "px";
+
+ SetCylonTimer(cylonID, cylonEyeID);
+}
+
+function StartCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (!cylon)
+ return;
+
+ var active = cylon.getAttribute("cylonactive");
+
+ if (!active)
+ {
+ cylon.setAttribute("cylonactive", "true");
+
+ var eye = document.getElementById(cylonEyeID);
+ if (eye)
+ {
+ eye.style.left = "0px";
+ eye.style.visibility = "visible";
+ }
+
+ SetCylonTimer(cylonID, cylonEyeID);
+ }
+}
+
+function StopCylonAnimation(cylonID, cylonEyeID)
+{
+ var cylon = document.getElementById(cylonID)
+
+ if (cylon)
+ cylon.removeAttribute("cylonactive");
+
+ var eye = document.getElementById(cylonEyeID);
+
+ if (eye)
+ eye.style.visibility = "hidden";
+}
+
+function GetProgressMeterValue(progMeterID)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return -1;
+
+ return parseInt(progMeter.getAttribute("value"));
+}
+
+function SetProgressMeterValue(progMeterID, value)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter || value < 0)
+ return;
+
+ if (value > 100)
+ value = 100;
+
+ var progBar = progMeter.firstChild;
+
+ if (value == 0)
+ {
+ progBar.style.width = "0px";
+ progBar.style.visibility = "hidden";
+ progMeter.setAttribute("value", 0);
+ return;
+ }
+
+ progBar.style.visibility = "visible";
+
+ var newWidth = parseInt(progMeter.style.width) * value / 100 - 2;
+
+ progBar.style.width = newWidth + "px";
+ progMeter.setAttribute("value", value);
+}
+
+function SetProgressMeterStatus(progMeterID, statusMsg)
+{
+ var progMeter = document.getElementById(progMeterID);
+
+ if (!progMeter)
+ return;
+
+ var progBar = progMeter.firstChild;
+
+ // If it exists, the meter status should be
+ // div that is the next sibling of the progressMeter.
+
+ var meterStatus = progBar.nextSibling;
+
+ // Just replace the data in the text node, it's much faster,
+ // and reduces flashing!
+
+ meterStatus.firstChild.replaceData(0, meterStatus.firstChild.length, statusMsg);
+}
+
+function ClearProgressBar(progMeterID)
+{
+ SetProgressMeterValue(progMeterID, 0);
+ SetProgressMeterStatus(progMeterID, "");
+}
+
+function KeyToProgressBarID(keyType, keyID)
+{
+ return "PM" + keyType + "-" + keyID;
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions that contact the server or talk directly to
+// ESC native code.
+//
+// ESC Native Functions:
+//
+// netkey.GetAvailableCOOLKeys()
+//
+// - Returns an ActiveX Variant SafeArray containing the ID for each key
+// that is currentlly plugged into the computer. Before accessing any
+// data in this array you must convert it to a JScript Array with a
+// call to ConvertVariantArrayToJScriptArray().
+//
+// netkey.GetCOOLKeyIsEnrolled(keyType, keyID)
+//
+// - Returns true if a key has been initialized, false if it hasn't.
+// Initialized means the card has been formatted with certificates
+// for either an COOL HouseKey or NetKey.
+//
+// netkey.EnrollCOOLKey(keyType, keyID, enrollmentType, screenName, pin)
+//
+// - Initiates an async connection to the RA to initialize a specific
+// key. If you want the key to be initialized as a HouseKey, you should
+// pass "houseKey" as the enrollmentType, and null values for both
+// screenName and pin. For a NetKey, use "netKey" as the enrollmentType,
+// and pass a valid screenName and pin.
+//
+//
+////////////////////////////////////////////////////////////////
+
+function GetScreenNameValue()
+{
+ var sname = document.getElementById("snametf").value;
+
+ if (! sname)
+ {
+ MyAlert("You must provide a valid LDAP User ID!");
+ if (UserOnCOOLKeyStateError) {
+ UserOnCOOLKeyStateError(); // call user-level
+ }
+ return null;
+ }
+
+ return sname;
+}
+
+function GetPINValue()
+{
+ var pinVal = document.getElementById("pintf").value;
+ var rpinVal = document.getElementById("reenterpintf").value;
+
+ if (! pinVal)
+ {
+ MyAlert("You must provide a valid Key Password!");
+ if (UserOnCOOLKeyStateError) {
+ UserOnCOOLKeyStateError(); // call user-level
+ }
+ return null;
+ }
+
+ if ( pinVal != rpinVal)
+ {
+ MyAlert("The Key Password values you entered do not match!");
+ if (UserOnCOOLKeyStateError) {
+ UserOnCOOLKeyStateError(); // call user-level
+ }
+ return null;
+ }
+
+ return pinVal;
+}
+
+function GetScreenNamePwd()
+{
+
+ var pwd = document.getElementById("snamepwd").value;
+
+ if(!pwd)
+ {
+ MyAlert("You must provide a valid LDAP User ID !");
+ if (UserOnCOOLKeyStateError) {
+ UserOnCOOLKeyStateError(); // call user-level
+ }
+ return null;
+ }
+ return pwd;
+}
+
+function GetTokenCode()
+{
+
+ return null;
+}
+function DoEnrollTempCOOLKey()
+{
+
+ if (!gCurrentSelectedRow)
+ {
+ MyAlert("Please select a key.");
+ return;
+ }
+
+ if(!Validate())
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ screenname = GetScreenNameValue();
+
+ pin = GetPINValue();
+
+
+ screennamepwd = GetScreenNamePwd();
+
+ tokencode = GetTokenCode();
+
+ //SetStatusMessage("Enrolling UserKey \"" + KeyToUIString(keyType, keyID) + "\"...");
+
+ StartCylonAnimation("cylon1", "eye1");
+
+ var doShow = true;
+
+ ShowProgressBar(keyType,keyID,doShow );
+
+ if (!EnrollCOOLKey(keyType, keyID, 'userKeyTemporary', screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ var doShow = false;
+ ShowProgressBar(aKeyType,aKeyID,doShow );
+ }
+}
+function DoEnrollCOOLKey()
+{
+
+ if (!gCurrentSelectedRow)
+ {
+ MyAlert("Please select a key.");
+ return;
+ }
+
+ if(!Validate())
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ if (type == "userKey")
+ {
+ screenname = GetScreenNameValue();
+
+ pin = GetPINValue();
+
+
+ screennamepwd = GetScreenNamePwd();
+
+ tokencode = GetTokenCode();
+
+ //SetStatusMessage("Enrolling UserKey \"" + KeyToUIString(keyType, keyID) + "\"...");
+ }
+
+ StartCylonAnimation("cylon1", "eye1");
+
+ var doShow = true;
+
+ ShowProgressBar(keyType,keyID,doShow );
+
+ if (!EnrollCOOLKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ var doShow = false;
+ ShowProgressBar(aKeyType,aKeyID,doShow );
+ }
+}
+
+function DoResetSelectedCOOLKeyPIN()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ if(!Validate())
+ return;
+
+ //alert("In DoResetSelectedCOOLKeyPIN!");
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var screenname = null;
+ var pin = null;
+ var screennamepwd = null;
+
+ if (GetCOOLKeyIsEnrolled(keyType, keyID))
+ {
+
+ SetStatusMessage("Resetting PIN for \"" + keyID + "\"...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!ResetCOOLKeyPIN(keyType, keyID, screenname, pin,screennamepwd))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+ }
+}
+
+function DoSetURLCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ if(!Validate1())
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = 'soUserKey';
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ SetStatusMessage("Formatting \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!FormatCoolKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+}
+
+function DoFormatSoCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ if(!Validate1())
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = 'soCleanSOToken';
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ SetStatusMessage("Formatting \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!FormatCoolKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+}
+
+function DoFormatCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ if(!Validate1())
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ var type = 'soCleanUserToken';
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ SetStatusMessage("Formatting \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ if (!FormatCoolKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
+ {
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+ }
+}
+
+function FormatCoolKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode)
+{
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ netkey.FormatCoolKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode);
+ } catch(e) {
+ ReportException(getBundleString("errorFormatCoolKey"), e);
+ return false;
+ }
+ return true;
+}
+
+function DoCancelOperation()
+{
+
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ SetStatusMessage("Cancel operation for \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ CancelCOOLKeyOperation(keyType, keyID);
+
+ SetStatusMessage("");
+ StopCylonAnimation("cylon1", "eye1");
+}
+
+function DoChallengeSelectedKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Generating Challenge ...");
+
+ var challengeArray = ChallengeCOOLKey(keyType, keyID, document.forms[0].challengedata.value);
+
+ if (challengeArray.length != 4)
+ {
+ MyAlert("Challenge for key \"" + KeyToUIString(keyType, keyID) + "\" failed!");
+ SetStatusMessage("");
+ return;
+ }
+
+ MyAlert("ChallengeCOOLKey(\""+ KeyToUIString(keyType, keyID) + "\") returned:\n\n" +
+ "challenge[0]: " + challengeArray[0] + "\n" +
+ "challenge[1]: " + challengeArray[1] + "\n" +
+ "challenge[2]: " + challengeArray[2] + "\n" +
+ "challenge[3]: " + challengeArray[3] + "\n");
+
+ SetStatusMessage("");
+}
+
+function DoBlinkCOOLKey()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ SetStatusMessage("Blinking \"" + KeyToUIString(keyType, keyID) + "\" ...");
+ StartCylonAnimation("cylon1", "eye1");
+
+ BlinkCOOLKey(keyType, keyID, 400, 5000);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+}
+
+function OnCOOLKeyBlinkComplete(keyType,keyID)
+{
+ //StopCylonAnimation("cylon1", "eye1");
+ //SetStatusMessage(" ");
+}
+
+function DoHelp()
+{
+ if (!gCurrentSelectedRow)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(gCurrentSelectedRow.getAttribute("id"));
+ var keyType = keyInfo[0];
+ var keyID = keyInfo[1];
+
+ if (!keyID)
+ return;
+
+ var policy = GetCOOLKeyPolicy(keyType, keyID);
+ var type = PolicyToKeyType(policy);
+ MyAlert("Policy: " + policy + "\n" + "Type: " + type);
+}
+
+////////////////////////////////////////////////////////////////
+//
+// Functions called directly from ASC native code.
+//
+////////////////////////////////////////////////////////////////
+
+function OnCOOLKeyInserted(keyType, keyID)
+{
+ var row = InsertCOOLKeyIntoBindingTable(keyType, keyID);
+
+ if (!gCurrentSelectedRow)
+ SelectRowByKeyID(keyType, keyID);
+ if (UserOnCOOLKeyInserted) {
+ UserOnCOOLKeyInserted(keyType, keyID);
+ }
+}
+
+
+function OnCOOLKeyRemoved(keyType, keyID)
+{
+ var row = GetRowForKey(keyType, keyID);
+ var table = document.getElementById("BindingTable");
+
+ if (row && table)
+ {
+ RemoveRow(table,row);
+
+ if (row == gCurrentSelectedRow)
+ gCurrentSelectedRow = null;
+ }
+
+ UpdateButtonStates();
+ if (UserOnCOOLKeyRemoved) {
+ UserOnCOOLKeyRemoved(keyType, keyID);
+ }
+}
+
+var gKnownPolicies = [
+
+ // OID Value, precedence, name value
+
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.1.0.1.4", 4, "NETKEY" ], // Platinum - MyDoctor
+
+ // XXX: Remove the Old OIDs below, after the RA starts generating
+ // certificates with the OIDs listed above!
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.1", 1, "HOUSEKEY" ], // Bronze - HouseKey
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.2", 2, "NETKEY" ], // Silver - Member
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.3", 3, "NETKEY" ], // Gold - Associate
+ [ "OID.1.3.6.1.4.1.1066.1.1000.2.4", 4, "NETKEY" ] // Platinum - MyDoctor
+];
+
+function PolicyToKeyType(policy)
+{
+ return "ENROLLED";
+}
+
+function OldPolicyToKeyType(policy)
+{
+ var i, j;
+
+ var knownPoliciesIndex = -1;
+
+
+ var policies;
+
+
+ if (policy.indexOf(",")== -1)
+ {
+ policies = new Array(1);
+ policies[0] = policy;
+ }
+ else
+ {
+ policies = policy.split(",");
+ }
+
+ for (j = 0; j < policies.length; j++)
+ {
+ for (i = 0; i < gKnownPolicies.length; i++)
+ {
+ if (gKnownPolicies[i][0] == policies[j])
+ {
+ if (knownPoliciesIndex < gKnownPolicies[i][1])
+ knownPoliciesIndex = i;
+ }
+ }
+ }
+
+ if (knownPoliciesIndex == -1)
+ return "INITIALIZED";
+
+ return gKnownPolicies[knownPoliciesIndex][2];
+}
+
+function BoolToYesNoStr(b)
+{
+ if (b)
+ return "YES";
+ return "NO";
+}
+
+function OnCOOLKeyEnrollmentComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ //UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ var doShow = false;
+ ShowProgressBar(keyType,keyID, doShow);
+ SetStatusMessage("");
+ MyAlert("Enrollment of smartcard complete!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+
+ window.setTimeout("loadSuccessPage()",4);
+}
+
+function OnCOOLKeyPINResetComplete(keyType, keyID)
+{
+ var keyStatus = PolicyToKeyType(GetCOOLKeyPolicy(keyType, keyID));
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+ UpdateButtonStates();
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ MyAlert("Password Reset was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+}
+
+function OnCOOLKeyFormatComplete(keyType, keyID)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+ MyAlert("Format of \"" + KeyToUIString(keyType, keyID)+ "\" was successful!");
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+ if (UserOnCOOLKeyFormatComplete) {
+ UserOnCOOLKeyFormatComplete(); // call user-level
+ }
+}
+
+function OnCOOLKeyStateError(keyType, keyID, keyState, errorCode)
+{
+ var keyStatus = GetStatusForKeyID(keyType, keyID);
+ var keyReqAuth = BoolToYesNoStr(GetCOOLKeyRequiresAuth(keyType, keyID));
+ var keyIsAuthed = BoolToYesNoStr(GetCOOLKeyIsAuthed(keyType, keyID));
+
+ if(curChildWindow)
+ {
+ curChildWindow.close();
+ curChildWindow = null;
+
+ }
+
+ var doShow = false;
+ ShowProgressBar(keyType,keyID, doShow);
+
+ //UpdateInfoForKeyID(keyType, keyID, keyStatus, keyReqAuth, keyIsAuthed);
+
+ StopCylonAnimation("cylon1", "eye1");
+ SetStatusMessage("");
+
+ var typeStr = "Error(" + errorCode + ")";
+
+ var messageStr = " \n\n Error Response: " + MyGetErrorMessage(errorCode) ;
+
+ var keyIDStr = KeyToUIString(keyType, keyID);
+
+ if (keyState == 1004)
+ typeStr = "Enrollment of key failed. " + typeStr + messageStr ;
+ else if (keyState == 1016)
+ typeStr = "Formatting of key failed. " + typeStr + messageStr;
+ else if (keyState == 1010)
+ typeStr = "PIN Reset for key failed. " + typeStr + messageStr;
+ else if (keyState == 1020)
+ typeStr = "Operation for key canceled.";
+
+ typeStr += " \n " + ErrorText;
+ MyAlert(typeStr);
+ ClearProgressBar(KeyToProgressBarID(keyType, keyID));
+ if (UserOnCOOLKeyStateError) {
+ UserOnCOOLKeyStateError(); // call user-level
+ }
+}
+
+function OnCOOLKeyStatusUpdate(progMeterID, statusUpdate)
+{
+ SetProgressMeterValue(progMeterID, statusUpdate);
+ SetProgressMeterStatus(progMeterID, statusUpdate + "%");
+}
+
+function Validate1()
+{
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ screenname = '';
+ screennamepwd = 'netscape';
+ pin = 'netscape'
+
+ return 1;
+}
+function Validate()
+{
+
+ var type = gKeyEnrollmentType;
+ var screenname = null;
+ var pin = null;
+
+ var screennamepwd = null;
+ var tokencode = null;
+
+ if (type == "userKey")
+ {
+ screenname = GetScreenNameValue();
+ if (! screenname)
+ return 0;
+
+ screennamepwd = GetScreenNamePwd();
+
+ if(! screennamepwd)
+ return 0;
+
+ pin = GetPINValue();
+
+ if (! pin)
+ return 0;
+
+ }
+
+ return 1;
+}
+
+function OnCOOLKeyStateChange(keyType, keyID, keyState, data,strData)
+{
+ // alert("KeyID: " + keyID + "\n" +
+ // "KeyState: " + keyState + "\n" +
+ // "Data: " + data);
+ //alert("State Change ="+keyState);
+
+ switch(keyState)
+ {
+ case 1000: // KeyInserted
+ OnCOOLKeyInserted(keyType, keyID);
+ break;
+ case 1001: // KeyRemoved
+ OnCOOLKeyRemoved(keyType, keyID);
+ break;
+ case 1002: // EnrollmentStart
+ // OnCOOLKeyEnrollmentStart(keyType, keyID);
+ break;
+ case 1003: // EnrollmentComplete
+ OnCOOLKeyEnrollmentComplete(keyType, keyID);
+ break;
+ case 1004: // EnrollmentError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1008: // PINResetStart
+ // OnCOOLKeyPINResetStart(keyType, keyID);
+ break;
+ case 1009: // PINResetComplete
+ OnCOOLKeyPINResetComplete(keyType, keyID);
+ break;
+ case 1010: // PINResetError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1014: // FormatStart
+ // OnCOOLKeyFormatStart(keyType, keyID);
+ break;
+ case 1015: // FormatComplete
+ OnCOOLKeyFormatComplete(keyType, keyID);
+ break;
+ case 1016: // FormatError
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1017: // BlinkStatus Update?
+ //OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1018:
+ OnCOOLKeyBlinkComplete(keyType, keyID);
+ break;
+ case 1020: // OperationCancelled
+ OnCOOLKeyStateError(keyType, keyID, keyState, data);
+ break;
+ case 1021: // OperationStatusUpdate
+ OnCOOLKeyStatusUpdate(KeyToProgressBarID(keyType, keyID), data);
+ break;
+
+ case 1022: //Need Auth
+
+
+ gCurKeyID = keyID;
+ gCurKeyType = keyType;
+
+ GetAuthDataFromPopUp(keyType,keyID,strData);
+
+ break;
+
+ }
+}
+
+function refresh()
+{
+ window.resizeBy(0,1);
+ window.resizeBy(0,-1);
+
+}
+
+function loadSuccessPage()
+{
+ window.location="/sow/EnrollSuccess.html";
+}
+
+function ShowProgressBar(aKeyType,aKeyID, doShow)
+{
+ if(!gCurrentSelectedRow)
+ return;
+
+ if(doShow)
+ gCurrentSelectedRow.style.display="table-row";
+ else
+ {
+ gCurrentSelectedRow.style.display="none";
+ }
+}
+function DoCoolKeySetConfigValue(configValue,newValue)
+{
+ if(!configValue || !newValue)
+ return null;
+
+ var result = null;
+
+ if(netkey)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ result = netkey.SetCoolKeyConfigValue(configValue,newValue);
+
+ } catch(e) {
+ MyAlert(getBundleString("errorConfigValue") + " " + e);
+ }
+
+ }
+
+ return result;
+}
diff --git a/pki/linux/tps-ui/shared/docroot/esc/style.css b/pki/linux/tps-ui/shared/docroot/esc/style.css
new file mode 100755
index 000000000..f85d18ee2
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/esc/style.css
@@ -0,0 +1,197 @@
+/* --- BEGIN COPYRIGHT BLOCK ---
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; 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 ---
+ */
+
+body {
+background: #ffffff url(../images/bg.jpg) repeat-x;
+ font-family: arial;
+ font-size: 7p
+
+}
+
+form {
+ margin: 0px;
+ padding: 0px;
+};
+
+* {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+h2 {
+ font-size: 12pt;
+}
+
+.headerText {
+ font-family: "Arial";
+ font-size: 12pt;
+ font-weight: bold;
+}
+
+.titleText {
+ font-family: "Arial";
+ font-size: 10pt;
+}
+
+.bodyText {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+.linkText {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+#BindingTable {
+ background-color: #ffffff ;
+ font-size: 7pt;
+}
+
+#BindingTable th {
+ color: rgb(0, 0, 0);
+ background-color: #fffffe;
+ font-size: 7pt;
+}
+
+#BindingTable tr {
+ background-color: #fffffe;
+ font-size: 7pt;
+}
+
+tr [COOLKeyPresent="yes"]{
+ background-color: rgb(255, 0, 0);
+}
+
+.cylon {
+ font-size: 4pt;
+ position: relative;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: #ffffff;
+}
+
+.cylonEye {
+ font-size: 4pt;
+ position: relative;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: rgb(0, 128, 192);
+}
+
+#statusMsg {
+ font-weight: bold;
+}
+
+.ProgressMeter {
+ position: relative;
+ padding: 0px;
+ border: 1px solid rgb(60, 60, 60);
+ background-color: #ffffff;
+ text-align: center;
+}
+
+.ProgressBar {
+ position: absolute;
+ z-index: 0;
+ top: 0px;
+ left: 0px;
+ border-right: 1px solid rgb(60, 60, 60);
+ background-color: rgb(0, 128, 192);
+ margin: 0px;
+}
+
+.ProgressBarStatus {
+ position: relative;
+ z-index: 10;
+ margin: 0px;
+ padding: 0px;
+
+}
+
+.KeyTableHeader {
+ color: rgb(0,0, 0);
+ background-color: #ffffff;
+ text-align: left;
+}
+
+#KeyTable td {
+ background-color: #ffffff;
+ padding-left: 3px;
+ padding-right: 3px;
+};
+
+.TableDescriptionPanel {
+ background-color: #ffffff);
+ margin-right: 5px;
+ margin-left: 5px;
+ margin-bottom: 0px;
+ margin-bottom: 5px;
+ padding: 5px;
+}
+
+.PurchasePanel {
+ width: 100%;
+ text-align: center;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+
+.NeedQuestionText {
+ font-size: 16pt;
+ font-weight: bold;
+}
+
+.COOLHeaderText {
+ font-family: "Arial";
+ font-size: 20pt;
+ font-weight: bold;
+}
+
+.ContentTable {
+ background-color: #ffffff;
+ margin: 0px;
+}
+
+form {
+ margin: 0px;
+ padding: 0px;
+};
+
+* {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+
+table {
+ font-family: "Arial";
+ font-size: 8pt;
+}
+
+.TableTitle {
+ font-size: 12pt;
+ font-weight: bold;
+}
+
+.PageHeader {
+ width: 100%;
+ border-bottom: solid black 1px;
+ vertical-align: center;
+ background-color: #ffffff;
+}
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/addResults.template b/pki/linux/tps-ui/shared/docroot/tokendb/addResults.template
new file mode 100644
index 000000000..c02b2d9dc
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/addResults.template
@@ -0,0 +1,74 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri = "";
+if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+} else {
+ uri += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri+"\">Main Menu</a></font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+if (typeof(tid) == "undefined") {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">\n");
+ document.write("Missing token ID</font>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+} else {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">\n");
+ document.write("New token record "+tid+" has been added.</font>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+}
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/delete.template b/pki/linux/tps-ui/shared/docroot/tokendb/delete.template
new file mode 100644
index 000000000..bb5dda0dc
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/delete.template
@@ -0,0 +1,283 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Administrator Operations : Token Details</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function trim(str) {
+ var i, k, newString;
+
+ for (i = 0; i < str.length; i++) {
+ if (str.charAt(i) != ' ' )
+ break;
+ }
+ for (k = str.length - 1; k >= i; k--) {
+ if (str.charAt(k) != ' ' ) {
+ k++;
+ break;
+ }
+ }
+
+ if (k > i)
+ newString = str.substring(i, k);
+ else
+ newString = null;
+
+ return newString;
+}
+
+function checkDate(str) {
+ var newString;
+
+ if (str.length == 15 && str.charAt(14) == 'Z') {
+ newString = str.substring(0, 4);
+ newString += '/';
+ newString += str.substring(4, 6);
+ newString += '/';
+ newString += str.substring(6, 8);
+ newString += ' ';
+ newString += str.substring(8, 10);
+ newString += ':';
+ newString += str.substring(10, 12);
+ newString += ':';
+ newString += str.substring(12, 14);
+ } else {
+ newString = str;
+ }
+
+ return newString;
+}
+
+function doSave(form) {
+ if (form.uid.value.length > 0) {
+ var trimmedList = "";
+ var uids = form.uid.value.split(',');
+
+ for (var i=0; i < uids.length; i++) {
+ if (i > 0) trimmedList += ",";
+ trimmedList += trim(uids[i]);
+ }
+ form.uid.value = trimmedList;
+ }
+ if (form.status.value.length > 0) {
+ form.status.value = trim(form.status.value);
+ }
+
+ if (form.status.value == "") {
+ alert("Enter token status");
+ } else {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=save&tid="+results[0].cn;
+
+ if (results[0].tokenUserID != form.uid.value) {
+ uri += "&uid=" + form.uid.value;
+ }
+ if (results[0].tokenStatus != form.status.value) {
+ uri += "&s=" + form.status.value;
+ }
+ uri += "&m=" + results[0].modified;
+ location.href = uri;
+ }
+}
+
+function doCancel() {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ location.href = uri;
+}
+
+
+
+if (typeof(results) == "undefined" || results.length == 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Not Found</font>\n");
+} else if (results.length > 1) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Found too many tokens to edit</font>\n");
+} else {
+ document.write("<BR>");
+
+ document.write("<p>\n");
+ document.write("<b>Token Information:</b>");
+ document.write("<p>\n");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].cn+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "User ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenUserID+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Status:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenStatus+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Policy:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenPolicy+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ document.write("</table>\n");
+ document.write("<p>\n");
+ document.write("<b>System Information:</b>");
+ document.write("<p>\n");
+
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Key Info:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].keyInfo+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Applet ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenAppletID+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Creation Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfCreate)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Modification Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfModify)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("</table>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+
+ document.write("<DIV ALIGN=RIGHT>\n");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0>\n");
+ document.write("<tr valign=top>\n");
+ document.write("<td>\n");
+ document.write("Are you sure?");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=delete><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=Delete></form>");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ document.write("</table>\n");
+
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/deleteResults.template b/pki/linux/tps-ui/shared/docroot/tokendb/deleteResults.template
new file mode 100644
index 000000000..d15dd6827
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/deleteResults.template
@@ -0,0 +1,75 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri = "";
+if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+} else {
+ uri += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri+"\">Main Menu</a></font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+if (typeof(tid) == "undefined") {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">\n");
+ document.write("Missing token ID</font>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+} else {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">\n");
+ document.write("Token record "+tid+" has been deleted.</font>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+}
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/doToken.template b/pki/linux/tps-ui/shared/docroot/tokendb/doToken.template
new file mode 100644
index 000000000..e682df99f
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/doToken.template
@@ -0,0 +1,310 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Agent Operations : Token Details</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function breakLines(str) {
+ str = str.replace('#', '<br>');
+ return str;
+}
+
+function trim(str) {
+ var i, k, newString;
+
+ for (i = 0; i < str.length; i++) {
+ if (str.charAt(i) != ' ' )
+ break;
+ }
+ for (k = str.length - 1; k >= i; k--) {
+ if (str.charAt(k) != ' ' ) {
+ k++;
+ break;
+ }
+ }
+
+ if (k > i)
+ newString = str.substring(i, k);
+ else
+ newString = null;
+
+ return newString;
+}
+
+function checkDate(str) {
+ var newString;
+
+ if (str.length == 15 && str.charAt(14) == 'Z') {
+ newString = str.substring(0, 4);
+ newString += '/';
+ newString += str.substring(4, 6);
+ newString += '/';
+ newString += str.substring(6, 8);
+ newString += ' ';
+ newString += str.substring(8, 10);
+ newString += ':';
+ newString += str.substring(10, 12);
+ newString += ':';
+ newString += str.substring(12, 14);
+ } else {
+ newString = str;
+ }
+
+ return newString;
+}
+
+function doSave(form) {
+ if (form.uid.value.length > 0) {
+ var trimmedList = "";
+ var uids = form.uid.value.split(',');
+
+ for (var i=0; i < uids.length; i++) {
+ if (i > 0) trimmedList += ",";
+ trimmedList += trim(uids[i]);
+ }
+ form.uid.value = trimmedList;
+ }
+ if (form.status.value.length > 0) {
+ form.status.value = trim(form.status.value);
+ }
+
+ if (form.status.value == "") {
+ alert("Enter token status");
+ } else {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=save&tid="+results[0].cn;
+
+ if (results[0].tokenUserID != form.uid.value) {
+ uri += "&uid=" + form.uid.value;
+ }
+ if (results[0].tokenStatus != form.status.value) {
+ uri += "&s=" + form.status.value;
+ }
+ uri += "&m=" + results[0].modified;
+ location.href = uri;
+ }
+}
+
+function doCancel() {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ location.href = uri;
+}
+
+
+
+if (rc == "0") {
+ document.write("<b>The operation has been successful.</b>");
+ document.write("<p>\n");
+} else if (typeof(results) == "undefined" || results.length == 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Not Found</font>\n");
+} else if (results.length > 1) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Found too many tokens to edit</font>\n");
+} else {
+ document.write("<BR>");
+
+ document.write("<p>\n");
+ document.write("<b>Token Information:</b>");
+ document.write("<p>\n");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].cn+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "User ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenUserID+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Status:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenStatus+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Reason:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenReason+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Policy:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenPolicy+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("</table>\n");
+ document.write("<p>\n");
+ document.write("<b>System Information:</b>");
+ document.write("<p>\n");
+
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Key Info:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].keyInfo+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Applet ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenAppletID+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Creation Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfCreate)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Modification Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfModify)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("</table>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0>\n");
+ document.write("<tr>\n");
+ document.write("<td width=60%>\n");
+ document.write("<form method='get' action='tus'><select name=\"question\"><option value=\"1\">This token has been physically damaged.</option><option value=\"2\">This token has been permanently lost.</option><option value=\"3\">This token has been temporarily lost.</option><option value=\"4\">This temporarily lost token has been found.</option><option value=\"5\">This temporarily lost token cannot be found (becomes permanently lost).</option><option value=\"6\">This token has been terminated.</option></select><input type=hidden name=op value=do_token><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Go\"></form>");
+ document.write("</td>\n");
+ document.write("<td width=10%>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=revoke><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Revoke\"></form>");
+ document.write("</td>\n");
+ document.write("<td width=10%>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=view_certificate><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Show Certificates\"></form>");
+ document.write("</td>\n");
+ document.write("<td width=10%>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=view_activity><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Show Activities\"></form>");
+ document.write("</td>\n");
+ document.write("<td width=10%>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=edit><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Edit\"></form>");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ document.write("</table>\n");
+
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/doTokenConfirm.template b/pki/linux/tps-ui/shared/docroot/tokendb/doTokenConfirm.template
new file mode 100644
index 000000000..06b642ead
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/doTokenConfirm.template
@@ -0,0 +1,330 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Agent Operations : Token Details</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function breakLines(str) {
+ str = str.replace('#', '<br>');
+ return str;
+}
+
+function trim(str) {
+ var i, k, newString;
+
+ for (i = 0; i < str.length; i++) {
+ if (str.charAt(i) != ' ' )
+ break;
+ }
+ for (k = str.length - 1; k >= i; k--) {
+ if (str.charAt(k) != ' ' ) {
+ k++;
+ break;
+ }
+ }
+
+ if (k > i)
+ newString = str.substring(i, k);
+ else
+ newString = null;
+
+ return newString;
+}
+
+function checkDate(str) {
+ var newString;
+
+ if (str.length == 15 && str.charAt(14) == 'Z') {
+ newString = str.substring(0, 4);
+ newString += '/';
+ newString += str.substring(4, 6);
+ newString += '/';
+ newString += str.substring(6, 8);
+ newString += ' ';
+ newString += str.substring(8, 10);
+ newString += ':';
+ newString += str.substring(10, 12);
+ newString += ':';
+ newString += str.substring(12, 14);
+ } else {
+ newString = str;
+ }
+
+ return newString;
+}
+
+function doSave(form) {
+ if (form.uid.value.length > 0) {
+ var trimmedList = "";
+ var uids = form.uid.value.split(',');
+
+ for (var i=0; i < uids.length; i++) {
+ if (i > 0) trimmedList += ",";
+ trimmedList += trim(uids[i]);
+ }
+ form.uid.value = trimmedList;
+ }
+ if (form.status.value.length > 0) {
+ form.status.value = trim(form.status.value);
+ }
+
+ if (form.status.value == "") {
+ alert("Enter token status");
+ } else {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=save&tid="+results[0].cn;
+
+ if (results[0].tokenUserID != form.uid.value) {
+ uri += "&uid=" + form.uid.value;
+ }
+ if (results[0].tokenStatus != form.status.value) {
+ uri += "&s=" + form.status.value;
+ }
+ uri += "&m=" + results[0].modified;
+ location.href = uri;
+ }
+}
+
+function doCancel() {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ location.href = uri;
+}
+
+
+
+if (typeof(results) == "undefined" || results.length == 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Not Found</font>\n");
+} else if (results.length > 1) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Found too many tokens to edit</font>\n");
+} else {
+ document.write("<BR>");
+
+ document.write("<p>\n");
+ document.write("<b>Token Information:</b>");
+ document.write("<p>\n");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].cn+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "User ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenUserID+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Status:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenStatus+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Reason:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenReason+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Policy:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenPolicy+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("</table>\n");
+ document.write("<p>\n");
+ document.write("<b>System Information:</b>");
+ document.write("<p>\n");
+
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Key Info:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].keyInfo+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Applet ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenAppletID+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Creation Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfCreate)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Modification Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfModify)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("</table>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0>\n");
+ document.write("<tr>\n");
+ document.write("<td width=60%>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">");
+ document.write("Are you sure?");
+ document.write("</font>");
+ document.write("<form method='get' action='tus'><select name=\"question\">");
+ if (question == '1') {
+ document.write("<option selected value=\"1\">This token has been physically damaged.</option>");
+ } else {
+ document.write("<option value=\"1\">This token has been physically damaged.</option>");
+ }
+ if (question == '2') {
+ document.write("<option selected value=\"2\">This token has been permanently lost.</option>");
+ } else {
+ document.write("<option value=\"2\">This token has been permanently lost.</option>");
+ }
+ if (question == '3') {
+ document.write("<option selected value=\"3\">This token has been temporarily lost.</option>");
+ } else {
+ document.write("<option value=\"3\">This token has been temporarily lost.</option>");
+ }
+ if (question == '4') {
+ document.write("<option selected value=\"4\">This temporarily lost token has been found.</option>");
+ } else {
+ document.write("<option value=\"4\">This temporarily lost token has been found.</option>");
+ }
+ if (question == '5') {
+ document.write("<option selected value=\"5\">This temporarily lost token cannot be found (becomes permanently lost).</option>");
+ } else {
+ document.write("<option value=\"5\">This temporarily lost token cannot be found (becomes permanently lost).</option>");
+ }
+ if (question == '6') {
+ document.write("<option selected value=\"6\">This token has been terminated.</option>");
+ } else {
+ document.write("<option value=\"6\">This token has been terminated.</option>");
+ }
+ document.write("</select><input type=hidden name=op value=do_token>");
+ document.write("<input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Go\"></form>");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ document.write("</table>\n");
+
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/edit.template b/pki/linux/tps-ui/shared/docroot/tokendb/edit.template
new file mode 100644
index 000000000..e94bdf91e
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/edit.template
@@ -0,0 +1,186 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Agent Operations : Edit Token</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function trim(str) {
+ var i, k, newString;
+
+ for (i = 0; i < str.length; i++) {
+ if (str.charAt(i) != ' ' )
+ break;
+ }
+ for (k = str.length - 1; k >= i; k--) {
+ if (str.charAt(k) != ' ' ) {
+ k++;
+ break;
+ }
+ }
+
+ if (k > i)
+ newString = str.substring(i, k);
+ else
+ newString = null;
+
+ return newString;
+}
+
+function doSave(form) {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=save&tid="+results[0].cn;
+
+ if (results[0].tokenPolicy != form.tokenPolicy.value) {
+ uri += "&tokenPolicy=" + form.tokenPolicy.value;
+ }
+ uri += "&m=" + results[0].modified;
+ location.href = uri;
+}
+
+function doCancel() {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ location.href = uri;
+}
+
+
+
+if (typeof(results) == "undefined" || results.length == 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Not Found</font>\n");
+} else if (results.length > 1) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Found too many tokens to edit</font>\n");
+} else {
+ document.write("<BR>");
+ document.write("<FORM NAME =\"editForm\" ACTION=\"\" METHOD=GET>");
+
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].cn+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "User ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write(results[0].tokenUserID+"\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Status:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write(results[0].tokenStatus+"\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Policy:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<input TYPE=TEXT NAME=tokenPolicy SIZE=20 VALUE="+results[0].tokenPolicy+">\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("</table>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+
+ document.write("<DIV ALIGN=RIGHT>\n");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0>\n");
+ document.write("<tr>\n");
+ document.write("<td>\n");
+ document.write("<input TYPE=button VALUE=Save onClick=\"doSave(editForm);\">");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<input TYPE=button VALUE=Cancel onClick=\"doCancel();\">");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ document.write("</table>\n");
+
+ document.write("</form>\n");
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/editAdmin.template b/pki/linux/tps-ui/shared/docroot/tokendb/editAdmin.template
new file mode 100644
index 000000000..fea19cba3
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/editAdmin.template
@@ -0,0 +1,214 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Administrator Operations : Edit Token</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function trim(str) {
+ var i, k, newString;
+
+ for (i = 0; i < str.length; i++) {
+ if (str.charAt(i) != ' ' )
+ break;
+ }
+ for (k = str.length - 1; k >= i; k--) {
+ if (str.charAt(k) != ' ' ) {
+ k++;
+ break;
+ }
+ }
+
+ if (k > i)
+ newString = str.substring(i, k);
+ else
+ newString = null;
+
+ return newString;
+}
+
+function doSave(form) {
+ if (form.uid.value.length > 0) {
+ var trimmedList = "";
+ var uids = form.uid.value.split(',');
+
+ for (var i=0; i < uids.length; i++) {
+ if (i > 0) trimmedList += ",";
+ trimmedList += trim(uids[i]);
+ }
+ form.uid.value = trimmedList;
+ }
+
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=save&tid="+results[0].cn;
+
+ if (results[0].tokenUserID != form.uid.value) {
+ uri += "&uid=" + form.uid.value;
+ }
+ if (results[0].tokenPolicy != form.tokenPolicy.value) {
+ uri += "&tokenPolicy=" + form.tokenPolicy.value;
+ }
+ if (results[0].tokenReason != form.tokenReason.value) {
+ uri += "&tokenReason=" + form.tokenReason.value;
+ }
+ uri += "&m=" + results[0].modified;
+ location.href = uri;
+}
+
+function doCancel() {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ location.href = uri;
+}
+
+
+
+if (typeof(results) == "undefined" || results.length == 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Not Found</font>\n");
+} else if (results.length > 1) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Found too many tokens to edit</font>\n");
+} else {
+ document.write("<BR>");
+ document.write("<FORM NAME =\"editForm\" ACTION=\"\" METHOD=GET>");
+
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].cn+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "User ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<input TYPE=TEXT NAME=uid SIZE=20 VALUE="+results[0].tokenUserID+">\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Status:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenStatus+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Reason:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<input TYPE=TEXT NAME=tokenReason SIZE=20 VALUE="+results[0].tokenReason+">\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Policy:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<input TYPE=TEXT NAME=tokenPolicy SIZE=20 VALUE="+results[0].tokenPolicy+">\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("</table>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+
+ document.write("<DIV ALIGN=RIGHT>\n");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0>\n");
+ document.write("<tr>\n");
+ document.write("<td>\n");
+ document.write("<input TYPE=button VALUE=Save onClick=\"doSave(editForm);\">");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<input TYPE=button VALUE=Cancel onClick=\"doCancel();\">");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ document.write("</table>\n");
+
+ document.write("</form>\n");
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/editAdminResults.template b/pki/linux/tps-ui/shared/docroot/tokendb/editAdminResults.template
new file mode 100644
index 000000000..07a25b833
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/editAdminResults.template
@@ -0,0 +1,76 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri = "";
+if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+} else {
+ uri += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri+"\">Main Menu</a></font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+if (typeof(tid) == "undefined") {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">\n");
+ document.write("Missing token ID</font>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+} else {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">\n");
+ document.write("Token record "+tid+" has been updated.</font>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/editResults.template b/pki/linux/tps-ui/shared/docroot/tokendb/editResults.template
new file mode 100644
index 000000000..f0f52b701
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/editResults.template
@@ -0,0 +1,76 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri = "";
+if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+} else {
+ uri += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri+"\">Main Menu</a></font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+if (typeof(tid) == "undefined") {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">\n");
+ document.write("Missing token ID</font>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+} else {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">\n");
+ document.write("Token record <a href=\"tus?op=show&tid=" + tid + "\">"+tid+"</a> has been updated.</font>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/error.template b/pki/linux/tps-ui/shared/docroot/tokendb/error.template
new file mode 100644
index 000000000..e0bfcb22b
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/error.template
@@ -0,0 +1,74 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri = "";
+if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+} else {
+ uri += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri+"\">Main Menu</a></font>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+document.write("<font size=-1 face=\"PrimaSans BT, Verdana, sans-serif\">\n");
+
+if (typeof(error) == "undefined") {
+ document.write("TUS encountered undefined error.");
+} else {
+ document.write(""+error);
+}
+
+document.write("</font>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/index.template b/pki/linux/tps-ui/shared/docroot/tokendb/index.template
new file mode 100644
index 000000000..69c377f1a
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/index.template
@@ -0,0 +1,129 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a></font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\"><b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function doFind(form) {
+ if (form.uid.value == "" && form.tid.value == "") {
+ alert("Enter token or user ID");
+ } else {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus"
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=view";
+ if (form.tid.value.length > 0) uri += "&tid=" + form.tid.value;
+ if (form.uid.value.length > 0) uri += "&uid=" + form.uid.value;
+ location.href = uri;
+ }
+}
+//-->
+</SCRIPT>
+
+<table BORDER=0 CELLSPACING=0 CELLPADDING=0 width=100%>
+<tr>
+ <td bgcolor="#e5e5e5" width="20%"><a href="/tus">Agent Operations</td>
+ <td width="20%"><a href="/tus?op=index_admin">Administrator Operations</td>
+ <td width="60%"></td>
+</tr>
+</table>
+<table BORDER=0 CELLSPACING=0 CELLPADDING=0 width=100%>
+<tr>
+ <td bgcolor=#e5e5e5>&nbsp;</td>
+</tr>
+</table>
+<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>
+ <tr>
+ <td><i>Tokens</i></td>
+ </tr>
+ <tr>
+ <td><li><a href="tus?op=view?tid=&uid=">List Tokens</a></td>
+ </tr>
+ <tr>
+ <td><li><a href="tus?op=search">Search Tokens</a></td>
+ </tr>
+ <tr>
+ <td><li><a href="tus?op=new">Add New Token</a></td>
+ </tr>
+ <tr>
+ <td><i>Certificates</i></td>
+ </tr>
+ <tr>
+ <td><li><a href="tus?op=view_certificate?tid=&uid=">List Certificates</a></td>
+ </tr>
+ <tr>
+ <td><li><a href="tus?op=search_certificate">Search Certificates</a></td>
+ </tr>
+ <tr>
+ <td><i>Activities</i></td>
+ </tr>
+ <tr>
+ <td><li><a href="tus?op=view_activity">List Activities</a></td>
+ </tr>
+ <tr>
+ <td><li><a href="tus?op=search_activity">Search Activities</a></td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+</table>
+<HR NOSHADE SIZE=1>
+<DIV ALIGN=RIGHT>
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/indexAdmin.template b/pki/linux/tps-ui/shared/docroot/tokendb/indexAdmin.template
new file mode 100644
index 000000000..7f5413409
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/indexAdmin.template
@@ -0,0 +1,108 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a></font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\"><b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function doFind(form) {
+ if (form.uid.value == "" && form.tid.value == "") {
+ alert("Enter token or user ID");
+ } else {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus"
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=view";
+ if (form.tid.value.length > 0) uri += "&tid=" + form.tid.value;
+ if (form.uid.value.length > 0) uri += "&uid=" + form.uid.value;
+ location.href = uri;
+ }
+}
+//-->
+</SCRIPT>
+
+<table BORDER=0 CELLSPACING=0 CELLPADDING=0 width=100%>
+<tr>
+ <td width="20%"><a href="/tus">Agent Operations</td>
+ <td bgcolor="#e5e5e5" width="20%"><a href="/tus?op=index_admin">Administrator Operations</td>
+ <td width="60%"></td>
+</tr>
+</table>
+<table BORDER=0 CELLSPACING=0 CELLPADDING=0 width=100%>
+<tr>
+ <td bgcolor=#e5e5e5>&nbsp;</td>
+</tr>
+</table>
+<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>
+ <tr>
+ <td></td>
+ </tr>
+ <tr>
+ <td><i>Tokens</i></td>
+ </tr>
+ <tr>
+ <td><li><a href="tus?op=view_admin?tid=&uid=">List Tokens</a></td>
+ </tr>
+ <tr>
+ <td><li><a href="tus?op=search_admin">Search Tokens</a></td>
+ </tr>
+</table>
+<HR NOSHADE SIZE=1>
+<DIV ALIGN=RIGHT>
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/new.template b/pki/linux/tps-ui/shared/docroot/tokendb/new.template
new file mode 100644
index 000000000..a429ce5ad
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/new.template
@@ -0,0 +1,94 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Agent Operations : Add New Token</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function doAdd(form) {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus"
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=add";
+ uri += "&tid=" + form.tid.value;
+ location.href = uri;
+}
+//-->
+</SCRIPT>
+
+<FORM NAME ="addForm" ACTION="" METHOD=GET>
+<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>
+ <tr>
+ <td ALIGN=LEFT width=30%>
+ <font size=-1 face="PrimaSans BT, Verdana, sans-serif">
+ Token ID:
+ </font>
+ </td>
+ <td>
+ <input TYPE=TEXT NAME=tid SIZE=20>
+ </td>
+ </tr>
+</table>
+<HR NOSHADE SIZE=1>
+<DIV ALIGN=RIGHT>
+<input TYPE=button VALUE=Add onClick="doAdd(addForm);">
+</form>
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/revoke.template b/pki/linux/tps-ui/shared/docroot/tokendb/revoke.template
new file mode 100644
index 000000000..2d223287c
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/revoke.template
@@ -0,0 +1,307 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Agent Operations : Token Details</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function breakLines(str) {
+ str = str.replace('#', '<br>');
+ return str;
+}
+
+function trim(str) {
+ var i, k, newString;
+
+ for (i = 0; i < str.length; i++) {
+ if (str.charAt(i) != ' ' )
+ break;
+ }
+ for (k = str.length - 1; k >= i; k--) {
+ if (str.charAt(k) != ' ' ) {
+ k++;
+ break;
+ }
+ }
+
+ if (k > i)
+ newString = str.substring(i, k);
+ else
+ newString = null;
+
+ return newString;
+}
+
+function checkDate(str) {
+ var newString;
+
+ if (str.length == 15 && str.charAt(14) == 'Z') {
+ newString = str.substring(0, 4);
+ newString += '/';
+ newString += str.substring(4, 6);
+ newString += '/';
+ newString += str.substring(6, 8);
+ newString += ' ';
+ newString += str.substring(8, 10);
+ newString += ':';
+ newString += str.substring(10, 12);
+ newString += ':';
+ newString += str.substring(12, 14);
+ } else {
+ newString = str;
+ }
+
+ return newString;
+}
+
+function doSave(form) {
+ if (form.uid.value.length > 0) {
+ var trimmedList = "";
+ var uids = form.uid.value.split(',');
+
+ for (var i=0; i < uids.length; i++) {
+ if (i > 0) trimmedList += ",";
+ trimmedList += trim(uids[i]);
+ }
+ form.uid.value = trimmedList;
+ }
+ if (form.status.value.length > 0) {
+ form.status.value = trim(form.status.value);
+ }
+
+ if (form.status.value == "") {
+ alert("Enter token status");
+ } else {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=save&tid="+results[0].cn;
+
+ if (results[0].tokenUserID != form.uid.value) {
+ uri += "&uid=" + form.uid.value;
+ }
+ if (results[0].tokenStatus != form.status.value) {
+ uri += "&s=" + form.status.value;
+ }
+ uri += "&m=" + results[0].modified;
+ location.href = uri;
+ }
+}
+
+function doCancel() {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ location.href = uri;
+}
+
+
+
+if (typeof(results) == "undefined" || results.length == 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Not Found</font>\n");
+} else if (results.length > 1) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Found too many tokens to edit</font>\n");
+} else {
+ document.write("<BR>");
+
+ document.write("<p>\n");
+ document.write("<b>Token Information:</b>");
+ document.write("<p>\n");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].cn+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "User ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenUserID+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Status:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenStatus+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Reason:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenReason+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Policy:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenPolicy+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("</table>\n");
+ document.write("<p>\n");
+ document.write("<b>System Information:</b>");
+ document.write("<p>\n");
+
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Key Info:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].keyInfo+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Applet ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenAppletID+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Creation Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfCreate)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Modification Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfModify)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("</table>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0>\n");
+ document.write("<tr>\n");
+ document.write("<td width=60%>\n");
+ document.write("<form method='get' action='tus'><select name=\"question\"><option value=\"1\">Is this token physically damaged?</option><option value=\"2\">Is this token permanently lost?</option><option value=\"3\">Is this token temporarily lost?</option><option value=\"4\">Is this temporarily lost token found?</option><option value=\"5\">Does this temporarily lost token become permanently lost?</option></select><input type=hidden name=op value=do_token><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Go\"></form>");
+ document.write("</td>\n");
+ document.write("<td width=10%>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=revoke><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Revoke\"></form>");
+ document.write("</td>\n");
+ document.write("<td width=10%>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=view_certificate><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Show Certificates\"></form>");
+ document.write("</td>\n");
+ document.write("<td width=10%>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=view_activity><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Show Activities\"></form>");
+ document.write("</td>\n");
+ document.write("<td width=10%>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=edit><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Edit\"></form>");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ document.write("</table>\n");
+
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/search.template b/pki/linux/tps-ui/shared/docroot/tokendb/search.template
new file mode 100644
index 000000000..929796080
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/search.template
@@ -0,0 +1,116 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Search Tokens</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function doFind(form) {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus"
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=view";
+ uri += "&tid=" + form.tid.value;
+ uri += "&uid=" + form.uid.value;
+ uri += "&maxCount=" + form.maxCount.value;
+ location.href = uri;
+}
+//-->
+</SCRIPT>
+
+<FORM NAME ="findForm" ACTION="" METHOD=GET>
+<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>
+ <tr>
+ <td ALIGN=LEFT width=30%>
+ <font size=-1 face="PrimaSans BT, Verdana, sans-serif">
+ Token ID:
+ </font>
+ </td>
+ <td>
+ <input TYPE=TEXT NAME=tid SIZE=20>
+ </td>
+ </tr>
+ <tr>
+ <td ALIGN=LEFT width=30%>
+ <font size=-1 face="PrimaSans BT, Verdana, sans-serif">
+ User ID:
+ </font>
+ </td>
+ <td>
+ <input TYPE=TEXT NAME=uid SIZE=20>
+ </td>
+ </tr>
+ <tr>
+ <td ALIGN=LEFT width=30%>
+ <font size=-1 face="PrimaSans BT, Verdana, sans-serif">
+ Max Count:
+ </font>
+ </td>
+ <td>
+ <input TYPE=TEXT SIZE=4 NAME=maxCount value="20">
+ </td>
+ </tr>
+</table>
+<HR NOSHADE SIZE=1>
+<DIV ALIGN=RIGHT>
+<input TYPE=button VALUE=Find onClick="doFind(findForm);">
+</form>
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/searchActivity.template b/pki/linux/tps-ui/shared/docroot/tokendb/searchActivity.template
new file mode 100644
index 000000000..d271f0144
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/searchActivity.template
@@ -0,0 +1,116 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Agent Operations : Search Activity</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function doFind(form) {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus"
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=view_activity";
+ uri += "&tid=" + form.tid.value;
+ uri += "&uid=" + form.uid.value;
+ uri += "&maxCount=" + form.maxCount.value;
+ location.href = uri;
+}
+//-->
+</SCRIPT>
+
+<FORM NAME ="findForm" ACTION="" METHOD=GET>
+<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>
+ <tr>
+ <td ALIGN=LEFT width=30%>
+ <font size=-1 face="PrimaSans BT, Verdana, sans-serif">
+ Token ID:
+ </font>
+ </td>
+ <td>
+ <input TYPE=TEXT NAME=tid SIZE=20>
+ </td>
+ </tr>
+ <tr>
+ <td ALIGN=LEFT width=30%>
+ <font size=-1 face="PrimaSans BT, Verdana, sans-serif">
+ User ID:
+ </font>
+ </td>
+ <td>
+ <input TYPE=TEXT NAME=uid SIZE=20>
+ </td>
+ </tr>
+ <tr>
+ <td ALIGN=LEFT width=30%>
+ <font size=-1 face="PrimaSans BT, Verdana, sans-serif">
+ Max Count:
+ </font>
+ </td>
+ <td>
+ <input TYPE=TEXT NAME=maxCount SIZE=4 value="20">
+ </td>
+ </tr>
+</table>
+<HR NOSHADE SIZE=1>
+<DIV ALIGN=RIGHT>
+<input TYPE=button VALUE=Find onClick="doFind(findForm);">
+</form>
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/searchActivityResults.template b/pki/linux/tps-ui/shared/docroot/tokendb/searchActivityResults.template
new file mode 100644
index 000000000..505ded271
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/searchActivityResults.template
@@ -0,0 +1,195 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+function checkDate(str) {
+ var newString;
+
+ if (str.length == 15 && str.charAt(14) == 'Z') {
+ newString = str.substring(0, 4);
+ newString += '/';
+ newString += str.substring(4, 6);
+ newString += '/';
+ newString += str.substring(6, 8);
+ newString += ' ';
+ newString += str.substring(8, 10);
+ newString += ':';
+ newString += str.substring(10, 12);
+ newString += ':';
+ newString += str.substring(12, 14);
+ } else {
+ newString = str;
+ }
+
+ return newString;
+}
+
+var uri = "";
+if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+} else {
+ uri += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri+"\">Main Menu</a> : Agent Operations : Search Activity Results</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+uri += "?op=show&tid=";
+
+if (typeof(results) == "undefined" || results.length == 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Not Found</font>\n");
+} else {
+ document.write("<BR>");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr bgcolor=#cccccc>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Activity ID</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "IP</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "User ID</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Operation</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Result</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Created</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ document.write("<tr bgcolor=#cccccc>\n");
+ document.write("<td colspan=7>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">");
+ document.write("Details");
+ document.write("</font>");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ for (var i = 0; i < results.length; i++) {
+ if (i % 2 == 0) {
+ document.write("<tr bgcolor='#eeeeee'>\n");
+ } else {
+ document.write("<tr >\n");
+ }
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+
+ results[i].cn+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\"><a href=\"/tus?op=show&tid="+
+ results[i].tokenID+"\">" + results[i].tokenID + "</a></font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenIP+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenUserID+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenOp+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenResult+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[i].dateOfCreate)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ if (i % 2 == 0) {
+ document.write("<tr bgcolor='#eeeeee'>\n");
+ } else {
+ document.write("<tr >\n");
+ }
+ document.write("<td colspan=7>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+ results[i].tokenMsg+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ }
+ document.write("</table>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+ if (typeof(results) != "undefined" && results.length > 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-2\">");
+ if (typeof(results) != "undefined" || results.length == 0) {
+ if (typeof(limited) != "undefined" && typeof(total) != "undefined") {
+ document.write("<br>" + limited + " of " + total + "\n");
+ } else if (typeof(total) != "undefined") {
+ document.write("<br>Total: " + total + "\n");
+ }
+ }
+ document.write("</font>");
+ }
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/searchAdmin.template b/pki/linux/tps-ui/shared/docroot/tokendb/searchAdmin.template
new file mode 100644
index 000000000..29cbff70c
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/searchAdmin.template
@@ -0,0 +1,116 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Administrator Operations : Search Tokens</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function doFind(form) {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus"
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=view_admin";
+ uri += "&tid=" + form.tid.value;
+ uri += "&uid=" + form.uid.value;
+ uri += "&maxCount=" + form.maxCount.value;
+ location.href = uri;
+}
+//-->
+</SCRIPT>
+
+<FORM NAME ="findForm" ACTION="" METHOD=GET>
+<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>
+ <tr>
+ <td ALIGN=LEFT width=30%>
+ <font size=-1 face="PrimaSans BT, Verdana, sans-serif">
+ Token ID:
+ </font>
+ </td>
+ <td>
+ <input TYPE=TEXT NAME=tid SIZE=20>
+ </td>
+ </tr>
+ <tr>
+ <td ALIGN=LEFT width=30%>
+ <font size=-1 face="PrimaSans BT, Verdana, sans-serif">
+ User ID:
+ </font>
+ </td>
+ <td>
+ <input TYPE=TEXT NAME=uid SIZE=20>
+ </td>
+ </tr>
+ <tr>
+ <td ALIGN=LEFT width=30%>
+ <font size=-1 face="PrimaSans BT, Verdana, sans-serif">
+ Max Count:
+ </font>
+ </td>
+ <td>
+ <input TYPE=TEXT NAME=maxCount SIZE=4 value="20">
+ </td>
+ </tr>
+</table>
+<HR NOSHADE SIZE=1>
+<DIV ALIGN=RIGHT>
+<input TYPE=button VALUE=Find onClick="doFind(findForm);">
+</form>
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/searchAdminResults.template b/pki/linux/tps-ui/shared/docroot/tokendb/searchAdminResults.template
new file mode 100644
index 000000000..efe4cc37d
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/searchAdminResults.template
@@ -0,0 +1,183 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+function checkDate(str) {
+ var newString;
+
+ if (str.length == 15 && str.charAt(14) == 'Z') {
+ newString = str.substring(0, 4);
+ newString += '/';
+ newString += str.substring(4, 6);
+ newString += '/';
+ newString += str.substring(6, 8);
+ newString += ' ';
+ newString += str.substring(8, 10);
+ newString += ':';
+ newString += str.substring(10, 12);
+ newString += ':';
+ newString += str.substring(12, 14);
+ } else {
+ newString = str;
+ }
+
+ return newString;
+}
+
+var uri = "";
+if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+} else {
+ uri += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri+"\">Main Menu</a> : Administrator Operations : Search Results</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+uri += "?op=show_admin&tid=";
+
+if (typeof(results) == "undefined" || results.length == 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Not Found</font>\n");
+} else {
+ document.write("<BR>");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr bgcolor=#e5e5e5>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "User ID</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Status</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Applet</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Key Info</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Policy</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Created</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Modified</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ for (var i = 0; i < results.length; i++) {
+ document.write("<tr>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "<a href=\""+uri+results[i].cn+"\">"+
+ results[i].cn+"</a></font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenUserID+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenStatus+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenAppletID+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].keyInfo+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenPolicy+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[i].dateOfCreate)+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[i].dateOfModify)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ }
+ document.write("</table>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+ if (typeof(results) != "undefined" && results.length > 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-2\">");
+ if (typeof(results) != "undefined" || results.length == 0) {
+ if (typeof(limited) != "undefined" && typeof(total) != "undefined") {
+ document.write("<br>" + limited + " of " + total + "\n");
+ } else if (typeof(total) != "undefined") {
+ document.write("<br>Total: " + total + "\n");
+ }
+ }
+ document.write("</font>");
+ }
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/searchCertificate.template b/pki/linux/tps-ui/shared/docroot/tokendb/searchCertificate.template
new file mode 100644
index 000000000..9bb630cc5
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/searchCertificate.template
@@ -0,0 +1,116 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Search Tokens</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function doFind(form) {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus"
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=view_certificate";
+ uri += "&tid=" + form.tid.value;
+ uri += "&uid=" + form.uid.value;
+ uri += "&maxCount=" + form.maxCount.value;
+ location.href = uri;
+}
+//-->
+</SCRIPT>
+
+<FORM NAME ="findForm" ACTION="" METHOD=GET>
+<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>
+ <tr>
+ <td ALIGN=LEFT width=30%>
+ <font size=-1 face="PrimaSans BT, Verdana, sans-serif">
+ Token ID:
+ </font>
+ </td>
+ <td>
+ <input TYPE=TEXT NAME=tid SIZE=20>
+ </td>
+ </tr>
+ <tr>
+ <td ALIGN=LEFT width=30%>
+ <font size=-1 face="PrimaSans BT, Verdana, sans-serif">
+ User ID:
+ </font>
+ </td>
+ <td>
+ <input TYPE=TEXT NAME=uid SIZE=20>
+ </td>
+ </tr>
+ <tr>
+ <td ALIGN=LEFT width=30%>
+ <font size=-1 face="PrimaSans BT, Verdana, sans-serif">
+ Max Count:
+ </font>
+ </td>
+ <td>
+ <input TYPE=TEXT SIZE=4 NAME=maxCount value="20">
+ </td>
+ </tr>
+</table>
+<HR NOSHADE SIZE=1>
+<DIV ALIGN=RIGHT>
+<input TYPE=button VALUE=Find onClick="doFind(findForm);">
+</form>
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/searchCertificateResults.template b/pki/linux/tps-ui/shared/docroot/tokendb/searchCertificateResults.template
new file mode 100644
index 000000000..219ccf9a3
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/searchCertificateResults.template
@@ -0,0 +1,182 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+function checkDate(str) {
+ var newString;
+
+ if (str.length == 15 && str.charAt(14) == 'Z') {
+ newString = str.substring(0, 4);
+ newString += '/';
+ newString += str.substring(4, 6);
+ newString += '/';
+ newString += str.substring(6, 8);
+ newString += ' ';
+ newString += str.substring(8, 10);
+ newString += ':';
+ newString += str.substring(10, 12);
+ newString += ':';
+ newString += str.substring(12, 14);
+ } else {
+ newString = str;
+ }
+
+ return newString;
+}
+
+var uri = "";
+if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+} else {
+ uri += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri+"\">Main Menu</a> : Agent Operations : Search Certificate Results</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+uri += "?op=show&tid=";
+
+if (typeof(results) == "undefined" || results.length == 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Not Found</font>\n");
+} else {
+ document.write("<BR>");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr bgcolor=#e5e5e5>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "ID</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Serial Number</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Subject</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token ID</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Key Type</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Last Status</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "User ID</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Last Modified At</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ for (var i = 0; i < results.length; i++) {
+ document.write("<tr>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\"><a href=\"/tus?op=show_certificate&cn="+
+ results[i].cn+"\">" + results[i].cn + "</a></font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "0x" + results[i].tokenSerial+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenSubject+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\"><a href=\"/tus?op=show&tid="+
+ results[i].tokenID+"\">" + results[i].tokenID + "</a></font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenKeyType+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenStatus+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenUserID+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[i].dateOfModify)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ }
+ document.write("</table>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+ if (typeof(results) != "undefined" && results.length > 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-2\">");
+ if (typeof(results) != "undefined" || results.length == 0) {
+ if (typeof(limited) != "undefined" && typeof(total) != "undefined") {
+ document.write("<br>" + limited + " of " + total + "\n");
+ } else if (typeof(total) != "undefined") {
+ document.write("<br>Total: " + total + "\n");
+ }
+ }
+ document.write("</font>");
+ }
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/searchResults.template b/pki/linux/tps-ui/shared/docroot/tokendb/searchResults.template
new file mode 100644
index 000000000..833796ce6
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/searchResults.template
@@ -0,0 +1,183 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+function checkDate(str) {
+ var newString;
+
+ if (str.length == 15 && str.charAt(14) == 'Z') {
+ newString = str.substring(0, 4);
+ newString += '/';
+ newString += str.substring(4, 6);
+ newString += '/';
+ newString += str.substring(6, 8);
+ newString += ' ';
+ newString += str.substring(8, 10);
+ newString += ':';
+ newString += str.substring(10, 12);
+ newString += ':';
+ newString += str.substring(12, 14);
+ } else {
+ newString = str;
+ }
+
+ return newString;
+}
+
+var uri = "";
+if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+} else {
+ uri += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri+"\">Main Menu</a> : Agent Operations : Search Results</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+uri += "?op=show&tid=";
+
+if (typeof(results) == "undefined" || results.length == 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Not Found</font>\n");
+} else {
+ document.write("<BR>");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr bgcolor=#e5e5e5>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "User ID</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Status</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Reason</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Applet</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Key Info</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Created</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Modified</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ for (var i = 0; i < results.length; i++) {
+ document.write("<tr>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "<a href=\""+uri+results[i].cn+"\">"+
+ results[i].cn+"</a></font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenUserID+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenStatus+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenReason+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].tokenAppletID+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[i].keyInfo+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[i].dateOfCreate)+"</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[i].dateOfModify)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ }
+ document.write("</table>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+ if (typeof(results) != "undefined" && results.length > 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-2\">");
+ if (typeof(results) != "undefined" || results.length == 0) {
+ if (typeof(limited) != "undefined" && typeof(total) != "undefined") {
+ document.write("<br>" + limited + " of " + total + "\n");
+ } else if (typeof(total) != "undefined") {
+ document.write("<br>Total: " + total + "\n");
+ }
+ }
+ document.write("</font>");
+ }
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/show.template b/pki/linux/tps-ui/shared/docroot/tokendb/show.template
new file mode 100644
index 000000000..dd5922f6f
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/show.template
@@ -0,0 +1,306 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Agent Operations : Token Details</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function breakLines(str) {
+ str = str.replace('#', '<br>');
+ return str;
+}
+
+function trim(str) {
+ var i, k, newString;
+
+ for (i = 0; i < str.length; i++) {
+ if (str.charAt(i) != ' ' )
+ break;
+ }
+ for (k = str.length - 1; k >= i; k--) {
+ if (str.charAt(k) != ' ' ) {
+ k++;
+ break;
+ }
+ }
+
+ if (k > i)
+ newString = str.substring(i, k);
+ else
+ newString = null;
+
+ return newString;
+}
+
+function checkDate(str) {
+ var newString;
+
+ if (str.length == 15 && str.charAt(14) == 'Z') {
+ newString = str.substring(0, 4);
+ newString += '/';
+ newString += str.substring(4, 6);
+ newString += '/';
+ newString += str.substring(6, 8);
+ newString += ' ';
+ newString += str.substring(8, 10);
+ newString += ':';
+ newString += str.substring(10, 12);
+ newString += ':';
+ newString += str.substring(12, 14);
+ } else {
+ newString = str;
+ }
+
+ return newString;
+}
+
+function doSave(form) {
+ if (form.uid.value.length > 0) {
+ var trimmedList = "";
+ var uids = form.uid.value.split(',');
+
+ for (var i=0; i < uids.length; i++) {
+ if (i > 0) trimmedList += ",";
+ trimmedList += trim(uids[i]);
+ }
+ form.uid.value = trimmedList;
+ }
+ if (form.status.value.length > 0) {
+ form.status.value = trim(form.status.value);
+ }
+
+ if (form.status.value == "") {
+ alert("Enter token status");
+ } else {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=save&tid="+results[0].cn;
+
+ if (results[0].tokenUserID != form.uid.value) {
+ uri += "&uid=" + form.uid.value;
+ }
+ if (results[0].tokenStatus != form.status.value) {
+ uri += "&s=" + form.status.value;
+ }
+ uri += "&m=" + results[0].modified;
+ location.href = uri;
+ }
+}
+
+function doCancel() {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ location.href = uri;
+}
+
+
+
+if (typeof(results) == "undefined" || results.length == 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Not Found</font>\n");
+} else if (results.length > 1) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Found too many tokens to edit</font>\n");
+} else {
+ document.write("<BR>");
+
+ document.write("<p>\n");
+ document.write("<b>Token Information:</b>");
+ document.write("<p>\n");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].cn+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "User ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenUserID+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Status:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenStatus+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Reason:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenReason+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Policy:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenPolicy+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("</table>\n");
+ document.write("<p>\n");
+ document.write("<b>System Information:</b>");
+ document.write("<p>\n");
+
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Key Info:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].keyInfo+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Applet ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenAppletID+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Creation Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfCreate)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Modification Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfModify)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("</table>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0>\n");
+ document.write("<tr>\n");
+ document.write("<td width=60%>\n");
+ document.write("<form method='get' action='tus'><select name=\"question\"><option value=\"1\">This token has been physically damaged.</option><option value=\"2\">This token has been permanently lost.</option><option value=\"3\">This token has been temporarily lost.</option><option value=\"4\">This temporarily lost token has been found.</option><option value=\"5\">This temporarily lost token cannot be found (becomes permanently lost).</option><option value=\"6\">This token has been terminated.</option></select><input type=hidden name=op value=do_confirm_token><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Go\"></form>");
+ document.write("</td>\n");
+ document.write("<td align=right width=10%>\n");
+ document.write("</td>\n");
+ document.write("<td align=right width=10%>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=edit><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Edit\"></form>");
+ document.write("</td>\n");
+ document.write("<td align=right width=10%>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=view_certificate><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Show Certificates\"></form>");
+ document.write("</td>\n");
+ document.write("<td align=right width=10%>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=view_activity><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Show Activities\"></form>");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ document.write("</table>\n");
+
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/showAdmin.template b/pki/linux/tps-ui/shared/docroot/tokendb/showAdmin.template
new file mode 100644
index 000000000..c4f182773
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/showAdmin.template
@@ -0,0 +1,296 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Administrator Operations : Token Details</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function trim(str) {
+ var i, k, newString;
+
+ for (i = 0; i < str.length; i++) {
+ if (str.charAt(i) != ' ' )
+ break;
+ }
+ for (k = str.length - 1; k >= i; k--) {
+ if (str.charAt(k) != ' ' ) {
+ k++;
+ break;
+ }
+ }
+
+ if (k > i)
+ newString = str.substring(i, k);
+ else
+ newString = null;
+
+ return newString;
+}
+
+function checkDate(str) {
+ var newString;
+
+ if (str.length == 15 && str.charAt(14) == 'Z') {
+ newString = str.substring(0, 4);
+ newString += '/';
+ newString += str.substring(4, 6);
+ newString += '/';
+ newString += str.substring(6, 8);
+ newString += ' ';
+ newString += str.substring(8, 10);
+ newString += ':';
+ newString += str.substring(10, 12);
+ newString += ':';
+ newString += str.substring(12, 14);
+ } else {
+ newString = str;
+ }
+
+ return newString;
+}
+
+function doSave(form) {
+ if (form.uid.value.length > 0) {
+ var trimmedList = "";
+ var uids = form.uid.value.split(',');
+
+ for (var i=0; i < uids.length; i++) {
+ if (i > 0) trimmedList += ",";
+ trimmedList += trim(uids[i]);
+ }
+ form.uid.value = trimmedList;
+ }
+ if (form.status.value.length > 0) {
+ form.status.value = trim(form.status.value);
+ }
+
+ if (form.status.value == "") {
+ alert("Enter token status");
+ } else {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=save&tid="+results[0].cn;
+
+ if (results[0].tokenUserID != form.uid.value) {
+ uri += "&uid=" + form.uid.value;
+ }
+ if (results[0].tokenStatus != form.status.value) {
+ uri += "&s=" + form.status.value;
+ }
+ uri += "&m=" + results[0].modified;
+ location.href = uri;
+ }
+}
+
+function doCancel() {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ location.href = uri;
+}
+
+
+
+if (typeof(results) == "undefined" || results.length == 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Not Found</font>\n");
+} else if (results.length > 1) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Found too many tokens to edit</font>\n");
+} else {
+ document.write("<BR>");
+
+ document.write("<p>\n");
+ document.write("<b>Token Information:</b>");
+ document.write("<p>\n");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].cn+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "User ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenUserID+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Status:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenStatus+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Reason:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenReason+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Policy:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenPolicy+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ document.write("</table>\n");
+ document.write("<p>\n");
+ document.write("<b>System Information:</b>");
+ document.write("<p>\n");
+
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Key Info:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].keyInfo+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Applet ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenAppletID+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Creation Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfCreate)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Modification Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfModify)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("</table>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+
+ document.write("<DIV ALIGN=RIGHT>\n");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0>\n");
+ document.write("<tr>\n");
+ document.write("<td>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=view_activity><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Show Activities\"></form>");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=edit_admin><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=Edit></form>");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<form method='get' action='tus'><input type=hidden name=op value=confirm><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=Delete></form>");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+ document.write("</table>\n");
+
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tokendb/showCert.template b/pki/linux/tps-ui/shared/docroot/tokendb/showCert.template
new file mode 100644
index 000000000..a9c4822f0
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tokendb/showCert.template
@@ -0,0 +1,346 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
+<HEAD>
+<TITLE>TPS</Title>
+</HEAD>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="6">
+ <tr bgcolor="#666699">
+ <td width=25%>
+ <table border="0" cellspacing="0" cellpadding="6">
+ <tr>
+ <td nowrap><font size="-1" face="PrimaSans BT, Verdana, sans-serif" color="white">Dogtag<b>&reg;<br>
+ Certificate<br>System</b></font> </td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=65% nowrap><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">TPS Services</font></td>
+ <td width="10%">&nbsp;</td>
+ </tr>
+</table>
+<p>
+
+<BODY>
+
+<CMS_TEMPLATE>
+
+<SCRIPT type="text/JavaScript">
+<!--
+var uri0 = "";
+if (typeof(uriBase) == "undefined") {
+ uri0 += "/tus";
+} else {
+ uri0 += uriBase;
+}
+
+document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
+ "<a href=\""+uri0+"\">Main Menu</a> : Agent Operations : Certificate Details</font>\n");
+document.write("<table width=\"100%\"><tr><td align=\"right\">" +
+ "<b>UID:</b>" +
+ userid + "</td></tr></table>\n");
+document.write("<HR NOSHADE SIZE=1>\n");
+
+function breakLines(str) {
+ str = str.replace('#', '<br>');
+ return str;
+}
+
+function breakLinesWithDots(str) {
+ str = str.replace(/\.\./g, '<br>');
+ return str;
+}
+
+function trim(str) {
+ var i, k, newString;
+
+ for (i = 0; i < str.length; i++) {
+ if (str.charAt(i) != ' ' )
+ break;
+ }
+ for (k = str.length - 1; k >= i; k--) {
+ if (str.charAt(k) != ' ' ) {
+ k++;
+ break;
+ }
+ }
+
+ if (k > i)
+ newString = str.substring(i, k);
+ else
+ newString = null;
+
+ return newString;
+}
+
+function checkDate(str) {
+ var newString;
+
+ if (str.length == 15 && str.charAt(14) == 'Z') {
+ newString = str.substring(0, 4);
+ newString += '/';
+ newString += str.substring(4, 6);
+ newString += '/';
+ newString += str.substring(6, 8);
+ newString += ' ';
+ newString += str.substring(8, 10);
+ newString += ':';
+ newString += str.substring(10, 12);
+ newString += ':';
+ newString += str.substring(12, 14);
+ } else {
+ newString = str;
+ }
+
+ return newString;
+}
+
+function doSave(form) {
+ if (form.uid.value.length > 0) {
+ var trimmedList = "";
+ var uids = form.uid.value.split(',');
+
+ for (var i=0; i < uids.length; i++) {
+ if (i > 0) trimmedList += ",";
+ trimmedList += trim(uids[i]);
+ }
+ form.uid.value = trimmedList;
+ }
+ if (form.status.value.length > 0) {
+ form.status.value = trim(form.status.value);
+ }
+
+ if (form.status.value == "") {
+ alert("Enter token status");
+ } else {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ uri += "?op=save&tid="+results[0].cn;
+
+ if (results[0].tokenUserID != form.uid.value) {
+ uri += "&uid=" + form.uid.value;
+ }
+ if (results[0].tokenStatus != form.status.value) {
+ uri += "&s=" + form.status.value;
+ }
+ uri += "&m=" + results[0].modified;
+ location.href = uri;
+ }
+}
+
+function doCancel() {
+ var uri = "";
+ if (typeof(uriBase) == "undefined") {
+ uri += "/tus";
+ } else {
+ uri += uriBase;
+ }
+ location.href = uri;
+}
+
+
+
+if (typeof(results) == "undefined" || results.length == 0) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Not Found</font>\n");
+} else if (results.length > 1) {
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Found too many tokens to edit</font>\n");
+} else {
+ document.write("<BR>");
+
+ document.write("<p>\n");
+ document.write("<b>Certificate Information:</b>");
+ document.write("<p>\n");
+ document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].cn+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Serial Number:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "0x"+results[0].tokenSerial+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\"><a href=\"tus?op=show&tid=" + results[0].tokenID + "\">"+
+ results[0].tokenID+"</a></font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "User ID:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenUserID+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Key Type:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenKeyType+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Token Type:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenType+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Issuer:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenIssuer+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Subject:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenSubject+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Not Before:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].tokenNotBefore)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Not After:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].tokenNotAfter)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Status:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ results[0].tokenStatus+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Certificate:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "-----BEGIN CERTIFICATE-----<br>" +
+ breakLinesWithDots(results[0].userCertificate)+
+ "<br>" +
+ "-----END CERTIFICATE-----<br>" +
+ "</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Creation Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfCreate)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Modification Date:&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ checkDate(results[0].dateOfModify)+"</font>\n");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("</table>\n");
+ document.write("<BR>\n<HR NOSHADE SIZE=1>\n");
+
+}
+
+//-->
+</SCRIPT>
+
+</BODY>
+</HTML>
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/adminauthenticatepanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/adminauthenticatepanel.vm
new file mode 100644
index 000000000..958ac5b1a
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/adminauthenticatepanel.vm
@@ -0,0 +1,52 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="../img/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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/adminpanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/adminpanel.vm
new file mode 100644
index 000000000..af1192adc
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/adminpanel.vm
@@ -0,0 +1,237 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="../img/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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/agentauthenticatepanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/agentauthenticatepanel.vm
new file mode 100644
index 000000000..b4cd94704
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/agentauthenticatepanel.vm
@@ -0,0 +1,48 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="../img/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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/authdbpanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/authdbpanel.vm
new file mode 100644
index 000000000..f8967afd0
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/authdbpanel.vm
@@ -0,0 +1,66 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="../img/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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/cainfopanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/cainfopanel.vm
new file mode 100644
index 000000000..f53c5756e
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/cainfopanel.vm
@@ -0,0 +1,55 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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. Each Enterprise Security Client (ESC) interfaces with a TPS subsystem to request end user certificates. Consequently, to obtain these certificates, a URL to a CA that has been registered in the security domain must also be selected.
+<p>
+#if ($errorString != "")
+<img src="../img/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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/certchainpanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/certchainpanel.vm
new file mode 100644
index 000000000..382fd87a1
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/certchainpanel.vm
@@ -0,0 +1,49 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/certprettyprintpanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/certprettyprintpanel.vm
new file mode 100644
index 000000000..911b4c3c6
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/certprettyprintpanel.vm
@@ -0,0 +1,49 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/certrequestpanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/certrequestpanel.vm
new file mode 100644
index 000000000..a0610243f
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/certrequestpanel.vm
@@ -0,0 +1,225 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="../img/no-certificate.png"/></td>
+#else
+ #if ($item.getCert() == "...certificate be generated internally...")
+<td>
+ <img src="../img/no-certificate.png"/><br>
+ certificate will be generated internally
+ </td>
+ #else
+ #if ($item.getCert() == "")
+ <td>
+<img src="../img/no-certificate.png"/><br>
+ No Certificate Generated. Please import.<br>
+ </td>
+ #else
+ <td>
+<img src="../img/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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_addhsm.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_addhsm.vm
new file mode 100644
index 000000000..2884625de
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_addhsm.vm
@@ -0,0 +1,96 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="img/favicon.ico" />
+ <link rel="stylesheet" href="/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="../img/pki-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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_db.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_db.vm
new file mode 100644
index 000000000..cd87a7147
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_db.vm
@@ -0,0 +1,126 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="img/favicon.ico" />
+ <link rel="stylesheet" href="/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="../img/pki-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="../img/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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_hsm.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_hsm.vm
new file mode 100644
index 000000000..9dcb10597
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_hsm.vm
@@ -0,0 +1,176 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="img/favicon.ico" />
+ <link rel="stylesheet" href="/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="../img/pki-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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_hsmloginpanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_hsmloginpanel.vm
new file mode 100644
index 000000000..0c2f7bdac
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_hsmloginpanel.vm
@@ -0,0 +1,83 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_join.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_join.vm
new file mode 100644
index 000000000..01106cf6a
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_join.vm
@@ -0,0 +1,125 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="img/favicon.ico" />
+ <link rel="stylesheet" href="/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="../img/pki-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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_rootca.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_rootca.vm
new file mode 100644
index 000000000..daf68be24
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/config_rootca.vm
@@ -0,0 +1,113 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="img/favicon.ico" />
+ <link rel="stylesheet" href="/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="../img/pki-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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/createsubsystempanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/createsubsystempanel.vm
new file mode 100644
index 000000000..1433954e7
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/createsubsystempanel.vm
@@ -0,0 +1,91 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+#if ($systemType != "tps")
+This instance can be configured as either a new $systemname subsystem or a clone of an existing $systemname. If the cloning option is chosen, please provide the URL to an existing $systemname instance.
+#else
+This instance can be configured as a new $systemname subsystem.
+#end
+<br/>
+#if ($errorString != "")
+<img src="../img/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 URL: </th>
+ <td>https://$machineName:$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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/databasepanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/databasepanel.vm
new file mode 100644
index 000000000..c5fac4fcb
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/databasepanel.vm
@@ -0,0 +1,94 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+Please provide information to an existing Fedora Directory Server that can be used as the internal database for this instance. <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 instance needs access to a Fedora Directory Server instance to store requests and records. Each PKI instance may create its own associated internal database, or may share an existing internal database. To share an existing internal database instance, a PKI instance would only need to establish a unique distinguished name (DN) using the field entitled <b>Base DN</b> and a unique database name using the field entitled <b>Database</b>.
+</div>
+<p>
+<i>Note: If the Fedora Directory Server is at a remote host, it is highly recommended that SSL should be used.</i>
+<br/>
+#if ($errorString != "")
+<img src="../img/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+<br/>
+
+ <table class="details">
+ <tr>
+ <th>Host:</th>
+ <td><input type="text" size="40" name="host" value="$hostname" /></td>
+ </tr>
+
+ <tr>
+ <th>Port:</th>
+
+ <td><input type="text" size="40" name="port" value="$portStr" />
+<input type="CHECKBOX" NAME="secureConn">SSL
+</td>
+ </tr>
+ <tr>
+ <th>Base DN:</th>
+ <td><input type="text" size="40" name="basedn" value="$basedn" /></td>
+ </tr>
+ <tr>
+ <th>Database:</th>
+
+ <td><input type="text" size="40" name="database" value="$database" /></td>
+ </tr>
+ <tr>
+ <th>Bind DN:</th>
+ <td><input type="text" size="40" name="binddn" value="$binddn" /></td>
+ </tr>
+ <tr>
+ <th>Bind Password:</th>
+
+ <td><input type="password" size="40" name="__bindpwd" value="$bindpwd" autocomplete="off" /></td>
+ </tr>
+ </table>
+ <input type="hidden" name="display" value=$displayStr />
+
+#if ($firsttime == 'false')
+<input type="CHECKBOX" NAME="removeData">Remove the existing data from the <b>Base DN</b> shown above.<p>
+#end
+
+ <div align="right">
+ <hr />
+ &nbsp;
+ </div>
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/displaycertchain2panel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/displaycertchain2panel.vm
new file mode 100644
index 000000000..916619b81
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/displaycertchain2panel.vm
@@ -0,0 +1,41 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="../img/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/displaycertchainpanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/displaycertchainpanel.vm
new file mode 100644
index 000000000..4370cc737
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/displaycertchainpanel.vm
@@ -0,0 +1,41 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="../img/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/donepanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/donepanel.vm
new file mode 100644
index 000000000..db18fd64f
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/donepanel.vm
@@ -0,0 +1,55 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="../img/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
+#end
+#if ($systemType == "tks")
+Restart the server on the command line by typing "/etc/init.d/$instanceId restart". After performing this restart, the server should become operational.
+#else
+#if ($externalCA == "true" && $systemType == "kra")
+Restart the server on the command line by typing "/etc/init.d/$instanceId restart". Startup the administration console to add the peer CA to the Trusted Manager's Group. Make sure to add the transport certificate and connector information to the peer CA. After performing this restart, the server should become operational.
+#else
+Restart the server on the command line by typing "/etc/init.d/$instanceId
+ restart". After performing this restart, the server should become operational.
+<br/>
+Please go to the <A href="https://$host:$port">agent interface</A> page to access all of the available agent interfaces.
+<br/>
+Each Enterprise Security Client (ESC) talks to a TPS config URL for token management functions located at <A href="http://$host:$unsecurePort/cgi-bin/home/index.cgi">http://$host:$unsecurePort/cgi-bin/home/index.cgi</A>.
+<br/>
+#end
+#end
+<br/>
+To create additional instances, type "/usr/bin/pkicreate" on the command line.
+<br/>
+#if ($systemType != "tps")
+To start the administration console, type "/usr/bin/pkiconsole" on the command line.
+#end
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/drminfopanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/drminfopanel.vm
new file mode 100644
index 000000000..be777240c
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/drminfopanel.vm
@@ -0,0 +1,56 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="../img/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 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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/footer.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/footer.vm
new file mode 100644
index 000000000..3cb61244f
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/footer.vm
@@ -0,0 +1,21 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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">
+ Copyright &#169; 2002-06 Red Hat, Inc. All rights reserved. <a href="http://www.redhat.com/">http://www.redhat.com</a>
+ </div>
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/header.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/header.vm
new file mode 100644
index 000000000..b8d0e9d1a
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/header.vm
@@ -0,0 +1,23 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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-svn.fedora.redhat.com/" title="Visit pki-svn.fedora.redhat.com for more information about Dogtag products and services"><img src="../img/logo_header.gif" alt="Dogtag" width="37" height="31" id="myLogo" /></a><a href="/" title="Dogtag Network homepage">Dogtag Certificate System</a>
+ <div id="account">
+ </div>
+</div>
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/hierarchypanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/hierarchypanel.vm
new file mode 100644
index 000000000..3eddc67a8
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/hierarchypanel.vm
@@ -0,0 +1,80 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="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="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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/importadmincertpanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/importadmincertpanel.vm
new file mode 100644
index 000000000..b597db6fd
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/importadmincertpanel.vm
@@ -0,0 +1,56 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="../img/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="/ca/ee/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/ee/ca/getBySerial?serialNumber=$serialNumber&importCert=true"></iframe>
+#else
+<iframe scrolling=no frameborder=0 height=0 width=0 src="/ca/ee/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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/login.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/login.vm
new file mode 100644
index 000000000..26efabee2
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/login.vm
@@ -0,0 +1,110 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="img/favicon.ico" />
+ <link rel="stylesheet" href="/css/pki-base.css" type="text/css" />
+ </head>
+
+
+ <body><div id="wrap">
+
+#include ( "tps/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="../img/pki-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="../img/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 ( "tps/admin/console/config/footer.vm" )
+ </body>
+</html>
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/modulepanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/modulepanel.vm
new file mode 100644
index 000000000..a70200bec
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/modulepanel.vm
@@ -0,0 +1,158 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/namepanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/namepanel.vm
new file mode 100644
index 000000000..a5bddc270
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/namepanel.vm
@@ -0,0 +1,87 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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. <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="../img/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>
+ </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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/securitydomainloginpanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/securitydomainloginpanel.vm
new file mode 100644
index 000000000..811a7a36c
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/securitydomainloginpanel.vm
@@ -0,0 +1,106 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="/ca/admin/console/img/favicon.ico" />
+ <link rel="stylesheet" href="/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-svn.fedora.redhat.com/" title="Visit pki-svn.fedora.redhat.com for more information about Dogtag products and services"><img src="/ca/admin/console/img/logo_header.gif" alt="Dogtag" width="37" height="31" id="myLogo" /></a><a href="/" title="Dogtag Network homepage">Dogtag Certificate System</a>
+ <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="/ca/admin/console/img/pki-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="/ca/admin/console/img/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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/securitydomainpanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/securitydomainpanel.vm
new file mode 100644
index 000000000..a746d0160
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/securitydomainpanel.vm
@@ -0,0 +1,96 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="../img/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 URL: </th>
+ <td>https://$machineName:$https_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 URL: </th>
+ <td><input type=text size="40" name="sdomainURL" value="$sdomainURL"> (e.g. - https://hostname:port)</td>
+ </tr>
+ </table>
+<br/>
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/sidemenu.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/sidemenu.vm
new file mode 100644
index 000000000..3f6400261
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/sidemenu.vm
@@ -0,0 +1,30 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/sizepanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/sizepanel.vm
new file mode 100644
index 000000000..51486889a
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/sizepanel.vm
@@ -0,0 +1,235 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="../img/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 (2048 bits for RSA, 256 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).
+ <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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/tksinfopanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/tksinfopanel.vm
new file mode 100644
index 000000000..9580613bb
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/tksinfopanel.vm
@@ -0,0 +1,51 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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 a TKS from the list below.
+<p>
+#if ($errorString != "")
+<img src="../img/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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/topmenu.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/topmenu.vm
new file mode 100644
index 000000000..90a4ec16d
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/topmenu.vm
@@ -0,0 +1,21 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/welcomepanel.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/welcomepanel.vm
new file mode 100644
index 000000000..e69095690
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/welcomepanel.vm
@@ -0,0 +1,58 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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>
+Additionally, this wizard may also be used to clone any existing instance to achieve scalability and high-availability.
+#end
+</div>
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/wizard.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/wizard.vm
new file mode 100644
index 000000000..f8efbdb5f
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/wizard.vm
@@ -0,0 +1,144 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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="img/favicon.ico" />
+ <link rel="stylesheet" href="/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 ( "tps/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="../img/pki-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="../img/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 ( "tps/admin/console/config/footer.vm" )
+
+ </div> <!-- close content -->
+ </div> <!-- close wrap -->
+
+ </body>
+</html>
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/xml.vm b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/xml.vm
new file mode 100644
index 000000000..31ff72aa2
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/config/xml.vm
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<response>
+ $xml
+</response>
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/badge.png b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/badge.png
new file mode 100644
index 000000000..5fe0223b5
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/badge.png
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/bigrotation2.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/bigrotation2.gif
new file mode 100644
index 000000000..5bb90fd6a
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/bigrotation2.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/button-clear.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/button-clear.gif
new file mode 100644
index 000000000..336e6e5d9
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/button-clear.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/button-manage.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/button-manage.gif
new file mode 100644
index 000000000..8f2f3db5e
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/button-manage.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/button-search.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/button-search.gif
new file mode 100644
index 000000000..b015c82a9
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/button-search.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/certificate.png b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/certificate.png
new file mode 100644
index 000000000..2ea9f88bb
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/certificate.png
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/clearpixel.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/clearpixel.gif
new file mode 100644
index 000000000..ae710460b
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/clearpixel.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/favicon.ico b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/favicon.ico
new file mode 100644
index 000000000..efc1d33f4
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/favicon.ico
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_checkin.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_checkin.gif
new file mode 100644
index 000000000..cb77e9f3f
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_checkin.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_crit_update.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_crit_update.gif
new file mode 100644
index 000000000..cf3c47907
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_crit_update.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_locked.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_locked.gif
new file mode 100644
index 000000000..fa0989276
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_locked.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_reg_update.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_reg_update.gif
new file mode 100644
index 000000000..662e17a84
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_reg_update.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_up2date.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_up2date.gif
new file mode 100644
index 000000000..7f2f9d4c0
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/icon_up2date.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/id.png b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/id.png
new file mode 100644
index 000000000..2c54191e1
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/id.png
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/idkey.png b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/idkey.png
new file mode 100644
index 000000000..3e27d2d05
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/idkey.png
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/key.png b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/key.png
new file mode 100644
index 000000000..db2896248
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/key.png
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/lock.png b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/lock.png
new file mode 100644
index 000000000..56be3b755
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/lock.png
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/logo_header.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/logo_header.gif
new file mode 100644
index 000000000..20f74410e
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/logo_header.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/no-certificate.png b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/no-certificate.png
new file mode 100644
index 000000000..7d93a41c3
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/no-certificate.png
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/pki-icon-help.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/pki-icon-help.gif
new file mode 100644
index 000000000..21d9f13d6
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/pki-icon-help.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/pki-icon-home.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/pki-icon-home.gif
new file mode 100644
index 000000000..ef1726b74
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/pki-icon-home.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/pki-icon-software.gif b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/pki-icon-software.gif
new file mode 100644
index 000000000..dd64b485c
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/img/pki-icon-software.gif
Binary files differ
diff --git a/pki/linux/tps-ui/shared/docroot/tps/admin/console/js/misc.js b/pki/linux/tps-ui/shared/docroot/tps/admin/console/js/misc.js
new file mode 100644
index 000000000..da7899be2
--- /dev/null
+++ b/pki/linux/tps-ui/shared/docroot/tps/admin/console/js/misc.js
@@ -0,0 +1,31 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; 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();
+}