Previous Contents Index Next |
iPlanet Certificate Management System Command-Line Tools Guide |
Chapter 16 Security Module Database Tool
The Security Module Database Tool is a command-line utility for managing PKCS#11 module information within secmod.db files or within hardware tokens. You can use the tool to add and delete PKCS #11 modules, change passwords, set defaults, list module contents, enable or disable slots, enable or disable FIPS-140-1 compliance, and assign default providers for cryptographic operations. This tool can also create key3.db, cert7.db, and secmod.db security database files.
The tasks associated with security module database management are part of a process that typically also involves managing key databases (key3.db files) and certificate databases (cert7.db files). The key, certificate, and PKCS #11 module management process generally begins with creating the keys and key database necessary to generate and manage certificates and the certificate database.
This chapter has the following sections:
Availability
Availability
This tool is available for Solaris 2.5.1 (SunOS 5.5.1) and Windows NT 4.0.
Syntax
To run the Security Module Database Tool, type the command
where option and [arguments] are combinations of the options and arguments listed in the following section. Each command takes one option. Each option may take zero or more arguments. To see a usage string, issue the command without options.
Options and Arguments
Options specify an action. Option arguments modify an action. The options and arguments for the modutil command are defined as follows:
Table 16-1    Options and Arguments for modutil
Options
Description
Create new secmod.db, key3.db, and cert7.db files. Use the -dbdir directory argument to specify a directory. If any of these databases already exist in a specified directory, the Security Module Database Tool displays an error message.
Display basic information about the contents of the secmod.db file. Use modulename to display detailed information about a particular module and its slots and tokens.
Add the named PKCS #11 module to the database. Use this option with the -libfile, -ciphers, and -mechanisms arguments.
Add a new PKCS #11 module to the database using the named JAR file. Use this option with the -installdir and -tempdir arguments. The JAR file uses the Netscape Server PKCS #11 JAR format to identify all the files to be installed, the module's name, the mechanism flags, and the cipher flags. The JAR file should also contain any files to be installed on the target machine, including the PKCS #11 module library file and other files such as documentation. See the section JAR Installation File for information on creating the special script needed to perform an installation through a server or with the Security Module Database Tool (that is, in environments without JavaScript support).
Delete the named module. Note that you cannot delete the Netscape Communicator internal PKCS #11 module.
Change the password on the named token. If the token has not been initialized, this option initializes the password. Use this option with the -pwfile and -newpwfile arguments. In this context, the term "password" is equivalent to a personal identification number (PIN).
Specify the security mechanisms for which the named module will be a default provider. The security mechanisms are specified with the -mechanisms mechanism-list argument.
Specify the security mechanisms for which the named module will not be a default provider. The security mechanisms are specified with the -mechanisms mechanism-list argument.
Enable all slots on the named module. Use the [-slot slotname] argument to enable a specific slot.
Disable all slots on the named module. Use the [-slot slotname] argument to disable a specific slot.
Enable (true) or disable (false) FIPS-140-1 compliance for the Netscape Communicator internal module.
Disable the Security Module Database Tool's interactive prompts so it can be run from a script. Use this option only after manually testing each planned operation to check for warnings and to ensure that bypassing the prompts will cause no security lapses or loss of database integrity.
Arguments
Specify a directory in which to access or create security module database files. On Unix, the Security Module Database Tool defaults to the user's Netscape directory. Windows NT has no default directory, so -dbdir must be used to specify a directory.
Specify a path to the DLL or other library file containing the implementation of the PKCS #11 interface module that is being added to the database.
Enable specific ciphers in a module that is being added to the database. The cipher-enable-list is a colon-delimited list of cipher names. Enclose this list in quotation marks if it contains spaces. The following cipher is currently available: FORTEZZA.
Specify the security mechanisms for which a particular module will be flagged as a default provider. The mechanism-list is a colon-delimited list of mechanism names. Enclose this list in quotation marks if it contains spaces. The module becomes a default provider for the listed mechanisms when those mechanisms are enabled. If more than one module claims to be a particular mechanism's default provider, that mechanism's default provider is undefined. The following mechanisms are currently available: RSA, DSA, RC2, RC4, RC5, DES, DH, FORTEZZA, SHA1, MD5, MD2, RANDOM (for random number generation), and FRIENDLY (meaning certificates are publicly readable).
Specify the root installation directory relative to which files will be installed by the -jar JAR-file option. This directory should be one below which it is appropriate to store dynamic library files (for example, a server's root directory or the Netscape Communicator root directory).
The temporary directory is the location where temporary files will be created in the course of installation by the -jar JAR-file option. If no temporary directory is specified, the current directory will be used.
Specify a text file containing a token's existing password so that a password can be entered automatically when the -changepw tokenname option is used to change passwords.
Specify a text file containing a token's new or replacement password so that a password can be entered automatically with the -changepw tokenname option.
Specify a particular slot to be enabled or disabled with the -enable modulename or -disable modulename options.
Do not open the certificate or key databases. This has several effects:
With the -create command, only a secmod.db file will be created; cert7.db and key3.db will not be created.
With the -jar command, signatures on the JAR file will not be checked.
With the -changepw command, the password on the Netscape internal module cannot be set or changed, since this password is stored in key3.db.
Usage
The Security Module Database Tool's capabilities are grouped as follows, using these combinations of options and arguments. The options and arguments in square brackets are optional, those without square brackets are required.
Creating a set of security management database files (key3.db, cert7.db, and secmod.db):
-create
Displaying basic module information or detailed information about the contents of a given module:
-list [modulename]
Adding a PKCS #11 module, which includes setting a supporting library file, enabling ciphers, and setting default provider status for various security mechanisms:
-add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms mechanism-list]
Adding a PKCS #11 module from an existing JAR file:
-jar JAR-file -installdir root-installation-directory
[-tempdir temporary-directory]
Deleting a specific PKCS #11 module from a security module database:
-delete modulename
Initializing or changing a token's password:
-changepw tokenname [-pwfile old-password-file]
[-newpwfile new-password-file]
Setting the default provider status of various security mechanisms in an existing PKCS #11 module:
-default modulename -mechanisms mechanism-list
Clearing the default provider status of various security mechanisms in an existing PKCS #11 module:
-undefault modulename -mechanisms mechanism-list
Enabling a specific slot or all slots within a module:
-enable modulename [-slot slotname]
Disabling a specific slot or all slots within a module:
-disable modulename [-slot slotname]
Enabling or disabling FIPS-140-1 compliance within the Netscape Communicator internal module:
-fips [true | false]
Disabling interactive prompts for the Security Module Database Tool, to support scripted operation:
-force
JAR Installation File
When a JAR file is run by a server, by the Security Module Database Tool, or by any program that does not interpret JavaScript, a special information file must be included in the format described below.
This information file contains special scripting and must be declared in the JAR archive's manifest file. The script can have any name. The metainfo tag for this is Pkcs11_install_script. To declare meta-information in the manifest file, put it in a file that is passed to the Netscape Signing Tool.
Sample Script
For example, the PKCS #11 installer script could be in the file pk11install. If so, the metainfo file for the Netscape Signing Tool would include a line such as this:
+ Pkcs11_install_script: pk11install
The sample script file could contain the following:
ForwardCompatible { IRIX:6.2:mips SUNOS:5.5.1:sparc }
Platforms {
WINNT::x86 {
ModuleName { "Fortezza Module" }
ModuleFile { win32/fort32.dll }
DefaultMechanismFlags{0x0001}
DefaultCipherFlags{0x0001}
Files {
win32/setup.exe {
Executable
RelativePath { %temp%/setup.exe }
}
win32/setup.hlp {
RelativePath { %temp%/setup.hlp }
}
win32/setup.cab {
RelativePath { %temp%/setup.cab }
}
}
}
WIN95::x86 {
EquivalentPlatform {WINNT::x86}
}
SUNOS:5.5.1:sparc {
ModuleName { "Fortezza UNIX Module" }
ModuleFile { unix/fort.so }
DefaultMechanismFlags{0x0001}
CipherEnableFlags{0x0001}
Files {
unix/fort.so {
RelativePath{%root%/lib/fort.so}
AbsolutePath{/usr/local/netscape/lib/fort.so}
FilePermissions{555}
}
xplat/instr.html {
RelativePath{%root%/docs/inst.html}
AbsolutePath{/usr/local/netscape/docs/inst.html}
FilePermissions{555}
}
}
}
IRIX:6.2:mips {
EquivalentPlatform { SUNOS:5.5.1:sparc }
}
}
Script Grammar
The script file grammar is as follows:
valuelist --> value valuelist
<null>
value ---> key_value_pair
string
key_value_pair --> key { valuelist }
string --> simple_string
"complex_string"
simple_string --> [^ \t\n\""{""}"]+ (No whitespace, quotes, or braces.)
complex_string --> ([^\"\\\r\n]|(\\\")|(\\\\))+ (Quotes and backslashes must be escaped with a backslash. A complex string must not include newlines or carriage returns.)
Outside of complex strings, all white space (for example, spaces, tabs, and carriage returns) is considered equal and is used only to delimit tokens.
Keys
Keys are case-insensitive. This section discusses the following keys:
Global Keys
Per-Platform Keys
These keys have meaning only within the value list of an entry in the Platforms list.
Per-File Keys
These keys have meaning only within the value list of an entry in a Files list. At least one of RelativePath and AbsolutePath must be specified. If both are specified, the relative path is tried first, and the absolute path is used only if no relative root directory is provided by the installer program.
Creating Database Files
Creating Database Files
This example creates a set of security management database files in the specified directory:
modutil -create -dbdir c:\databases
The Security Module Database Tool displays a warning:
WARNING: Performing this operation while a Netscape product is running could cause corruption of your security databases. If a Netscape product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool displays the following:
Creating "c:\databases\key3.db"...done.
Creating "c:\databases\cert7.db"...done.
Creating "c:\databases\secmod.db"...done.
Displaying Module Information
This example gives detailed information about the specified module:
modutil -list "Netscape Internal PKCS #11 Module" -dbdir c:\databases
The Security Module Database Tool displays information similar to this:
Using database directory c:\databases...
--------------------------------------------------------
Name: Netscape Internal PKCS #11 Module
Library file: **Internal ONLY module**
Manufacturer: Netscape Communications Corp
Description: Communicator Internal Crypto Svc
PKCS #11 Version 2.0
Library Version: 4.0
Cipher Enable Flags: None
Default Mechanism Flags: RSA:DSA:RC2:RC4:DES:SHA1:MD5:MD2
Slot: Communicator Internal Cryptographic Services Version 4.0
Manufacturer: Netscape Communications Corp
Type: Software
Version Number: 4.1
Firmware Version: 0.0
Status: Enabled
Token Name: Communicator Generic Crypto Svcs
Token Manufacturer: Netscape Communications Corp
Token Model: Libsec 4.0
Token Serial Number: 0000000000000000
Token Version: 4.0
Token Firmware Version: 0.0
Access: Write Protected
Login Type: Public (no login required)
User Pin: NOT Initialized
Slot: Communicator User Private Key and Certificate Services
Manufacturer: Netscape Communications Corp
Type: Software
Version Number: 3.0
Firmware Version: 0.0
Status: Enabled
Token Name: Communicator Certificate DB
Token Manufacturer: Netscape Communications Corp
Token Model: Libsec 4.0
Token Serial Number: 0000000000000000
Token Version: 7.0
Token Firmware Version: 0.0
Access: NOT Write Protected
Login Type: Login required
User Pin: NOT Initialized
Setting a Default Provider
This example makes the specified module a default provider for the RSA, DSA, and RC2 security mechanisms:
modutil -default "Cryptographic Module" -dbdir c:\databases -mechanisms RSA:DSA:RC2
The Security Module Database Tool displays a warning:
WARNING: Performing this operation while a Netscape product is running could cause corruption of your security databases. If a Netscape product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool displays the following:
Using database directory c:\databases...
Successfully changed defaults.
Enabling a Slot
This example enables a particular slot in the specified module:
modutil -enable "Cryptographic Module" -slot "Cryptographic Reader" -dbdir c:\databases
The Security Module Database Tool displays a warning:
WARNING: Performing this operation while a Netscape product is running could cause corruption of your security databases. If a Netscape product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool displays the following:
Using database directory c:\databases...
Slot "Cryptographic Reader" enabled.
Enabling FIPS Compliance
This example enables FIPS-140-1 compliance in Communicator's internal module:
The Security Module Database Tool displays a warning:
WARNING: Performing this operation while a Netscape product is running could cause corruption of your security databases. If a Netscape product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool displays the following:
Adding a Cryptographic Module
This example adds a new cryptographic module to the database:
C:\modutil> modutil -dbdir "C:\databases" -add "Cryptorific Module" -libfile "C:\winnt\system32\crypto.dll" -mechanisms RSA:DSA:RC2:RANDOM
The Security Module Database Tool displays a warning:
WARNING: Performing this operation while a Netscape product is running could cause corruption of your security databases. If a Netscape product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool displays the following:
Using database directory C:\databases...
Module "Cryptorific Module" added to database.
C:\modutil>
Installing a Cryptographic Module from a JAR File
This example installs a cryptographic module from the following sample installation script.
Platforms {
WinNT::x86 {
ModuleName { "Cryptorific Module" }
ModuleFile { crypto.dll }
DefaultMechanismFlags{0x0000}
CipherEnableFlags{0x0000}
Files {
crypto.dll {
RelativePath{ %root%/system32/crypto.dll }
}
setup.exe {
Executable
RelativePath{ %temp%/setup.exe }
}
}
}
Win95::x86 {
EquivalentPlatform { Winnt::x86 }
}
}
To install from the script, use the following command. The root directory should be the Windows root directory (for example, c:\\windows, or c:\\winnt).
C:\modutil> modutil -dbdir "c:\databases" -jar install.jar -installdir "C:/winnt"
The Security Module Database Tool displays a warning:
WARNING: Performing this operation while a Netscape product is running could cause corruption of your security databases. If a Netscape product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool displays the following:
Using database directory c:\databases...
This installation JAR file was signed by:
----------------------------------------------
C=US, ST=California, L=Mountain View, CN=Cryptorific Inc., OU=Digital ID Class 3 - Netscape Object Signing, OU="www.verisign.com/repository/CPS Incorp. by Ref.,LIAB.LTD(c)9 6", OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing CA - Class 3 Organization, OU="VeriSign, Inc.", O=VeriSign Trust Network **ISSUER NAME**, OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing CA - Class 3 Organization, OU="VeriSign, Inc.", O=VeriSign Trust Network
----------------------------------------------
Do you wish to continue this installation? (y/n) y
Using installer script "installer_script"
Successfully parsed installation script
Current platform is WINNT::x86
Using installation parameters for platform WinNT::x86
Installed file crypto.dll to C:/winnt/system32/crypto.dll
Installed file setup.exe to ./pk11inst.dir/setup.exe
Executing "./pk11inst.dir/setup.exe"...
"./pk11inst.dir/setup.exe" executed successfully
Installed module "Cryptorific Module" into module database
Installation completed successfully
C:\modutil>
Changing the Password on a Token
This example changes the password for a token on an existing module.
C:\modutil> modutil -dbdir "c:\databases" -changepw "Communicator Certificate DB"
The Security Module Database Tool displays a warning:
WARNING: Performing this operation while a Netscape product is running could cause corruption of your security databases. If a Netscape product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool displays the following:
Using database directory c:\databases...
Enter old password:
Incorrect password, try again...
Enter old password:
Enter new password:
Re-enter new password:
Token "Communicator Certificate DB" password changed successfully.
C:\modutil>
Previous Contents Index Next
Copyright © 2002 Sun Microsystems, Inc. All rights reserved.
Last Updated October 07, 2002