3
- The contents of this file are subject to the Mozilla Public
4
- License Version 1.1 (the "License"); you may not use this file
5
- except in compliance with the License. You may obtain a copy of
6
- the License at http://www.mozilla.org/MPL/
8
- Software distributed under the License is distributed on an "AS
9
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10
- implied. See the License for the specific language governing
11
- rights and limitations under the License.
13
- The Original Code is the Netscape security libraries.
15
- The Initial Developer of the Original Code is Netscape
16
- Communications Corporation. Portions created by Netscape are
17
- Copyright (C) 1994-2000 Netscape Communications Corporation. All
22
- Alternatively, the contents of this file may be used under the
23
- terms of the GNU General Public License Version 2 or later (the
24
- "GPL"), in which case the provisions of the GPL are applicable
25
- instead of those above. If you wish to allow use of your
26
- version of this file only under the terms of the GPL and not to
27
- allow others to use your version of this file under the MPL,
28
- indicate your decision by deleting the provisions above and
29
- replace them with the notice and other provisions required by
30
- the GPL. If you do not delete the provisions above, a recipient
31
- may use your version of this file under either the MPL or the
34
<TITLE>MAC Installer</TITLE>
37
// Crypto Mechanism Flags
38
PKCS11_MECH_RSA_FLAG = 0x1<<0;
39
PKCS11_MECH_DSA_FLAG = 0x1<<1;
40
PKCS11_MECH_RC2_FLAG = 0x1<<2;
41
PKCS11_MECH_RC4_FLAG = 0x1<<3;
42
PKCS11_MECH_DES_FLAG = 0x1<<4;
43
PKCS11_MECH_DH_FLAG = 0x1<<5; //Diffie-Hellman
44
PKCS11_MECH_SKIPJACK_FLAG = 0x1<<6; //SKIPJACK algorithm as in Fortezza cards
45
PKCS11_MECH_RC5_FLAG = 0x1<<7;
46
PKCS11_MECH_SHA1_FLAG = 0x1<<8;
47
PKCS11_MECH_MD5_FLAG = 0x1<<9;
48
PKCS11_MECH_MD2_FLAG = 0x1<<10;
49
PKCS11_MECH_RANDOM_FLAG = 0x1<<27; //Random number generator
50
PKCS11_PUB_READABLE_CERT_FLAG = 0x1<<28; //Stored certs can be read off the token w/o logging in
51
PKCS11_DISABLE_FLAG = 0x1<<30; //tell Navigator to disable this slot by default
54
// 0x1<<11, 0x1<<12, ... , 0x1<<26, 0x1<<29, and 0x1<<31 are reserved
55
// for internal use in Navigator.
56
// Therefore, these bits should always be set to 0; otherwise,
57
// Navigator might exhibit unpredictable behavior.
59
// These flags indicate which mechanisms should be turned on by
60
pkcs11MechanismFlags = PKCS11_MECH_RANDOM_FLAG;
63
// Ciphers that support SSL or S/MIME
64
PKCS11_CIPHER_FORTEZZA_FLAG = 0x1<<0;
67
// 0x1<<1, 0x1<<2, ... , 0x1<<31 are reserved
68
// for internal use in Navigator.
69
// Therefore, these bits should ALWAYS be set to 0; otherwise,
70
// Navigator might exhibit unpredictable behavior.
72
// These flags indicate which SSL ciphers are supported
73
pkcs11CipherFlags = PKCS11_CIPHER_FORTEZZA_FLAG;
76
// Return values of pkcs11.addmodule() & pkcs11.delmodule()
78
JS_OK_ADD_MODULE = 3 // Successfully added a module
79
JS_OK_DEL_EXTERNAL_MODULE = 2 // Successfully deleted ext. module
80
JS_OK_DEL_INTERNAL_MODULE = 1 // Successfully deleted int. module
83
JS_ERR_OTHER = -1 // Other errors than the followings
84
JS_ERR_USER_CANCEL_ACTION = -2 // User abort an action
85
JS_ERR_INCORRECT_NUM_OF_ARGUMENTS= -3 // Calling a method w/ incorrect # of arguments
86
JS_ERR_DEL_MODULE = -4 // Error deleting a module
87
JS_ERR_ADD_MODULE = -5 // Error adding a module
88
JS_ERR_BAD_MODULE_NAME = -6 // The module name is invalid
89
JS_ERR_BAD_DLL_NAME = -7 // The DLL name is bad
90
JS_ERR_BAD_MECHANISM_FLAGS = -8 // The mechanism flags are invalid
91
JS_ERR_BAD_CIPHER_ENABLE_FLAGS = -9 // The SSL, S/MIME cipher flags are invalid
94
var has_new_window = 0;
96
function colonize(string) {
100
if (len == 0) return string;
103
for (i=0; i < len; i++) {
104
if (string.charAt(i) == "/") {
106
new_string = ":" + string.substring(1,len);
107
} else if (i == end) {
108
new_string = string.substring(0,i)+':';
110
new_string = string.substring(0,i)+':'+
111
string.substring(i+1,len);
117
if (string.charAt(0) == ":") string = string.substring(1,len);
121
function DoInstall(module) {
122
module = colonize(module);
123
result = pkcs11.addmodule("Netscape FORTEZZA Module", module, pkcs11MechanismFlags, pkcs11CipherFlags);
125
window.alert("New module setup failed. Error code: " + result);
127
if (has_new_window) new_window.close();
130
function DoUnpack(name) {
131
new_window = open(name,"unpacking","toolbar=no,location=no,status=yes,scrollbar=no,width=50,height=50");
135
filename=navigator.platform+".hqx"
137
default_module = "D:/dogbert/ns/dist/WIN32_D.OBJ/bin/fort32.dll"
138
document.writeln("<FORM name=instform target=_self> <H2>Mac Fortezza Installer</H2>");
139
document.writeln("<I>You must first unpack the <b>"+filename+"</b> file.");
140
document.writeln(" Do that by clicking on button below.</i><p>");
141
document.writeln("<Input type=button value=Unpack name=unpack onclick=DoUnpack(\""+filename+"\"); ><p>");
142
document.writeln("<I>Then move <b>FortPK11Lib</b> to an appropriate directory ");
143
document.writeln(" enter that directory below, then click the Install button.</i><p>");
144
document.writeln(" Module Name: <Input Type=FILE Name=module><p>");
145
document.write("<Input type=submit Name=Install Value=Install onclick=DoInstall(");
146
document.writeln( "document.instform.module.value) >");
147
document.writeln("</FORM>");