tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

index.rst (30508B)


      1 .. _mozilla_projects_nss_reference_nss_tools_:_modutil:
      2 
      3 NSS tools : modutil
      4 ===================
      5 
      6 .. container::
      7 
      8   Name
      9 
     10   | modutil - Manage PKCS #11 module information within the security module
     11   | database.
     12 
     13   Synopsis
     14 
     15   modutil [options] [[arguments]]
     16 
     17   STATUS
     18 
     19   This documentation is still work in progress. Please contribute to the initial review in Mozilla
     20   NSS bug 836477[1]
     21 
     22   Description
     23 
     24   | The Security Module Database Tool, modutil, is a command-line utility
     25   | for managing PKCS #11 module information both within secmod.db files and
     26   | within hardware tokens. modutil can add and delete PKCS #11 modules,
     27   | change passwords on security databases, set defaults, list module
     28   | contents, enable or disable slots, enable or disable FIPS 140-2
     29   | compliance, and assign default providers for cryptographic operations.
     30   | This tool can also create certificate, key, and module security database
     31   | files.
     32 
     33   | The tasks associated with security module database management are part of
     34   | a process that typically also involves managing key databases and
     35   | certificate databases.
     36 
     37   Options
     38 
     39   | Running modutil always requires one (and only one) option to specify the
     40   | type of module operation. Each option may take arguments, anywhere from
     41   | none to multiple arguments.
     42 
     43   Options
     44 
     45   -add modulename
     46 
     47   | Add the named PKCS #11 module to the database. Use this option
     48   | with the -libfile, -ciphers, and -mechanisms arguments.
     49 
     50   -changepw tokenname
     51 
     52   | Change the password on the named token. If the token has not been
     53   | initialized, this option initializes the password. Use this option
     54   | with the -pwfile and -newpwfile arguments. A password is
     55   | equivalent to a personal identification number (PIN).
     56 
     57   -chkfips
     58 
     59   | Verify whether the module is in the given FIPS mode. true means to
     60   | verify that the module is in FIPS mode, while false means to
     61   | verify that the module is not in FIPS mode.
     62 
     63   -create
     64 
     65   | Create new certificate, key, and module databases. Use the -dbdir
     66   | directory argument to specify a directory. If any of these
     67   | databases already exist in a specified directory, modutil returns
     68   | an error message.
     69 
     70   -default modulename
     71 
     72   | Specify the security mechanisms for which the named module will be
     73   | a default provider. The security mechanisms are specified with the
     74   | -mechanisms argument.
     75 
     76   -delete modulename
     77 
     78   | Delete the named module. The default NSS PKCS #11 module cannot be
     79   | deleted.
     80 
     81   -disable modulename
     82 
     83   | Disable all slots on the named module. Use the -slot argument to
     84   | disable a specific slot.
     85 
     86   The internal NSS PKCS #11 module cannot be disabled.
     87 
     88   -enable modulename
     89 
     90   | Enable all slots on the named module. Use the -slot argument to
     91   | enable a specific slot.
     92 
     93   -fips [true \| false]
     94 
     95   | Enable (true) or disable (false) FIPS 140-2 compliance for the
     96   | default NSS module.
     97 
     98   -force
     99 
    100   | Disable modutil's interactive prompts so it can be run from a
    101   | script. Use this option only after manually testing each planned
    102   | operation to check for warnings and to ensure that bypassing the
    103   | prompts will cause no security lapses or loss of
    104   | database integrity.
    105 
    106   -jar JAR-file
    107 
    108   | Add a new PKCS #11 module to the database using the named JAR
    109   | file. Use this command with the -installdir and -tempdir
    110   | arguments. The JAR file uses the NSS PKCS #11 JAR format to
    111   | identify all the files to be installed, the module's name, the
    112   | mechanism flags, and the cipher flags, as well as any files to be
    113   | installed on the target machine, including the PKCS #11 module
    114   | library file and other files such as documentation. This is
    115   | covered in the JAR installation file section in the man page,
    116   | which details the special script needed to perform an installation
    117   | through a server or with modutil.
    118 
    119   -list [modulename]
    120 
    121   | Display basic information about the contents of the secmod.db
    122   | file. Specifying a modulename displays detailed information about
    123   | a particular module and its slots and tokens.
    124 
    125   -rawadd
    126 
    127   Add the module spec string to the secmod.db database.
    128 
    129   -rawlist
    130 
    131   | Display the module specs for a specified module or for all
    132   | loadable modules.
    133 
    134   -undefault modulename
    135 
    136   | Specify the security mechanisms for which the named module will
    137   | not be a default provider. The security mechanisms are specified
    138   | with the -mechanisms argument.
    139 
    140   Arguments
    141 
    142   MODULE
    143 
    144   Give the security module to access.
    145 
    146   MODULESPEC
    147 
    148   Give the security module spec to load into the security database.
    149 
    150   -ciphers cipher-enable-list
    151 
    152   | Enable specific ciphers in a module that is being added to the
    153   | database. The cipher-enable-list is a colon-delimited list of
    154   | cipher names. Enclose this list in quotation marks if it contains
    155   | spaces.
    156 
    157   -dbdir [sql:]directory
    158 
    159   | Specify the database directory in which to access or create
    160   | security module database files.
    161 
    162   | modutil supports two types of databases: the legacy security
    163   | databases (cert8.db, key3.db, and secmod.db) and new SQLite
    164   | databases (cert9.db, key4.db, and pkcs11.txt). If the prefix sql:
    165   | is not used, then the tool assumes that the given databases are in
    166   | the old format.
    167 
    168   --dbprefix prefix
    169 
    170   | Specify the prefix used on the database files, such as my\_ for
    171   | my_cert8.db. This option is provided as a special case. Changing
    172   | the names of the certificate and key databases is not recommended.
    173 
    174   -installdir root-installation-directory
    175 
    176   | Specify the root installation directory relative to which files
    177   | will be installed by the -jar option. This directory should be one
    178   | below which it is appropriate to store dynamic library files, such
    179   | as a server's root directory.
    180 
    181   -libfile library-file
    182 
    183   | Specify a path to a library file containing the implementation of
    184   | the PKCS #11 interface module that is being added to the database.
    185 
    186   -mechanisms mechanism-list
    187 
    188   | Specify the security mechanisms for which a particular module will
    189   | be flagged as a default provider. The mechanism-list is a
    190   | colon-delimited list of mechanism names. Enclose this list in
    191   | quotation marks if it contains spaces.
    192 
    193   | The module becomes a default provider for the listed mechanisms
    194   | when those mechanisms are enabled. If more than one module claims
    195   | to be a particular mechanism's default provider, that mechanism's
    196   | default provider is undefined.
    197 
    198   | modutil supports several mechanisms: RSA, DSA, RC2, RC4, RC5, AES,
    199   | DES, DH, SHA1, SHA256, SHA512, SSL, TLS, MD5, MD2, RANDOM (for
    200   | random number generation), and FRIENDLY (meaning certificates are
    201   | publicly readable).
    202 
    203   -newpwfile new-password-file
    204 
    205   | Specify a text file containing a token's new or replacement
    206   | password so that a password can be entered automatically with the
    207   | -changepw option.
    208 
    209   -nocertdb
    210 
    211   | Do not open the certificate or key databases. This has several
    212   | effects:
    213 
    214   | o With the -create command, only a module security file is
    215   | created; certificate and key databases are not created.
    216 
    217   | o With the -jar command, signatures on the JAR file are not
    218   | checked.
    219 
    220   | o With the -changepw command, the password on the NSS internal
    221   | module cannot be set or changed, since this password is
    222   | stored in the key database.
    223 
    224   -pwfile old-password-file
    225 
    226   | Specify a text file containing a token's existing password so that
    227   | a password can be entered automatically when the -changepw option
    228   | is used to change passwords.
    229 
    230   -secmod secmodname
    231 
    232   | Give the name of the security module database (like secmod.db) to
    233   | load.
    234 
    235   -slot slotname
    236 
    237   | Specify a particular slot to be enabled or disabled with the
    238   | -enable or -disable options.
    239 
    240   -string CONFIG_STRING
    241 
    242   | Pass a configuration string for the module being added to the
    243   | database.
    244 
    245   -tempdir temporary-directory
    246 
    247   | Give a directory location where temporary files are created during
    248   | the installation by the -jar option. If no temporary directory is
    249   | specified, the current directory is used.
    250 
    251   Usage and Examples
    252 
    253   Creating Database Files
    254 
    255   | Before any operations can be performed, there must be a set of security
    256   | databases available. modutil can be used to create these files. The only
    257   | required argument is the database that where the databases will be
    258   | located.
    259 
    260   modutil -create -dbdir [sql:]directory
    261 
    262   Adding a Cryptographic Module
    263 
    264   | Adding a PKCS #11 module means submitting a supporting library file,
    265   | enabling its ciphers, and setting default provider status for various
    266   | security mechanisms. This can be done by supplying all of the information
    267   | through modutil directly or by running a JAR file and install script. For
    268   | the most basic case, simply upload the library:
    269 
    270   modutil -add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms
    271   mechanism-list]
    272 
    273   For example:
    274 
    275   modutil -dbdir sql:/home/my/sharednssdb -add "Example PKCS #11 Module" -libfile "/tmp/crypto.so"
    276   -mechanisms RSA:DSA:RC2:RANDOM
    277 
    278   | Using database directory ...
    279   | Module "Example PKCS #11 Module" added to database.
    280 
    281   Installing a Cryptographic Module from a JAR File
    282 
    283   | PKCS #11 modules can also be loaded using a JAR file, which contains all
    284   | of the required libraries and an installation script that describes how to
    285   | install the module. The JAR install script is described in more detail in
    286   | [1]the section called “JAR Installation File Format”.
    287 
    288   | The JAR installation script defines the setup information for each
    289   | platform that the module can be installed on. For example:
    290 
    291   | Platforms {
    292   | Linux:5.4.08:x86 {
    293   | ModuleName { "Example PKCS #11 Module" }
    294   | ModuleFile { crypto.so }
    295   | DefaultMechanismFlags{0x0000}
    296   | CipherEnableFlags{0x0000}
    297   | Files {
    298   | crypto.so {
    299   | Path{ /tmp/crypto.so }
    300   | }
    301   | setup.sh {
    302   | Executable
    303   | Path{ /tmp/setup.sh }
    304   | }
    305   | }
    306   | }
    307   | Linux:6.0.0:x86 {
    308   | EquivalentPlatform { Linux:5.4.08:x86 }
    309   | }
    310   | }
    311 
    312   | Both the install script and the required libraries must be bundled in a
    313   | JAR file, which is specified with the -jar argument.
    314 
    315   modutil -dbdir sql:/home/mt"jar-install-filey/sharednssdb -jar install.jar -installdir
    316   sql:/home/my/sharednssdb
    317 
    318   | This installation JAR file was signed by:
    319   | ----------------------------------------------
    320 
    321   \**SUBJECT NAME*\*
    322 
    323   | C=US, ST=California, L=Mountain View, CN=Cryptorific Inc., OU=Digital ID
    324   | Class 3 - Netscape Object Signing, OU="www.verisign.com/repository/CPS
    325   | Incorp. by Ref.,LIAB.LTD(c)9 6", OU=www.verisign.com/CPS Incorp.by Ref
    326   | . LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing CA - Class 3
    327   | Organization, OU="VeriSign, Inc.", O=VeriSign Trust Network \**ISSUER
    328   | NAME**, OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97
    329   | VeriSign, OU=VeriSign Object Signing CA - Class 3 Organization,
    330   | OU="VeriSign, Inc.", O=VeriSign Trust Network
    331   | ----------------------------------------------
    332 
    333   | Do you wish to continue this installation? (y/n) y
    334   | Using installer script "installer_script"
    335   | Successfully parsed installation script
    336   | Current platform is Linux:5.4.08:x86
    337   | Using installation parameters for platform Linux:5.4.08:x86
    338   | Installed file crypto.so to /tmp/crypto.so
    339   | Installed file setup.sh to ./pk11inst.dir/setup.sh
    340   | Executing "./pk11inst.dir/setup.sh"...
    341   | "./pk11inst.dir/setup.sh" executed successfully
    342   | Installed module "Example PKCS #11 Module" into module database
    343 
    344   Installation completed successfully
    345 
    346   Adding Module Spec
    347 
    348   | Each module has information stored in the security database about its
    349   | configuration and parameters. These can be added or edited using the
    350   | -rawadd command. For the current settings or to see the format of the
    351   | module spec in the database, use the -rawlist option.
    352 
    353   modutil -rawadd modulespec
    354 
    355   Deleting a Module
    356 
    357   A specific PKCS #11 module can be deleted from the secmod.db database:
    358 
    359   modutil -delete modulename -dbdir [sql:]directory
    360 
    361   Displaying Module Information
    362 
    363   | The secmod.db database contains information about the PKCS #11 modules
    364   | that are available to an application or server to use. The list of all
    365   | modules, information about specific modules, and database configuration
    366   | specs for modules can all be viewed.
    367 
    368   To simply get a list of modules in the database, use the -list command.
    369 
    370   modutil -list [modulename] -dbdir [sql:]directory
    371 
    372   | Listing the modules shows the module name, their status, and other
    373   | associated security databases for certificates and keys. For example:
    374 
    375   modutil -list -dbdir sql:/home/my/sharednssdb
    376 
    377   | Listing of PKCS #11 Modules
    378   | -----------------------------------------------------------
    379   | 1. NSS Internal PKCS #11 Module
    380   | slots: 2 slots attached
    381   | status: loaded
    382 
    383   | slot: NSS Internal Cryptographic Services
    384   | token: NSS Generic Crypto Services
    385 
    386   | slot: NSS User Private Key and Certificate Services
    387   | token: NSS Certificate DB
    388   | -----------------------------------------------------------
    389 
    390   | Passing a specific module name with the -list returns details information
    391   | about the module itself, like supported cipher mechanisms, version
    392   | numbers, serial numbers, and other information about the module and the
    393   | token it is loaded on. For example:
    394 
    395   modutil -list "NSS Internal PKCS #11 Module" -dbdir sql:/home/my/sharednssdb
    396 
    397   | -----------------------------------------------------------
    398   | Name: NSS Internal PKCS #11 Module
    399   | Library file: \**Internal ONLY module*\*
    400   | Manufacturer: Mozilla Foundation
    401   | Description: NSS Internal Crypto Services
    402   | PKCS #11 Version 2.20
    403   | Library Version: 3.11
    404   | Cipher Enable Flags: None
    405   | Default Mechanism Flags: RSA:RC2:RC4:DES:DH:SHA1:MD5:MD2:SSL:TLS:AES
    406 
    407   | Slot: NSS Internal Cryptographic Services
    408   | Slot Mechanism Flags: RSA:RC2:RC4:DES:DH:SHA1:MD5:MD2:SSL:TLS:AES
    409   | Manufacturer: Mozilla Foundation
    410   | Type: Software
    411   | Version Number: 3.11
    412   | Firmware Version: 0.0
    413   | Status: Enabled
    414   | Token Name: NSS Generic Crypto Services
    415   | Token Manufacturer: Mozilla Foundation
    416   | Token Model: NSS 3
    417   | Token Serial Number: 0000000000000000
    418   | Token Version: 4.0
    419   | Token Firmware Version: 0.0
    420   | Access: Write Protected
    421   | Login Type: Public (no login required)
    422   | User Pin: NOT Initialized
    423 
    424   | Slot: NSS User Private Key and Certificate Services
    425   | Slot Mechanism Flags: None
    426   | Manufacturer: Mozilla Foundation
    427   | Type: Software
    428   | Version Number: 3.11
    429   | Firmware Version: 0.0
    430   | Status: Enabled
    431   | Token Name: NSS Certificate DB
    432   | Token Manufacturer: Mozilla Foundation
    433   | Token Model: NSS 3
    434   | Token Serial Number: 0000000000000000
    435   | Token Version: 8.3
    436   | Token Firmware Version: 0.0
    437   | Access: NOT Write Protected
    438   | Login Type: Login required
    439   | User Pin: Initialized
    440 
    441   | A related command, -rawlist returns information about the database
    442   | configuration for the modules. (This information can be edited by loading
    443   | new specs using the -rawadd command.)
    444 
    445   | modutil -rawlist -dbdir sql:/home/my/sharednssdb
    446   | name="NSS Internal PKCS #11 Module" parameters="configdir=. certPrefix= keyPrefix=
    447     secmod=secmod.db flags=readOnly " NSS="trustOrder=75 cipherOrder=100
    448     slotParams={0x00000001=[slotFlags=RSA,RC4,RC2,DES,DH,SHA1,MD5,MD2,SSL,TLS,AES,RANDOM askpw=any
    449     timeout=30 ] } Flags=internal,critical"
    450 
    451   Setting a Default Provider for Security Mechanisms
    452 
    453   | Multiple security modules may provide support for the same security
    454   | mechanisms. It is possible to set a specific security module as the
    455   | default provider for a specific security mechanism (or, conversely, to
    456   | prohibit a provider from supplying those mechanisms).
    457 
    458   modutil -default modulename -mechanisms mechanism-list
    459 
    460   | To set a module as the default provider for mechanisms, use the -default
    461   | command with a colon-separated list of mechanisms. The available
    462   | mechanisms depend on the module; NSS supplies almost all common
    463   | mechanisms. For example:
    464 
    465   modutil -default "NSS Internal PKCS #11 Module" -dbdir -mechanisms RSA:DSA:RC2
    466 
    467   Using database directory c:\databases...
    468 
    469   Successfully changed defaults.
    470 
    471   Clearing the default provider has the same format:
    472 
    473   modutil -undefault "NSS Internal PKCS #11 Module" -dbdir -mechanisms MD2:MD5
    474 
    475   Enabling and Disabling Modules and Slots
    476 
    477   | Modules, and specific slots on modules, can be selectively enabled or
    478   | disabled using modutil. Both commands have the same format:
    479 
    480   modutil -enable|-disable modulename [-slot slotname]
    481 
    482   For example:
    483 
    484   modutil -enable "NSS Internal PKCS #11 Module" -slot "NSS Internal Cryptographic Services "
    485   -dbdir .
    486 
    487   Slot "NSS Internal Cryptographic Services " enabled.
    488 
    489   | Be sure that the appropriate amount of trailing whitespace is after the
    490   | slot name. Some slot names have a significant amount of whitespace that
    491   | must be included, or the operation will fail.
    492 
    493   Enabling and Verifying FIPS Compliance
    494 
    495   | The NSS modules can have FIPS 140-2 compliance enabled or disabled using
    496   | modutil with the -fips option. For example:
    497 
    498   modutil -fips true -dbdir sql:/home/my/sharednssdb/
    499 
    500   FIPS mode enabled.
    501 
    502   | To verify that status of FIPS mode, run the -chkfips command with either a
    503   | true or false flag (it doesn't matter which). The tool returns the current
    504   | FIPS setting.
    505 
    506   modutil -chkfips false -dbdir sql:/home/my/sharednssdb/
    507 
    508   FIPS mode enabled.
    509 
    510   Changing the Password on a Token
    511 
    512   Initializing or changing a token's password:
    513 
    514   modutil -changepw tokenname [-pwfile old-password-file] [-newpwfile new-password-file]
    515 
    516   modutil -dbdir sql:/home/my/sharednssdb -changepw "NSS Certificate DB"
    517 
    518   | Enter old password:
    519   | Incorrect password, try again...
    520   | Enter old password:
    521   | Enter new password:
    522   | Re-enter new password:
    523   | Token "Communicator Certificate DB" password changed successfully.
    524 
    525   JAR Installation File Format
    526 
    527   | When a JAR file is run by a server, by modutil, or by any program that
    528   | does not interpret JavaScript, a special information file must be included
    529   | to install the libraries. There are several things to keep in mind with
    530   | this file:
    531 
    532   o It must be declared in the JAR archive's manifest file.
    533 
    534   o The script can have any name.
    535 
    536   | o The metainfo tag for this is Pkcs11_install_script. To declare
    537   | meta-information in the manifest file, put it in a file that is passed
    538   | to signtool.
    539 
    540   Sample Script
    541 
    542   | For example, the PKCS #11 installer script could be in the file
    543   | pk11install. If so, the metainfo file for signtool includes a line such as
    544   | this:
    545 
    546   + Pkcs11_install_script: pk11install
    547 
    548   | The script must define the platform and version number, the module name
    549   | and file, and any optional information like supported ciphers and
    550   | mechanisms. Multiple platforms can be defined in a single install file.
    551 
    552   | ForwardCompatible { IRIX:6.2:mips SUNOS:5.5.1:sparc }
    553   | Platforms {
    554   | WINNT::x86 {
    555   | ModuleName { "Example Module" }
    556   | ModuleFile { win32/fort32.dll }
    557   | DefaultMechanismFlags{0x0001}
    558   | DefaultCipherFlags{0x0001}
    559   | Files {
    560   | win32/setup.exe {
    561   | Executable
    562   | RelativePath { %temp%/setup.exe }
    563   | }
    564   | win32/setup.hlp {
    565   | RelativePath { %temp%/setup.hlp }
    566   | }
    567   | win32/setup.cab {
    568   | RelativePath { %temp%/setup.cab }
    569   | }
    570   | }
    571   | }
    572   | SUNOS:5.5.1:sparc {
    573   | ModuleName { "Example UNIX Module" }
    574   | ModuleFile { unix/fort.so }
    575   | DefaultMechanismFlags{0x0001}
    576   | CipherEnableFlags{0x0001}
    577   | Files {
    578   | unix/fort.so {
    579   | RelativePath{%root%/lib/fort.so}
    580   | AbsolutePath{/usr/local/netscape/lib/fort.so}
    581   | FilePermissions{555}
    582   | }
    583   | xplat/instr.html {
    584   | RelativePath{%root%/docs/inst.html}
    585   | AbsolutePath{/usr/local/netscape/docs/inst.html}
    586   | FilePermissions{555}
    587   | }
    588   | }
    589   | }
    590   | IRIX:6.2:mips {
    591   | EquivalentPlatform { SUNOS:5.5.1:sparc }
    592   | }
    593   | }
    594 
    595   Script Grammar
    596 
    597   | The script is basic Java, allowing lists, key-value pairs, strings, and
    598   | combinations of all of them.
    599 
    600   --> valuelist
    601 
    602   | valuelist --> value valuelist
    603   | <null>
    604 
    605   | value ---> key_value_pair
    606   | string
    607 
    608   key_value_pair --> key { valuelist }
    609 
    610   key --> string
    611 
    612   | string --> simple_string
    613   | "complex_string"
    614 
    615   simple_string --> [^ \\t\n\""{""}"]+
    616 
    617   complex_string --> ([^\"\\\r\n]|(\\\")|(\\\\))+
    618 
    619   | Quotes and backslashes must be escaped with a backslash. A complex string
    620   | must not include newlines or carriage returns.Outside of complex strings,
    621   | all white space (for example, spaces, tabs, and carriage returns) is
    622   | considered equal and is used only to delimit tokens.
    623 
    624   Keys
    625 
    626   | The Java install file uses keys to define the platform and module
    627   | information.
    628 
    629   | ForwardCompatible gives a list of platforms that are forward compatible.
    630   | If the current platform cannot be found in the list of supported
    631   | platforms, then the ForwardCompatible list is checked for any platforms
    632   | that have the same OS and architecture in an earlier version. If one is
    633   | found, its attributes are used for the current platform.
    634 
    635   | Platforms (required) Gives a list of platforms. Each entry in the list is
    636   | itself a key-value pair: the key is the name of the platform and the value
    637   | list contains various attributes of the platform. The platform string is
    638   | in the format system name:OS release:architecture. The installer obtains
    639   | these values from NSPR. OS release is an empty string on non-Unix
    640   | operating systems. NSPR supports these platforms:
    641 
    642   o AIX (rs6000)
    643 
    644   o BSDI (x86)
    645 
    646   o FREEBSD (x86)
    647 
    648   o HPUX (hppa1.1)
    649 
    650   o IRIX (mips)
    651 
    652   o LINUX (ppc, alpha, x86)
    653 
    654   o MacOS (PowerPC)
    655 
    656   o NCR (x86)
    657 
    658   o NEC (mips)
    659 
    660   o OSF (alpha)
    661 
    662   o ReliantUNIX (mips)
    663 
    664   o SCO (x86)
    665 
    666   o SOLARIS (sparc)
    667 
    668   o SONY (mips)
    669 
    670   o SUNOS (sparc)
    671 
    672   o UnixWare (x86)
    673 
    674   o WINNT (x86)
    675 
    676   For example:
    677 
    678   | IRIX:6.2:mips
    679   | SUNOS:5.5.1:sparc
    680   | Linux:2.0.32:x86
    681 
    682   | The module information is defined independently for each platform in the
    683   | ModuleName, ModuleFile, and Files attributes. These attributes must be
    684   | given unless an EquivalentPlatform attribute is specified.
    685 
    686   Per-Platform Keys
    687 
    688   | Per-platform keys have meaning only within the value list of an entry in
    689   | the Platforms list.
    690 
    691   | ModuleName (required) gives the common name for the module. This name is
    692   | used to reference the module by servers and by the modutil tool.
    693 
    694   | ModuleFile (required) names the PKCS #11 module file for this platform.
    695   | The name is given as the relative path of the file within the JAR archive.
    696 
    697   | Files (required) lists the files that need to be installed for this
    698   | module. Each entry in the file list is a key-value pair. The key is the
    699   | path of the file in the JAR archive, and the value list contains
    700   | attributes of the file. At least RelativePath or AbsolutePath must be
    701   | specified for each file.
    702 
    703   | DefaultMechanismFlags specifies mechanisms for which this module is the
    704   | default provider; this is equivalent to the -mechanism option with the
    705   | -add command. This key-value pair is a bitstring specified in hexadecimal
    706   | (0x) format. It is constructed as a bitwise OR. If the
    707   | DefaultMechanismFlags entry is omitted, the value defaults to 0x0.
    708 
    709   | RSA: 0x00000001
    710   | DSA: 0x00000002
    711   | RC2: 0x00000004
    712   | RC4: 0x00000008
    713   | DES: 0x00000010
    714   | DH: 0x00000020
    715   | FORTEZZA: 0x00000040
    716   | RC5: 0x00000080
    717   | SHA1: 0x00000100
    718   | MD5: 0x00000200
    719   | MD2: 0x00000400
    720   | RANDOM: 0x08000000
    721   | FRIENDLY: 0x10000000
    722   | OWN_PW_DEFAULTS: 0x20000000
    723   | DISABLE: 0x40000000
    724 
    725   | CipherEnableFlags specifies ciphers that this module provides that NSS
    726   | does not provide (so that the module enables those ciphers for NSS). This
    727   | is equivalent to the -cipher argument with the -add command. This key is a
    728   | bitstring specified in hexadecimal (0x) format. It is constructed as a
    729   | bitwise OR. If the CipherEnableFlags entry is omitted, the value defaults
    730   | to 0x0.
    731 
    732   | EquivalentPlatform specifies that the attributes of the named platform
    733   | should also be used for the current platform. This makes it easier when
    734   | more than one platform uses the same settings.
    735 
    736   Per-File Keys
    737 
    738   | Some keys have meaning only within the value list of an entry in a Files
    739   | list.
    740 
    741   | Each file requires a path key the identifies where the file is. Either
    742   | RelativePath or AbsolutePath must be specified. If both are specified, the
    743   | relative path is tried first, and the absolute path is used only if no
    744   | relative root directory is provided by the installer program.
    745 
    746   | RelativePath specifies the destination directory of the file, relative to
    747   | some directory decided at install time. Two variables can be used in the
    748   | relative path: %root% and %temp%. %root% is replaced at run time with the
    749   | directory relative to which files should be installed; for example, it may
    750   | be the server's root directory. The %temp% directory is created at the
    751   | beginning of the installation and destroyed at the end. The purpose of
    752   | %temp% is to hold executable files (such as setup programs) or files that
    753   | are used by these programs. Files destined for the temporary directory are
    754   | guaranteed to be in place before any executable file is run; they are not
    755   | deleted until all executable files have finished.
    756 
    757   | AbsolutePath specifies the destination directory of the file as an
    758   | absolute path.
    759 
    760   | Executable specifies that the file is to be executed during the course of
    761   | the installation. Typically, this string is used for a setup program
    762   | provided by a module vendor, such as a self-extracting setup executable.
    763   | More than one file can be specified as executable, in which case the files
    764   | are run in the order in which they are specified in the script file.
    765 
    766   | FilePermissions sets permissions on any referenced files in a string of
    767   | octal digits, according to the standard Unix format. This string is a
    768   | bitwise OR.
    769 
    770   | user read: 0400
    771   | user write: 0200
    772   | user execute: 0100
    773   | group read: 0040
    774   | group write: 0020
    775   | group execute: 0010
    776   | other read: 0004
    777   | other write: 0002
    778   | other execute: 0001
    779 
    780   | Some platforms may not understand these permissions. They are applied only
    781   | insofar as they make sense for the current platform. If this attribute is
    782   | omitted, a default of 777 is assumed.
    783 
    784   NSS Database Types
    785 
    786   | NSS originally used BerkeleyDB databases to store security information.
    787   | The last versions of these legacy databases are:
    788 
    789   o cert8.db for certificates
    790 
    791   o key3.db for keys
    792 
    793   o secmod.db for PKCS #11 module information
    794 
    795   | BerkeleyDB has performance limitations, though, which prevent it from
    796   | being easily used by multiple applications simultaneously. NSS has some
    797   | flexibility that allows applications to use their own, independent
    798   | database engine while keeping a shared database and working around the
    799   | access issues. Still, NSS requires more flexibility to provide a truly
    800   | shared security database.
    801 
    802   | In 2009, NSS introduced a new set of databases that are SQLite databases
    803   | rather than BerkleyDB. These new databases provide more accessibility and
    804   | performance:
    805 
    806   o cert9.db for certificates
    807 
    808   o key4.db for keys
    809 
    810   | o pkcs11.txt, which is listing of all of the PKCS #11 modules contained
    811   | in a new subdirectory in the security databases directory
    812 
    813   | Because the SQLite databases are designed to be shared, these are the
    814   | shared database type. The shared database type is preferred; the legacy
    815   | format is included for backward compatibility.
    816 
    817   | By default, the tools (certutil, pk12util, modutil) assume that the given
    818   | security databases follow the more common legacy type. Using the SQLite
    819   | databases must be manually specified by using the sql: prefix with the
    820   | given security directory. For example:
    821 
    822   modutil -create -dbdir sql:/home/my/sharednssdb
    823 
    824   | To set the shared database type as the default type for the tools, set the
    825   | NSS_DEFAULT_DB_TYPE environment variable to sql:
    826 
    827   export NSS_DEFAULT_DB_TYPE="sql"
    828 
    829   | This line can be added to the ~/.bashrc file to make the change
    830   | permanent.
    831 
    832   | Most applications do not use the shared database by default, but they can
    833   | be configured to use them. For example, this how-to article covers how to
    834   | configure Firefox and Thunderbird to use the new shared NSS databases:
    835 
    836   o https://wiki.mozilla.org/NSS_Shared_DB_Howto
    837 
    838   | For an engineering draft on the changes in the shared NSS databases, see
    839   | the NSS project wiki:
    840 
    841   o https://wiki.mozilla.org/NSS_Shared_DB
    842 
    843   See Also
    844 
    845   certutil (1)
    846 
    847   pk12util (1)
    848 
    849   signtool (1)
    850 
    851   | The NSS wiki has information on the new database design and how to
    852   | configure applications to use it.
    853 
    854   o https://wiki.mozilla.org/NSS_Shared_DB_Howto
    855 
    856   o https://wiki.mozilla.org/NSS_Shared_DB
    857 
    858   Additional Resources
    859 
    860   | For information about NSS and other tools related to NSS (like JSS), check
    861   | out the NSS project wiki at
    862   | [2]http://www.mozilla.org/projects/security/pki/nss/. The NSS site relates
    863   | directly to NSS code changes and releases.
    864 
    865   Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto
    866 
    867   IRC: Freenode at #dogtag-pki
    868 
    869   Authors
    870 
    871   | The NSS tools were written and maintained by developers with Netscape, Red
    872   | Hat, Sun, Oracle, Mozilla, and Google.
    873 
    874   | Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey
    875   | <dlackey@redhat.com>.
    876 
    877   License
    878 
    879   | Licensed under the Mozilla Public License, v. 2.0.
    880   | If a copy of the MPL was not distributed with this file,
    881   | You can obtain one at https://mozilla.org/MPL/2.0/.
    882 
    883   References
    884 
    885   | 1. Mozilla NSS bug 836477
    886   | https://bugzilla.mozilla.org/show_bug.cgi?id=836477
    887 
    888   | Visible links
    889   | 1. JAR Installation File Format
    890   | file:///tmp/xmlto.eUWOJ0/modutil.pro...r-install-file
    891   | 2. http://www.mozilla.org/projects/security/pki/nss/