/security/nss/cmd/certcgi/index.html

http://github.com/zpao/v8monkey · HTML · 821 lines · 739 code · 47 blank · 35 comment · 0 complexity · f154c5b58262934dbc82de368697d677 MD5 · raw file

  1. <HTML> <!-- -*- Mode: Java; tab-width: 8 -*- -->
  2. <!-- ***** BEGIN LICENSE BLOCK *****
  3. - Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4. -
  5. - The contents of this file are subject to the Mozilla Public License Version
  6. - 1.1 (the "License"); you may not use this file except in compliance with
  7. - the License. You may obtain a copy of the License at
  8. - http://www.mozilla.org/MPL/
  9. -
  10. - Software distributed under the License is distributed on an "AS IS" basis,
  11. - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12. - for the specific language governing rights and limitations under the
  13. - License.
  14. -
  15. - The Original Code is the Netscape security libraries.
  16. -
  17. - The Initial Developer of the Original Code is
  18. - Netscape Communications Corporation.
  19. - Portions created by the Initial Developer are Copyright (C) 1994-2000
  20. - the Initial Developer. All Rights Reserved.
  21. -
  22. - Contributor(s):
  23. -
  24. - Alternatively, the contents of this file may be used under the terms of
  25. - either the GNU General Public License Version 2 or later (the "GPL"), or
  26. - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27. - in which case the provisions of the GPL or the LGPL are applicable instead
  28. - of those above. If you wish to allow use of your version of this file only
  29. - under the terms of either the GPL or the LGPL, and not to allow others to
  30. - use your version of this file under the terms of the MPL, indicate your
  31. - decision by deleting the provisions above and replace them with the notice
  32. - and other provisions required by the GPL or the LGPL. If you do not delete
  33. - the provisions above, a recipient may use your version of this file under
  34. - the terms of any one of the MPL, the GPL or the LGPL.
  35. -
  36. - ***** END LICENSE BLOCK ***** -->
  37. <HEAD>
  38. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  39. <SCRIPT LANGUAGE="JavaScript1.2">
  40. script_url = 'http://interzone.mcom.com/cgi-bin/certomatic/bin/certcgi.cgi'
  41. ext_page_ver1 =
  42. make_page_intro('Version 1 extensions', "#FFFFFF") +
  43. '<IFRAME WIDTH="100%" HEIGHT="100%" FRAMEBORDER=0 ID="ext1">' +
  44. 'Version 1 X.509 certs do not support extensions' +
  45. '</IFRAME>' +
  46. '</body></html>';
  47. num_ca = 0;
  48. your_certificate_index_label = 'Your Certificate';
  49. netscape_extensions_index_label = 'Netscape X.509 Extensions';
  50. standard_extensions_index_label = 'Standard X.509 Extensions';
  51. certifying_authorities_index_label = 'Certifying Authorities';
  52. add_sub_alt_name_index_label = 'Add Subject Alternative Name';
  53. index_list =
  54. '0, your_certificate_index_label,' +
  55. '0, netscape_extensions_index_label,' +
  56. '0, standard_extensions_index_label,' +
  57. '0, certifying_authorities_index_label';
  58. add_index_list = '';
  59. ver = 3
  60. max_pages = 13;
  61. cur_page = 1;
  62. ext_page_array = new Array(max_pages);
  63. index_label = 'Options';
  64. var main_page =
  65. make_page_intro('Your Key', "#FFFFFF") +
  66. '<IFRAME WIDTH="100%" HEIGHT="100%" FRAMEBORDER=0 ID="main" SRC="main.html">' +
  67. '</IFRAME>' +
  68. '</body></html>' ;
  69. function setSubAltNameType(form)
  70. {
  71. with(form) {
  72. if (SubAltNameRadio[0].checked) {
  73. return true;
  74. }
  75. if (SubAltNameRadio[3].checked || SubAltNameRadio[5].checked) {
  76. SubAltNameDataType.checked = true;
  77. return true;
  78. }
  79. if (SubAltNameRadio[1].checked || SubAltNameRadio[2].checked ||
  80. SubAltNameRadio[4].checked || SubAltNameRadio[6].checked ||
  81. SubAltNameRadio[7].checked || SubAltNameRadio[8].checked) {
  82. SubAltNameDataType.checked = false;
  83. return true;
  84. }
  85. }
  86. return true;
  87. }
  88. function setIssuerAltNameType(form)
  89. {
  90. with(form) {
  91. if (IssuerAltNameRadio[0].checked) {
  92. return true;
  93. }
  94. if (IssuerAltNameRadio[3].checked || IssuerAltNameRadio[5].checked) {
  95. IssuerAltNameDataType.checked = true;
  96. return true;
  97. }
  98. if (IssuerAltNameRadio[1].checked || IssuerAltNameRadio[2].checked ||
  99. IssuerAltNameRadio[4].checked || IssuerAltNameRadio[6].checked ||
  100. IssuerAltNameRadio[7].checked || IssuerAltNameRadio[8].checked) {
  101. IssuerAltNameDataType.checked = false;
  102. return true;
  103. }
  104. }
  105. return true;
  106. }
  107. function setNameConstraintNameType(form)
  108. {
  109. with(form) {
  110. if (NameConstraintRadio[0].checked) {
  111. return true;
  112. }
  113. if (NameConstraintRadio[3].checked || NameConstraintRadio[5].checked) {
  114. NameConstraintNameDataType.checked = true;
  115. return true;
  116. }
  117. if (NameConstraintRadio[1].checked || NameConstraintRadio[2].checked ||
  118. NameConstraintRadio[4].checked || NameConstraintRadio[6].checked ||
  119. NameConstraintRadio[7].checked || NameConstraintRadio[8].checked) {
  120. NameConstraintNameDataType.checked = false;
  121. return true;
  122. }
  123. }
  124. return true;
  125. }
  126. function addSubAltName(form)
  127. {
  128. with(form) {
  129. var len = SubAltNameSelect.length;
  130. var value;
  131. var i = 0;
  132. while(!(i == (SubAltNameRadio.length - 1)) &
  133. !(SubAltNameRadio[i].checked == true)) {
  134. i++;
  135. }
  136. if (i != 0) {
  137. value = SubAltNameText.value + " - " + (i + 1);
  138. } else {
  139. value = SubAltNameText.value + " - " +
  140. SubAltNameOtherNameOID.value + " - ";
  141. if (SubAltNameDataType.checked) {
  142. value += "1 - ";
  143. } else {
  144. value += "0 - ";
  145. }
  146. value += (i + 1);
  147. if (SubAltNameOtherNameOID.value == "") {
  148. alert("Other names must include an OID");
  149. return false;
  150. }
  151. }
  152. if ((SubAltNameText.value == "") | (SubAltNameRadio[i].checked != true)) {
  153. alert("Alternative Names must include values for name and name type.");
  154. } else {
  155. SubAltNameSelect.options[len] = new Option(value, value);
  156. }
  157. }
  158. return true;
  159. }
  160. function deleteSubAltName(form)
  161. {
  162. with(form) {
  163. while (SubAltNameSelect.selectedIndex >= 0) {
  164. SubAltNameSelect[SubAltNameSelect.selectedIndex] = null;
  165. }
  166. }
  167. }
  168. function addIssuerAltName(form)
  169. {
  170. with(form)
  171. {
  172. var len = IssuerAltNameSelect.length;
  173. var value;
  174. var i = 0;
  175. while(!(i == (IssuerAltNameRadio.length -1)) &
  176. !(IssuerAltNameRadio[i].checked == true)) {
  177. i++;
  178. }
  179. if (i != 0) {
  180. value = IssuerAltNameText.value + " - " + (i + 1);
  181. } else {
  182. value = IssuerAltNameText.value + " - " +
  183. IssuerAltNameOtherNameOID.value + " - ";
  184. if (IssuerAltNameDataType.checked) {
  185. value += "1 - ";
  186. } else {
  187. value += "0 - ";
  188. }
  189. value += (i + 1);
  190. if (IssuerAltNameOtherNameOID.value == "") {
  191. alert("Other names must include an OID");
  192. return false;
  193. }
  194. }
  195. if ((IssuerAltNameText.value == "") |
  196. (IssuerAltNameRadio[i].checked != true)) {
  197. alert("Alternative Names must include values for name and name type.")
  198. } else {
  199. IssuerAltNameSelect.options[len] = new Option(value, value);
  200. }
  201. }
  202. return true;
  203. }
  204. function deleteIssuerAltName(form)
  205. {
  206. with(form) {
  207. while (IssuerAltNameSelect.selectedIndex >= 0) {
  208. IssuerAltNameSelect[IssuerAltNameSelect.selectedIndex] = null;
  209. }
  210. }
  211. }
  212. function addNameConstraint(form)
  213. {
  214. with(form) {
  215. var len = NameConstraintSelect.length;
  216. var value;
  217. var i = 0;
  218. var min = NameConstraintMin.value;
  219. var max = NameConstraintMax.value;
  220. while(!(i == (NameConstraintRadio.length - 1) ) &
  221. !(NameConstraintRadio[i].checked == true)) {
  222. i++;
  223. }
  224. value = NameConstraintText.value + " - ";
  225. if (i == 0) {
  226. value += NameConstraintOtherNameOID.value + " - ";
  227. if (NameConstraintNameDataType.checked) {
  228. value += "1 - ";
  229. } else {
  230. value += "0 - ";
  231. }
  232. if (NameConstraintOtherNameOID.value == "") {
  233. alert("Other names must include an OID");
  234. return false;
  235. }
  236. }
  237. value += (i + 1) + " - ";
  238. if (NameConstraintTypeRadio[0].checked == true) {
  239. value += "p - ";
  240. } else {
  241. value += "e - ";
  242. }
  243. value += min + " - " + max;
  244. if ((min == "") | (NameConstraintText.value == "") |
  245. (NameConstraintRadio[i].checked != true)) {
  246. alert("Name Constraints must include values for minimum, name, and name type.")
  247. } else {
  248. NameConstraintSelect.options[len] = new Option(value, value);
  249. }
  250. }
  251. return true;
  252. }
  253. function deleteNameConstraint(form)
  254. {
  255. with(form) {
  256. while (NameConstraintSelect.selectedIndex >= 0) {
  257. NameConstraintSelect[NameConstraintSelect.selectedIndex] = null;
  258. }
  259. }
  260. }
  261. function submit_it()
  262. {
  263. save_cur_page(cur_page);
  264. var ver1 = (ver == 1);
  265. var ver3 = (ver == 3);
  266. var array_string;
  267. var serial = ext_page_array[0][10][0];
  268. var serial_number = ext_page_array[0][12][0];
  269. var manValidity = ext_page_array[0][19][0];
  270. var notBefore = ext_page_array[0][20][0];
  271. var notAfter = ext_page_array[0][21][0];
  272. var subject = ext_page_array[0][22][0];
  273. if (subject == "") {
  274. alert("The DN field must contain some data");
  275. return false;
  276. }
  277. if (!serial & serial_number == "") {
  278. alert("No serial number specified");
  279. return false;
  280. }
  281. if (ext_page_array[0][15][0]) {
  282. var keygen = "<keygen name=\"key\" challenge=\"foo\">";
  283. } else {
  284. switch (ext_page_array[0][17][0]) {
  285. case 2:
  286. var keygen = "<keygen keytype=\"dsa\" pqg=\"MIGdAkEAjfKklEkidqo9JXWbsGhpy+rA2Dr7jQz3y7gyTw14guXQdi/FtyEOr8Lprawyq3qsSWk9+/g3JMLsBzbuMcgCkQIVAMdzIYxzfsjumTtPLe0w9I7azpFfAkEAYm0CeDnqChNBMWOlW0y1ACmdVSKVbO/LO/8Q85nOLC5xy53l+iS6v1jlt5UhklycxC6fb0ZLCIzFcq9T5teIAg==\" name=\"key\" challenge=\"foo\">";
  287. break;
  288. case 1:
  289. var keygen = "<keygen keytype=\"dsa\" pqg=\"MIHaAmDCboVgX0+6pEeMlbwsasWDVBcJNHPKMzkq9kbCRK2U3k+tE15n+Dc2g3ZjDYr1um51e2iLC34/BwAAAAAAAAAAAAAAAAAAAAAAAAABbBhnlFN5Djmt0Mk8cdEBY5H8iPMCFMhUnFtbpjn3EyfH2DjVg3ALh7FtAmA2zWzhpeCwvOTjYnQorlXiv0WcnSiWmaC79CRYkFt5i+UEfRxwP1eNGJBVB1T+CPW6JGd4WhgsqtSf53pn5DEtv++O7lNfXyOhWhb3KaWHYIx8fuAXtioIWkWmpfEIVZA=\" name=\"key\" challenge=\"foo\">";
  290. break;
  291. case 0:
  292. var keygen = "<keygen keytype=\"dsa\" pqg=\"MIIBHAKBgId8SiiWrcdua5zbsBhPkKfFcnHBG7T/bQla7c6OixGjjmSSuq2fJLvMKa579CaxHxLZzZZXIHmAk9poRgWl2GUUkCJ68XSum8OQzDPXPsofcEdeANjw3mIAAAAAAAAAAAAAAAAAAAAAAAAIE+MkW5hguLIQqWvEVi9dMpbNu6OZAhTIA+y3TgyiwA0D8pt686ofaL1IOQKBgAiZQC6UCXztr2iXxJrAC+51gN5oX/R9Thilln9RGegsWnHrdxUOpcm5vAWp1LU8TOXtujE8kqkm3UxIRhUWQORe9IxLANAXmZJqkw9FEVHkxj6Cy9detwT2MyBzSwS6avsf7aLisgHmI/IHSeapJsQ3NQa3rikb6zRiqIV+TVa6\" name=\"key\" challenge=\"foo\">";
  293. break;
  294. }
  295. }
  296. array_string = build_array_string();
  297. hiddens = "<input type=\"hidden\" name=\"subject\" value=\'" + subject + "\'> \n" +
  298. "<input type=\"hidden\" name=\"serial-auto\" value=\"" + serial + "\"> \n" +
  299. "<input type=\"hidden\" name=\"serial_value\" value=\"" + serial_number + "\"> \n" +
  300. "<input type=\"hidden\" name=\"ver-1\" value=\"" + ver1 + "\"> \n" +
  301. "<input type=\"hidden\" name=\"ver-3\" value=\"" + ver3 + "\"> \n" +
  302. "<input type=\"hidden\" name=\"notBefore\" value=\"" + notBefore + "\"> \n" +
  303. "<input type=\"hidden\" name=\"notAfter\" value=\"" + notAfter + "\"> \n" +
  304. "<input type=\"hidden\" name=\"manValidity\" value=\"" + manValidity + "\"> \n" +
  305. array_string;
  306. var good_submit_page =
  307. '<html>' +
  308. '<BODY TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#FF0000" BGCOLOR="#FFFFFF">' +
  309. '<form method="post" action="' + script_url + '">' +
  310. 'Select size for your key:' + keygen + '</p>' +
  311. '<input type="submit"></p>' +
  312. hiddens +
  313. '</form>\n' +
  314. '</body>\n' +
  315. '</html>\n';
  316. window.frames['right'].document.write(good_submit_page);
  317. window.frames['right'].document.close();
  318. cur_page = max_pages + 1;
  319. make_left_frame(window);
  320. return false;
  321. }
  322. function build_array_string()
  323. {
  324. var pg;
  325. var array_string = '';
  326. var pages;
  327. if ((ext_page_array[3][4][0] > 0) && ext_page_array[3][3][0]) {
  328. pages = 4 + parseInt(ext_page_array[3][4][0]);
  329. } else {
  330. pages = 4;
  331. }
  332. for (pg = 1; pg < pages; pg++) {
  333. if ((pg > 1 || (ver == 3)) && (ext_page_array[pg].length > 1)) {
  334. if (pg < 4) {
  335. for (i = 0; i < ext_page_array[pg].length; i++) {
  336. if (ext_page_array[pg][i][3].indexOf("radio") == -1) {
  337. if (ext_page_array[pg][i][3].indexOf("multiple") == -1) {
  338. array_string += '<input type=\"hidden\" name=\"' +
  339. ext_page_array[pg][i][1] + '\" value=\'' +
  340. ext_page_array[pg][i][0] + '\'> \n';
  341. } else {
  342. for (k = 0; k < ext_page_array[pg][i][0].length; k++) {
  343. array_string += '<input type=\"hidden\" name=\"' +
  344. ext_page_array[pg][i][1] + k + '\" value=\'' +
  345. ext_page_array[pg][i][0][k] + '\'> \n';
  346. }
  347. }
  348. } else {
  349. array_string += '<input type=\"hidden\" name=\"' +
  350. ext_page_array[pg][i][1] + '-' +
  351. ext_page_array[pg][i][2] + '\" value=\'' +
  352. ext_page_array[pg][i][0] + '\'> \n';
  353. }
  354. }
  355. } else {
  356. for (i = 0; i < ext_page_array[pg].length; i++) {
  357. if (ext_page_array[pg][i][3].indexOf("radio") == -1) {
  358. if (ext_page_array[pg][i][3].indexOf("multiple") == -1) {
  359. array_string += '<input type=\"hidden\" name=\"' +
  360. 'CA#' + (pg - 3) + '-' +
  361. ext_page_array[pg][i][1] + '\" value=\'' +
  362. ext_page_array[pg][i][0] +'\'> \n';
  363. } else {
  364. for (k = 0; k < ext_page_array[pg][i][0].length; k++) {
  365. array_string += '<input type=\"hidden\" name=\"' +
  366. 'CA#' + (pg - 3) + '-' +
  367. ext_page_array[pg][i][1] + k + '\" value=\'' +
  368. ext_page_array[pg][i][0][k] + '\'> \n';
  369. }
  370. }
  371. } else {
  372. array_string += '<input type=\"hidden\" name=\"' +
  373. 'CA#' + (pg - 3) + '-' +
  374. ext_page_array[pg][i][1] + '-' +
  375. ext_page_array[pg][i][2] + '\" value=\'' +
  376. ext_page_array[pg][i][0] + '\'> \n';
  377. }
  378. }
  379. }
  380. }
  381. }
  382. return array_string;
  383. }
  384. function init_ext_page_array()
  385. {
  386. for (i = 0; i < max_pages; i++) {
  387. ext_page_array[i] = '';
  388. }
  389. }
  390. function ca_num_change(n,ca_form)
  391. {
  392. with(ca_form) {
  393. n = parseInt(n,10);
  394. if (caChoiceradio[2].checked) {
  395. if (n) {
  396. update_left_frame(n);
  397. } else {
  398. update_left_frame(0);
  399. }
  400. }
  401. }
  402. }
  403. function choice_change(ca_form)
  404. {
  405. with(ca_form) {
  406. if (caChoiceradio[2].checked) {
  407. ca_num_change(manCAs.value,ca_form);
  408. } else {
  409. update_left_frame(0);
  410. }
  411. }
  412. }
  413. function update_left_frame(n)
  414. {
  415. var add_string = '';
  416. for (var i = 0; i < n; i++) {
  417. var j = i + 1;
  418. add_string = add_string + ',1, \'CA #' + j + '\'';
  419. }
  420. top.add_index_list = add_string;
  421. num_ca = n;
  422. make_left_frame(window);
  423. }
  424. function set_ver1()
  425. // redraws the extensions page for version 1 certificates
  426. {
  427. ver = 1
  428. if (cur_page == 2 || cur_page == 3) {
  429. switch_right_frame(window, cur_page, cur_page);
  430. }
  431. }
  432. function set_ver3()
  433. // redraws the extensions page for version 3 certificates
  434. {
  435. ver = 3
  436. if (cur_page == 2) {
  437. switch_right_frame(window, 0, 2);
  438. } else if (cur_page == 3) {
  439. switch_right_frame(window, 0, 3);
  440. }
  441. }
  442. function reset_subject(marker, value, form)
  443. // Updates the subject field from a subordinate field
  444. {
  445. with(form) {
  446. var field_sep = '", ';
  447. var begin_index = subject.value.indexOf(marker);
  448. if (begin_index != 0 && subject.value[begin_index - 1] != ' ') {
  449. begin_index = subject.value.indexOf(marker, begin_index +1);
  450. }
  451. var end_index = subject.value.indexOf(field_sep, begin_index);
  452. if (begin_index > -1) { // is it a delete/change?
  453. if (end_index == -1) { // is it the last one (includes only one)?
  454. if (value.length > 0) { // do I have to change it?
  455. if (begin_index == 0) { // is is the only one?
  456. subject.value = marker + '"' + value + '"';
  457. } else { // it is the last of many
  458. subject.value = subject.value.substring(0,begin_index) +
  459. marker + '"' + value + '"';
  460. }
  461. } else { // must be a delete
  462. if (begin_index == 0) { // is it the only one?
  463. begin_index += 2;
  464. }
  465. subject.value = subject.value.substring(0,(begin_index - 2));
  466. }
  467. } else { // it is the first of many or a middle one
  468. if (value.length >0) { // do I have to change it?
  469. subject.value =
  470. subject.value.substring(0,(begin_index + marker.length + 1)) +
  471. value + subject.value.substring(end_index,subject.length);
  472. } else { // it is a delete
  473. subject.value = subject.value.substring(0,begin_index) +
  474. subject.value.substring((end_index + 3),subject.length);
  475. }
  476. }
  477. } else { // It is either an insert or a do nothing
  478. if (value.length > 0) { // is it an insert?
  479. if (subject.value.length == 0) { // is subject currently empty?
  480. subject.value = marker + '"' + value + '"';
  481. } else {
  482. subject.value = subject.value + ', ' + marker + '"' + value + '"';
  483. }
  484. }
  485. }
  486. }
  487. }
  488. function reset_subjectFields(form)
  489. // updates all the subordinate fields from the subject field of a form
  490. // **** move the strings to global variables, to make maintentance easier ****
  491. {
  492. update_subject_Field(form, 'CN=\"', form.name);
  493. update_subject_Field(form, 'MAIL=\"', form.email);
  494. update_subject_Field(form, 'O=\"', form.org);
  495. update_subject_Field(form, 'C=\"', form.country);
  496. update_subject_Field(form, ' L=\"', form.loc);
  497. update_subject_Field(form, 'ST=\"', form.state);
  498. update_subject_Field(form, 'E=\"', form.email);
  499. update_subject_Field(form, 'OU=\"', form.org_unit);
  500. update_subject_Field(form, 'UID=\"', form.uid);
  501. }
  502. function update_subject_Field(form, marker, update_field)
  503. //updates a single subordinate field from the subject field of a form
  504. // *** need to deal with the two types of e-mail addresses **************
  505. {
  506. with(form) {
  507. var field_sep = '", ';
  508. var begin_index = subject.value.indexOf(marker) + marker.length;
  509. var end_index = subject.value.indexOf(field_sep, begin_index);
  510. if (end_index == -1) {
  511. end_index = subject.value.indexOf('"',begin_index);
  512. }
  513. if (begin_index != (-1 + marker.length) ) {
  514. update_field.value = subject.value.substring(begin_index, end_index);
  515. } else {
  516. update_field.value = '';
  517. }
  518. }
  519. }
  520. function switch_mail(form)
  521. // **** Do I want to delete the other type of e-mail address ? ************
  522. {
  523. if (form.email_type[0].checked) {
  524. var del = 'E=';
  525. var ins = 'MAIL=';
  526. } else {
  527. var del = 'MAIL=';
  528. var ins = 'E=';
  529. }
  530. reset_subject(del, '', form);
  531. reset_subject(ins, form.email.value, form);
  532. }
  533. function make_page_intro(title, bgcolor)
  534. {
  535. var style = '<STYLE TYPE="text/css">BODY{' +
  536. 'font-family: Geneva,MS Sans Serif,Arial,Lucida,Helvetica,sans-serif;' +
  537. 'font-size: 10pt;' +
  538. '}' +
  539. 'TD{' +
  540. 'font-family: Geneva,MS Sans Serif,Arial,Lucida,Helvetica,sans-serif;' +
  541. 'font-size: 10pt;}' +
  542. '</STYLE>';
  543. if (bgcolor == null) { bgcolor = "#C0C0C0"; }
  544. return '<HTML><HEAD>' +
  545. '<TITLE>' + title + '</TITLE>' +
  546. '</HEAD>' +
  547. '<BODY TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#FF0000" ' +
  548. 'BGCOLOR="' + bgcolor + '">';
  549. }
  550. function make_left_frame(window)
  551. {
  552. with (window.frames['index']) {
  553. eval ('index_string = make_left_frame_page(cur_page, '
  554. + index_list + add_index_list + ' )');
  555. fool1 = make_page_intro(index_label, "#FFFFFF") +
  556. index_string + '</BODY></HTML>';
  557. document.write(fool1);
  558. document.close();
  559. }
  560. }
  561. function save_cur_page(page_number)
  562. {
  563. var len;
  564. var pg = page_number - 1;
  565. if (window.frames['right'].document.forms.length != 0) {
  566. with (window.frames['right'].document) {
  567. if ((page_number != 2 && page_number != 3 && page_number <= max_pages) ||
  568. ver == 3) {
  569. ext_page_array[pg] = new Array(forms[0].elements.length);
  570. for (i = 0; i < forms[0].elements.length; i++) {
  571. ext_page_array[pg][i] = new Array(4);
  572. switch (forms[0].elements[i].type) {
  573. case 'radio':
  574. case 'checkbox':
  575. ext_page_array[pg][i][0] = forms[0].elements[i].checked;
  576. break;
  577. case 'select-one':
  578. ext_page_array[pg][i][0] = forms[0].elements[i].selectedIndex;
  579. break;
  580. case 'select-multiple':
  581. len = forms[0].elements[i].options.length;
  582. ext_page_array[pg][i][0] = new Array(len);
  583. for(k = 0; k < len; k++) {
  584. ext_page_array[pg][i][0][k] = forms[0].elements[i].options[k].value;
  585. }
  586. break;
  587. default:
  588. ext_page_array[pg][i][0] = forms[0].elements[i].value;
  589. }
  590. ext_page_array[pg][i][1] = forms[0].elements[i].name;
  591. ext_page_array[pg][i][2] = forms[0].elements[i].value;
  592. ext_page_array[pg][i][3] = forms[0].elements[i].type;
  593. }
  594. }
  595. }
  596. }
  597. }
  598. function reload_form(page_number)
  599. {
  600. var j = page_number - 1;
  601. with (window.frames['right'].document) {
  602. if (((page_number < 2 || page_number > 3) || ver == 3)
  603. && page_number != 0 && (ext_page_array[j].length > 1)) {
  604. for (i = 0; i < ext_page_array[j].length; i++) {
  605. switch (forms[0].elements[i].type) {
  606. case 'radio': case 'checkbox':
  607. forms[0].elements[i].checked = ext_page_array[j][i][0];
  608. break;
  609. case 'select-one':
  610. forms[0].elements[i].selectedIndex = ext_page_array[j][i][0];
  611. break;
  612. case 'select-multiple':
  613. for (k = 0; k < ext_page_array[j][i][0].length; k++) {
  614. forms[0].elements[i].options[k] =
  615. new Option(ext_page_array[j][i][0][k],
  616. ext_page_array[j][i][0][k]);
  617. }
  618. break;
  619. default:
  620. forms[0].elements[i].value = ext_page_array[j][i][0];
  621. }
  622. }
  623. }
  624. }
  625. }
  626. function switch_right_frame(top_window, old_pane, new_pane)
  627. {
  628. var ext_page_stnd =
  629. make_page_intro(standard_extensions_index_label, "#FFFFFF") +
  630. '<IFRAME WIDTH="100%" HEIGHT="100%" FRAMEBORDER=0 ID="ext" ' +
  631. 'SRC="stnd_ext_form.html">' +
  632. '</IFRAME></body></html>';
  633. var ext_page_nscp =
  634. make_page_intro(netscape_extensions_index_label, "#FFFFFF") +
  635. '<IFRAME WIDTH="100%" HEIGHT="100%" FRAMEBORDER=0 ID="ext" ' +
  636. 'SRC="nscp_ext_form.html">' +
  637. '</IFRAME></body></html>';
  638. var ext_page_ca =
  639. make_page_intro(certifying_authorities_index_label, "#FFFFFF") +
  640. '<IFRAME WIDTH="100%" HEIGHT="100%" FRAMEBORDER=0 ID="ext" ' +
  641. 'SRC="ca.html">' +
  642. '</IFRAME></body</html>';
  643. var ext_page_ca_exp =
  644. make_page_intro('Certifying Authority Details', "#FFFFFF") +
  645. '<IFRAME WIDTH="100%" HEIGHT="100%" FRAMEBORDER=0 ID="ext" ' +
  646. 'SRC="ca_form.html">' +
  647. '</IFRAME></body></html>';
  648. if (old_pane > 0 && cur_page <= max_pages) {
  649. save_cur_page(old_pane);
  650. }
  651. cur_page = new_pane;
  652. make_left_frame(top_window);
  653. if (new_pane == 2 || new_pane == 3) {
  654. if (ver == 1) {
  655. frames['right'].document.write(ext_page_ver1);
  656. frames['right'].document.close();
  657. } else if (new_pane == 2) {
  658. frames['right'].document.write(ext_page_nscp);
  659. frames['right'].document.close();
  660. reload_form(new_pane);
  661. } else {
  662. frames['right'].document.write(ext_page_stnd);
  663. frames['right'].document.close();
  664. reload_form(new_pane);
  665. }
  666. } else if (new_pane == 4) {
  667. frames['right'].document.write(ext_page_ca);
  668. frames['right'].document.close();
  669. reload_form(new_pane);
  670. } else if (new_pane == 1) {
  671. frames['right'].document.write(main_page);
  672. frames['right'].document.close();
  673. reload_form(new_pane);
  674. } else {
  675. frames['right'].document.write(ext_page_ca_exp);
  676. frames['right'].document.close();
  677. reload_form(new_pane);
  678. }
  679. }
  680. function make_left_frame_page(selected)
  681. {
  682. var n_strings = ( make_left_frame_page.arguments.length - 1 ) / 2;
  683. var table_background;
  684. var command;
  685. var indent;
  686. var label;
  687. var ret_string = "";
  688. ret_string += '<TABLE CELLSPACING=4>';
  689. for ( var i = 1; i <= n_strings; i++ ) {
  690. if ( i == selected ) {
  691. table_background = 'BGCOLOR=#BBCCBB';
  692. } else {
  693. table_background = '';
  694. }
  695. indent = make_left_frame_page.arguments[(i*2) - 1];
  696. label = make_left_frame_page.arguments[(i*2)];
  697. if ( indent == 0 ) {
  698. ret_string += ('<TR><TD COLSPAN=2 ' + table_background + '>');
  699. } else {
  700. ret_string += ('<TR><TD>&nbsp;&nbsp;</TD><TD ' + table_background + '>');
  701. }
  702. command = "'parent.switch_right_frame(parent," + selected + "," + i + ")'";
  703. ret_string += ('<A HREF="javascript:void setTimeout(' + command + ',0)">');
  704. if ( indent == 0 ) { ret_string += "<B>"; }
  705. ret_string += label;
  706. if ( indent == 0 ) { ret_string += "</B>"; }
  707. ret_string += '</A></TD></TR>';
  708. }
  709. if (selected == (max_pages + 1)) {
  710. table_background = 'BGCOLOR=#BBCCBB';
  711. } else {
  712. table_background = '';
  713. }
  714. ret_string +=
  715. '<TR><TD COLSPAN=2 ' + table_background +
  716. '><b><A HREF="javascript:void setTimeout(\'top.submit_it()\', 0)">Finish</A></b>' +
  717. '</TD></TR>' +
  718. '<input type="submit"></form>' +
  719. '</TABLE>';
  720. return(ret_string);
  721. }
  722. function make_page(window)
  723. // Draws the initial page setup
  724. {
  725. selected = cur_page
  726. init_ext_page_array()
  727. with (window.frames['right']) {
  728. location="main.html";
  729. // document.write(main_page);
  730. // document.close();
  731. }
  732. make_left_frame(window);
  733. }
  734. </script>
  735. </HEAD>
  736. <title>Cert-O-Matic</title>
  737. <FRAMESET cols="150,*" BORDER=3 ONLOAD="make_page(window)">
  738. <FRAME SRC="about:blank" ID="index" NAME="index"
  739. MARGINWIDTH=15 MARGINHEIGHT=10 BORDER=3>
  740. <FRAME SRC="about:blank" ID="right" NAME="right"
  741. MARGINWIDTH=15 MARGINHEIGHT=10 BORDER=3>
  742. </FRAMESET>
  743. </HTML>