~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/security/nss/cmd/modutil/pk11jar.html

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<!-- 
 
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/
 
7
   - 
 
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.
 
12
   - 
 
13
   - The Original Code is the Netscape security libraries.
 
14
   - 
 
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
 
18
   - Rights Reserved.
 
19
   - 
 
20
   - Contributor(s):
 
21
   - 
 
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
 
32
   - GPL.
 
33
  -->
 
34
<head>
 
35
<title>PKCS #11 JAR Format</title>
 
36
</head>
 
37
<body bgcolor=white text=black link=blue vlink=purple alink=red>
 
38
<center><h1>PKCS #11 JAR Format</h1></center>
 
39
 
 
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:
 
43
<ul>
 
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
 
47
documentation).
 
48
<li>A script to perform the installation.
 
49
</ul>
 
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.
 
55
 
 
56
<p>If the
 
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.
 
60
 
 
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:
 
69
<blockquote><pre>
 
70
+ Pkcs11_install_script: pk11install
 
71
</pre></blockquote>
 
72
 
 
73
<h2>Sample Script File</h2>
 
74
<blockquote><pre>
 
75
ForwardCompatible { IRIX:6.2:mips Solaris:5.5.1:sparc }
 
76
Platforms {
 
77
        WINNT::x86 {
 
78
                ModuleName { "Fortezza Module" }
 
79
                ModuleFile { win32/fort32.dll }
 
80
                DefaultMechanismFlags{0x0001}
 
81
                DefaultCipherFlags{0x0001}
 
82
                Files {
 
83
                        win32/setup.exe {
 
84
                                Executable
 
85
                                RelativePath { %temp%/setup.exe }
 
86
                        }
 
87
                        win32/setup.hlp {
 
88
                                RelativePath { %temp%/setup.hlp }
 
89
                        }
 
90
                        win32/setup.cab {
 
91
                                RelativePath { %temp%/setup.cab }
 
92
                        }
 
93
                }
 
94
        }
 
95
        WIN95::x86 {
 
96
                EquivalentPlatform {WINNT::x86}
 
97
        }
 
98
        Solaris:5.5.1:sparc {
 
99
                ModuleName { "Fortezza UNIX Module" }
 
100
                ModuleFile { unix/fort.so }
 
101
                DefaultMechanismFlags{0x0001}
 
102
                CipherEnableFlags{0x0001}
 
103
                Files {
 
104
                        unix/fort.so {
 
105
                                RelativePath{%root%/lib/fort.so}
 
106
                                AbsolutePath{/usr/local/netscape/lib/fort.so}
 
107
                                FilePermissions{555}
 
108
                        }
 
109
                        xplat/instr.html {
 
110
                                RelativePath{%root%/docs/inst.html}
 
111
                                AbsolutePath{/usr/local/netscape/docs/inst.html}
 
112
                                FilePermissions{555}
 
113
                        }
 
114
                }
 
115
        }
 
116
        IRIX:6.2:mips {
 
117
                EquivalentPlatform { Solaris:5.5.1:sparc }
 
118
        }
 
119
}
 
120
</pre></blockquote>
 
121
 
 
122
<hr>
 
123
 
 
124
<h2>Script File Grammar</h2>
 
125
<blockquote><pre>
 
126
--> <i>valuelist</i>
 
127
 
 
128
<i>valuelist</i> --> <i>value</i> <i>valuelist</i>
 
129
<i>         </i>     <i>&lt;null&gt;</i>
 
130
 
 
131
<i>value</i> --> <i>key_value_pair</i>
 
132
<i>     </i>     <i>string</i>
 
133
 
 
134
<i>key_value_pair</i> --> <i>key</i> { <i>valuelist</i> }
 
135
 
 
136
<i>key</i> --> <i>string</i>
 
137
 
 
138
<i>string</i> --> <i>simple_string</i>
 
139
<i>      </i>     "<i>complex_string</i>"
 
140
 
 
141
<i>simple_string</i> --> [^ \t\n\""{""}"]+ <font size=-1><i>(no whitespace, quotes, or braces)</i></font>
 
142
 
 
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>
 
144
</pre></blockquote>
 
145
Outside of complex strings, all whitespace (space, tab, newline) is considered
 
146
equal and is used only to delimit tokens. 
 
147
 
 
148
<hr>
 
149
 
 
150
<h2>Keys</h2>
 
151
Keys are case-insensitive.
 
152
<h3>Global Keys</h3>
 
153
<dl>
 
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
 
162
pair:
 
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>
 
171
<ul>
 
172
<li>AIX (rs6000)
 
173
<li>BSDI (x86)
 
174
<li>FREEBSD (x86)
 
175
<li>HPUX (hppa1.1)
 
176
<li>IRIX (mips)
 
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.
 
182
</i>)<code>
 
183
<li>NCR (x86)
 
184
<li>NEC (mips)
 
185
<li>OS2 (x86)
 
186
<li>OSF (alpha)
 
187
<li>ReliantUNIX (mips)
 
188
<li>SCO (x86)
 
189
<li>SOLARIS (sparc)
 
190
<li>SONY (mips)
 
191
<li>SUNOS (sparc)
 
192
<li>UnixWare (x86)
 
193
<li>WIN16 (x86)
 
194
<li>WIN95 (x86)
 
195
<li>WINNT (x86)
 
196
</ul>
 
197
</code>
 
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>.
 
200
</dl>
 
201
 
 
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.
 
205
<dl>
 
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
 
216
the JAR archive, and 
 
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.
 
225
<blockquote><pre>
 
226
RSA:                    0x0000 0001
 
227
DSA:                    0x0000 0002
 
228
RC2:                    0x0000 0004
 
229
RC4:                    0x0000 0008
 
230
DES:                    0x0000 0010
 
231
DH:                     0x0000 0020
 
232
FORTEZZA:               0x0000 0040
 
233
RC5:                    0x0000 0080
 
234
SHA1:                   0x0000 0100
 
235
MD5:                    0x0000 0200
 
236
MD2:                    0x0000 0400
 
237
RANDOM:                 0x0800 0000
 
238
FRIENDLY:               0x1000 0000
 
239
OWN_PW_DEFAULTS:        0x2000 0000
 
240
DISABLE:                0x4000 0000
 
241
</pre></blockquote>
 
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.
 
248
<blockquote><pre>
 
249
FORTEZZA:               0x0000 0001
 
250
</pre></blockquote>
 
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.
 
255
</dl>
 
256
 
 
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.
 
263
<dl>
 
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
 
282
relative directory.
 
283
<dt><code>Executable</code>
 
284
<dd>This string specifies that the file is to be executed during the
 
285
course of 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:
 
293
<blockquote><pre>
 
294
user read:         400
 
295
user write:        200
 
296
user execute:      100
 
297
group read:        040
 
298
group write:       020
 
299
group execute:     010
 
300
other read:        004
 
301
other write:       002
 
302
other execute:     001
 
303
</pre></blockquote>
 
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.
 
307
 
 
308
</body>
 
309
</html>