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
35
<title>PKCS #11 JAR Format</title>
37
<body bgcolor=white text=black link=blue vlink=purple alink=red>
38
<center><h1>PKCS #11 JAR Format</h1></center>
40
<p>PKCS #11 modules can be packaged into JAR files that support automatic
41
installation onto the filesystem and into the security module database.
42
The JAR file should contain:
44
<li>All files that will be installed onto the target machine. This will
45
include at least the PKCS #11 module library file (.DLL or .so), and
46
may also include any other file that should be installed (such as
48
<li>A script to perform the installation.
50
The script can be in one of two forms. If the JAR file is to be
51
run by Communicator (or any program that interprets Javascript), the
52
instructions will be in the form of a SmartUpdate script.
53
<a href="http://devedge/library/documentation/security/jmpkcs/">Documentation
54
</a> on creating this script can be found on DevEdge.
57
JAR file is to be run by a server, modutil, or any other program that
58
doesn't interpret Javascript, a special information file must be included
59
in the format described in this document.
61
<h2>Declaring the Script in the Manifest File</h2>
62
The script can have any name, but it must be declared in the manifest file
63
of the JAR archive. The metainfo tag for this is
64
<code>Pkcs11_install_script</code>. Meta-information is put in the manifest
65
file by putting it in a file which is passed to
66
<a href="http://developer.netscape.com/software/index_frame.html?content=signedobj/jarpack.html#signtool1.3">Signtool</a>. For example,
67
suppose the PKCS #11 installer script is in the file <code>pk11install</code>.
68
In Signtool's metainfo file, you would have a line like this:
70
+ Pkcs11_install_script: pk11install
73
<h2>Sample Script File</h2>
75
ForwardCompatible { IRIX:6.2:mips Solaris:5.5.1:sparc }
78
ModuleName { "Fortezza Module" }
79
ModuleFile { win32/fort32.dll }
80
DefaultMechanismFlags{0x0001}
81
DefaultCipherFlags{0x0001}
85
RelativePath { %temp%/setup.exe }
88
RelativePath { %temp%/setup.hlp }
91
RelativePath { %temp%/setup.cab }
96
EquivalentPlatform {WINNT::x86}
99
ModuleName { "Fortezza UNIX Module" }
100
ModuleFile { unix/fort.so }
101
DefaultMechanismFlags{0x0001}
102
CipherEnableFlags{0x0001}
105
RelativePath{%root%/lib/fort.so}
106
AbsolutePath{/usr/local/netscape/lib/fort.so}
110
RelativePath{%root%/docs/inst.html}
111
AbsolutePath{/usr/local/netscape/docs/inst.html}
117
EquivalentPlatform { Solaris:5.5.1:sparc }
124
<h2>Script File Grammar</h2>
128
<i>valuelist</i> --> <i>value</i> <i>valuelist</i>
129
<i> </i> <i><null></i>
131
<i>value</i> --> <i>key_value_pair</i>
132
<i> </i> <i>string</i>
134
<i>key_value_pair</i> --> <i>key</i> { <i>valuelist</i> }
136
<i>key</i> --> <i>string</i>
138
<i>string</i> --> <i>simple_string</i>
139
<i> </i> "<i>complex_string</i>"
141
<i>simple_string</i> --> [^ \t\n\""{""}"]+ <font size=-1><i>(no whitespace, quotes, or braces)</i></font>
143
<i>complex_string</i> --> ([^\"\\\r\n]|(\\\")|(\\\\))+ <font size=-1><i>(quotes and backslashes must be escaped with a backslash, no newlines or carriage returns are allowed in the string)</i></font>
145
Outside of complex strings, all whitespace (space, tab, newline) is considered
146
equal and is used only to delimit tokens.
151
Keys are case-insensitive.
154
<dt><code>ForwardCompatible</code>
155
<dd>Gives a list of platforms that are forward compatible. If the current
156
platform cannot be found in the list of supported platforms, then the
157
ForwardCompatible list will be checked for any platforms that have the same
158
OS and architecture and an earlier version. If one is found, its
159
attributes will be used for the current platform.
160
<dt><code>Platforms</code> (<i>required</i>)
161
<dd>Gives a list of platforms. Each entry in the list is itself a key-value
163
the key is the name of the platform, and the valuelist contains various
164
attributes of the platform. The ModuleName, ModuleFile, and Files attributes
165
must be specified, unless an EquivalentPlatform attribute is specified.
166
The platform string is in the following
167
format: <u><i>system name</i></u>:<u><i>os release</i></u>:<u><i>architecture</i></u>. The installer
168
will obtain these values from NSPR. <u><i>os release</i></u> is an empty
169
string on non-UNIX operating systems. The following system names and platforms
170
are currently defined by NSPR:<code>
177
<li>LINUX (ppc, alpha, x86)
178
<li>MacOS (PowerPC) </code>(<i>Note: NSPR actually defines the OS as
179
"</i><code>Mac OS</code><i>". The
180
space makes the name unsuitable for being embedded in identifiers. Until
181
NSPR changes, you will have to add some special code to deal with this case.
187
<li>ReliantUNIX (mips)
198
Examples of valid platform strings: <code>IRIX:6.2:mips, Solaris:5.5.1:sparc,
199
Linux:2.0.32:x86, WIN95::x86</code>.
202
<h3>Per-Platform Keys</h3>
203
These keys only have meaning within the value list of an entry in
204
the <code>Platforms</code> list.
206
<dt><code>ModuleName</code> (<i>required</i>)
207
<dd>Gives the common name for the module. This name will be used to
208
reference the module from Communicator, modutil, servers, or any other
209
program that uses the Netscape security module database.
210
<dt><code>ModuleFile</code> (<i>required</i>)
211
<dd>Names the PKCS #11 module file (DLL or .so) for this platform. The name
212
is given as the relative path of the file within the JAR archive.
213
<dt><code>Files</code> (<i>required</i>)
214
<dd>Lists the files that should be installed for this module. Each entry
215
in the file list is a key-value pair: the key is the path of the file in
217
the valuelist contains attributes of the file. At least RelativePath and
218
AbsoluteDir must be specified in this valuelist.
219
<dt><code>DefaultMechanismFlags</code>
220
<dd>This key-value pair specifies
221
of which mechanisms this module will be a default provider. It is a bitstring
222
specified in hexadecimal (0x) format. It is constructed as a bitwise OR
223
of the following constants. If the <code>DefaultMechanismFlags</code>
224
entry is omitted, the value will default to 0x0.
232
FORTEZZA: 0x0000 0040
238
FRIENDLY: 0x1000 0000
239
OWN_PW_DEFAULTS: 0x2000 0000
242
<dt><code>CipherEnableFlags</code>
243
<dd>This key-value pair specifies
244
which SSL ciphers will be enabled. It is a bitstring specified in
245
hexadecimal (0x) format. It is constructed as a bitwise OR of the following
246
constants. If the <code>CipherEnableFlags</code> entry is omitted, the
247
value will default to 0x0.
249
FORTEZZA: 0x0000 0001
251
<dt><code>EquivalentPlatform</code>
252
<dd>Specifies that the attributes of the named platform should also be used
253
for the current platform. Saves typing when there is more than one platform
254
that uses the same settings.
257
<h3>Per-File Keys</h3>
258
These keys only have meaning within the valuelist of an entry in a
259
<code>Files</code> list. At least one of <code>RelativePath</code> and
260
<code>AbsolutePath</code> must be specified. If both are specified, the
261
relative path will be tried first and the absolute path used only if no
262
relative root directory is provided by the installer program.
264
<dt><code>RelativePath</code>
265
<dd>Specifies the destination directory of the file, relative to some directory
266
decided at install-time. Two variables can be used in the relative
267
path, "%root%" and "%temp%". "%root%" will be replaced at run-time with
268
the directory relative to which files should be installed; for
269
example, it may be the server's root directory or Communicator's root
270
directory. "%temp%" is a directory that will be created at the beginning
271
of the installation and destroyed at the end of the installation. Its purpose
272
is to hold executable files (such as setup programs), or files that are
273
used by these programs. For example, a Windows installation might consist
274
of a <code>setup.exe</code> installation program, a help file, and a .cab file
275
containing compressed information. All these files could be installed into the
276
temporary directory. Files destined for the temporary directory are guaranteed
277
to be in place before any executable file is run, and will not be deleted
278
until all executable files have finished.
279
<dt><code>AbsoluteDir</code>
280
<dd>Specifies the destination directory of the file as an absolute path.
281
This will only be used if the installer is unable to determine a
283
<dt><code>Executable</code>
284
<dd>This string specifies that the file is to be executed during the
286
installation. Typically this would be used for a setup program provided
287
by a module vendor, such as a self-extracting <code>setup.exe</code>.
288
More than one file can be specified as executable, in which case they will
289
be run in the order they are specified in the script file.
290
<dt><code>FilePermissions</code>
291
<dd>This string is interpreted as a string of octal digits, according to the
292
standard UNIX format. It is a bitwise OR of the following constants:
304
Some platforms may not understand these permissions. They will only be
305
applied insofar as makes sense for the current platform. If this attribute
306
is omitted, a default of 777 is assumed.