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