Netscape MANAGEMENT SYSTEM 6.01 - COMMAND-LINE Manual

Command-line tools guide
Table of Contents

Advertisement

Quick Links

Command-Line Tools Guide
Netscape Certificate Management System
Version 6.01
May 2002

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the NETSCAPE MANAGEMENT SYSTEM 6.01 - COMMAND-LINE and is the answer not in the manual?

Questions and answers

Summary of Contents for Netscape NETSCAPE MANAGEMENT SYSTEM 6.01 - COMMAND-LINE

  • Page 1 Command-Line Tools Guide Netscape Certificate Management System Version 6.01 May 2002...
  • Page 2 Netscape Communications Corporation ("Netscape") and its licensors retain all ownership rights to the software programs offered by Netscape (referred to herein as "Software") and related documentation. Use of the Software and related documentation is governed by the license agreement for the Software and applicable copyright law. Your right to copy this documentation is limited by copyright law.
  • Page 3: Table Of Contents

    Contents About This Guide ............. . . 7 What You Should Already Know .
  • Page 4 Starting Up the CMS 6.01 Server ............24 After Upgrading .
  • Page 5 Chapter 7 ASCII to Binary Tool ..........61 Location .
  • Page 6 Netscape Certificate Management System Command-Line Tools Guide • May 2002...
  • Page 7: About This Guide

    About This Guide The Command-Line Tools Guide describes various command-line tools or utilities that are bundled with Netscape Certificate Management System (CMS). It provides the information such as the command syntax, platform support, examples, and so on, required to use these tools. This preface has the following sections: •...
  • Page 8: What's In This Guide

    What’s in This Guide • Understand the concepts of intranet, extranet, and the Internet security and the role of digital certificates in a secure enterprise. These include the following topics: Encryption and decryption Public keys, private keys, and symmetric keys Significance of key lengths Digital signatures Digital certificates, including various types of digital certificates...
  • Page 9: Conventions Used In This Guide

    Conventions Used in This Guide • Chapter 5, “Extension Joiner Tool” Describes how to use the tool for joining MIME-64 encoded formats of certificate extensions to create a single blob. • Chapter 7, “ASCII to Binary Tool” Describes how to use the tool for converting ASCII data to its binary equivalent.
  • Page 10: Where To Go For Related Information

    Where to Go for Related Information • —Square brackets enclose commands that are optional. Example: PrettyPrintCert <input_file> [<output_file>] specifies the path to the file that contains the base-64 <input_file> encoded certificate. specifies the path to the file to write the certificate. This <output_file>...
  • Page 11 Where to Go for Related Information • is the ID for this instance of Certificate Management System <instance_id> (specified during installation). The documentation set for Certificate Management System includes the following: • Managing Servers with Netscape Console Provides background information on basic cryptography concepts and the role of Netscape Console.
  • Page 12 Where to Go for Related Information • End-Entity Help Provides detailed reference information on CMS end-entity interfaces. To access this information from the end-entity pages, click any help button. To view the HTML version of this guide, open this file: <server_root>/cert-<instance_id>/web-apps/ee/manual/ee_guide tents.htm For a complete list of CMS documentation, open the...
  • Page 13: Chapter 1 Command-Line Tools

    Chapter 1 Command-Line Tools Netscape Certificate Management System (CMS) is bundled with various command-line utilities. This chapter summarizes these utilities and provides pointers to chapters that further explain them. Table 1-1 summarizes the command-line utilities that are bundled with Certificate Management System.
  • Page 14 Summary of command-line utilities (Continued) Table 1-1 Utility/Tool Function View and manipulate the certificate database (cert7.db) and key certutil (Certificate and Key Database Tool) database (key3.db) contents. For details, check the http://www.mozilla.org/projects/security/pki/nss /tools/. site. Generates PINs for end users for directory- and PIN-based setpin (PIN Generator tool) authentication.
  • Page 15 Summary of command-line utilities (Continued) Table 1-1 Utility/Tool Function Java runtime executable for Netscape Console. bin/base/jre/bin/jre Java runtime executable for Certificate Management System. bin/cert/jre/bin/jre Note that the CMS jre is invoked as cms_daemon during CMS installation and configuration, as cms_watchdog to monitor the status of the CMS server, and as cms_server to actually run the CMS server.
  • Page 16 If you’re familar with older versions of NSS tools, notice that all Key Database Tool functions have now been incorporated into the single tool, Certificate Database Tool, and that several of the command-line options for many of the tools may have changed.
  • Page 17: Chapter 2 Cms Upgrade Utility

    Chapter 2 CMS Upgrade Utility If you have a previous installation of Netscape Certificate Management System (Certificate Management System), you can use the CMS Upgrade utility for upgrading to Certificate Management System, version 6.01. The utility enables you to upgrade from Certificate Management System version 4.2, 4.5, or 6.0 to CMS 6.01.
  • Page 18: Backing Up Your Previous Cms Instance

    Before Upgrading Backing Up Your Previous CMS Instance You must backup your existing CMS 4.2, 4.5, or 6.0 instance before you can upgrade to CMS 6.01. • For instructions to back up a CMS 4.2 or 4.5 instance, check the CMS Command-Line Tools Guide that was provided with the product;...
  • Page 19: Creating Your Previous Internal Database File In Ldif Format

    Before Upgrading Creating Your Previous Internal Database File in LDIF Format After locating your previous CMS internal database file, you need to create it in LDAP Interchange Format (LDIF) format. • Creating an LDIF File for CMS 4.2 or 4.5 Internal Database •...
  • Page 20: Normalizing Your Previous Internal Database File

    Before Upgrading The default file name is time stamped and is of the form . For example: <year>_<month>_<day>.ldif /usr/netscape/server60/slapd-firefly-db/ldif/2002_04_08_123356.l Normalizing Your Previous Internal Database File To import a CMS 4.2 or 4.5 LDIF file into a CMS 6.01 instance, you need to adjust the LDIF file by deleting the first two LDIF entries.
  • Page 21: Converting The Cms 4.5 Ldif File To A Text Format

    Upgrading cd <upgrade_tool>/TxtTo601 export SERVER_ROOT=<601_server_root> run.sh <42_txt> > <601_ldif> Converting the CMS 4.5 LDIF File to a Text Format If you are upgrading from a CMS 4.5 instance to a CMS 6.01 instance: Execute the command: 45ToTxt cd <upgrade_tool>/45ToTxt export SERVER_ROOT=<45_server_root> run.sh <45_ldif>...
  • Page 22: Installing And Configuring Cms 6.01

    Upgrading • Shutting Down the CMS 6.01 Server • Installing the Old Security Databases • Installing the Old Internal Database • Starting Up the CMS 6.01 Server Installing and Configuring CMS 6.01 Install a CMS 6.01 instance into a separate server root. Refer to the CMS Installation and Setup Guide for instructions on how to install Certificate Management System.
  • Page 23: Installing Cms 4.2 Or 4.5 Security Databases

    Upgrading Installing CMS 4.2 or 4.5 Security Databases Install your previous CMS 4.2 or 4.5 security databases by copying them to your new CMS 6.01 installation using the following commands: cp <4x_cert7> \ <601_server_root>/alias/cert-<instance_id>-<machine_name>-cert7.db cp <4x_key3> \ <601_server_root>/alias/cert-<instance_id>-<machine_name>-key3.db cp <4x_secmod> <601_server_root>/alias/secmod.db For example: cd /usr/netscape/server42/cert-firefly/config cp cert7.db \...
  • Page 24: Installing The Old Internal Database

    Upgrading Installing the Old Internal Database To install your old internal database, import your old LDIF into the CMS 6.01 internal database. (See “Normalizing Your Previous Internal Database File,” on page 20 for instructions on how to adjust your old LDIF file.) Import your adjusted CMS 4.2, 4.5, or 6.0 LDIF file into the CMS 6.01 internal database using the following commands: cd <601_server_root>/slapd-<instance_id>-db...
  • Page 25: After Upgrading

    After Upgrading ./start-slapd cd <601_server_root>/cert-<instance_id> ./start-cert After Upgrading After upgrading to CMS 6.01, access the End-Entity Services and the Agent Services interfaces of the new CMS 6.01 instance to ensure that everything is working properly. You must also log in to the CMS Console and verify that you can manage the server via the console.
  • Page 26 After Upgrading Netscape Certificate Management System Command-Line Tools Guide • May 2002...
  • Page 27: Chapter 3 Password Cache Utility

    Chapter 3 Password Cache Utility During the installation of Netscape Certificate Management System (CMS), the installation daemon stores all the passwords required by the server for starting up—such as the bind passwords used by Certificate Management System to access and update the internal LDAP database and the LDAP directory used for authentication or publishing—in a password cache.
  • Page 28: Syntax

    Syntax Syntax To run the utility, execute the following command from the directory: <server_root>/cert-<instance_id> PasswordCache <sso_password> -d <certificate/key db directory> -P <certificate/key db prefix> <command> specifies the current single sign-on password. <sso_password> specifies the path to the certificate <certificate/key db directory> database ( ) and key database ( ) files.
  • Page 29: Listing The Contents Of The Password Cache

    Usage • Changing the password associated with an entry • Deleting an entry in the cache The sections that follow explain how you can accomplish the above mentioned tasks. You must run the utility from the NOTE directory. <server_root>/cert-<instance_id> The server queries the password cache only during start up, and hence recongnizes the changes you’ve made to the cache only if you restart the server from the command line.
  • Page 30: Changing The Password Of An Entry In The Password Cache

    Usage At the prompt, enter the command below, substituting the variables with appropriate values: PasswordCache <sso_password> -d <certificate/key db directory> -P <certificate/key db prefix> add <password_name> <password> For example, assume your single sign-on password is , the CMS mySsoPwd instance name is , the host name is , the string describing the demoCA...
  • Page 31: Deleting An Entry From The Password Cache

    Usage Deleting an Entry From the Password Cache To delete an entry from the cache: Open a command window. Go to this directory: <server_root>/cert-<instance_id> At the prompt, enter the command below, substituting the variables with appropriate values: PasswordCache <sso_password> -d <certificate/key db directory> -P <certificate/key db prefix>...
  • Page 32 Usage Netscape Certificate Management System Command-Line Tools Guide • May 2002...
  • Page 33: Chapter 4 Pin Generator Tool

    Chapter 4 PIN Generator Tool For Netscape Certificate Management System (CMS) to use the authentication plug-in module named your authentication directory must UidPwdPinDirAuth contain unique PINs for each end entity to whom you intend to issue a certificate. To aid you in generating PINs for end-entity entries in a directory, Certificate Management System provides a command-line tool called the PIN Generator.
  • Page 34: The Setpin Command

    The setpin Command The setpin Command You run the PIN Generator by entering the command and its arguments in setpin a command shell and monitoring the output in the shell window. This section gives the syntax for the command and its arguments. For instructions on setpin generating PINs and storing them in your authentication directory, see section “Configuring Authentication for End-User Enrollment”...
  • Page 35 The setpin Command • ["binddn=<user_id>" bindpw=<bind_password>] specifies the user ID that has read and write permission to the <user_id> LDAP directory; the PIN Generator binds to the directory as this user. specifies the password for the user ID that has read and <bind_password>...
  • Page 36 The setpin Command • [gen=RNG-alpha | RNG-alphanum | RNG-printableascii] Use this argument to specify the type of characters for PINs. The characters in the password can be constructed out of alphabetic characters ( RNG-alpha alphanumeric characters ( ), or any printable ASCII characters RNG-alphanum printableascii •...
  • Page 37: Example

    The setpin Command For example, if you want to check PINs—that the PINs are being given to the correct users and that they are conforming to the length and character-set restrictions—before updating the directory, do not specify this option. You can check the PINs before updating the directory by looking at the output file;...
  • Page 38: How The Tool Works

    How the Tool Works How the Tool Works The Pin Generator allows you to generate PINs for user entries in an LDAP-compliant directory and update the directory with these PINs. To run the command, you need at a minimum to specify the following: setpin •...
  • Page 39 How the Tool Works Using an input and output file for the PIN-generation process Figure 4-1 Examples of output follow: Processing: cn=QA Managers,ou=employees,o=example.com Adding new pin/password dn:cn=QA Managers,ou=employees,o=example.com pin:lDWynV status:notwritten Processing: cn=PD Managers,ou=employees,o=example.com Adding new pin/password dn:cn=PD Managers,ou=employees,o=example.com pin:G69uV7 status:notwritten Because the PIN Generator makes a lot of changes to your directory, it is important that you specify the correct filter;...
  • Page 40: Input File

    How the Tool Works The output also contains the status of each entry in the directory. It can be one of the values specified in Table 4-1. PIN Generator status Table 4-1 Exit code Description Specifies that the PINs were not written to the directory, because the write notwritten option was not specified on the command line.
  • Page 41 How the Tool Works • Assume that you have set PINs for all entries in the user directory. Two new users joined your organization and you updated the directory with new users’ information. For the new users to get certificates, the directory must contain PINs.
  • Page 42: Output File

    How the Tool Works You cannot provide hashed PINs to the tool. NOTE Output File The PIN Generator can capture the output to a text file specified by the argument. output=<file_name> The captured output will contain a sequence of records and will be in the following format: dn: <user_dn>1 pin: <generated_pin>1...
  • Page 43: How Pins Are Stored In The Directory

    How the Tool Works How PINs Are Stored in the Directory Each PIN is concatenated with the corresponding user's LDAP attribute named in argument. If this argument is not specified, the DN of the user saltattribute is used. Then, this string is hashed with the hash routine specified in the hash argument (the default selection is SHA-1).
  • Page 44 How the Tool Works Exit codes returned by the PIN Generator (Continued) Table 4-2 Exit code Description Indicates an error parsing command-line arguments. Indicates that the tool could not open the input file specified by the input parameter. Indicates that the tool encountered an internal error. Indicates that the tool found a duplicate entry in the input file specified by the input parameter.
  • Page 45: Chapter 5 Extension Joiner Tool

    Chapter 5 Extension Joiner Tool Netscape Certificate Management System (CMS) provides many policy plug-in modules that enable you to add standard and custom X.509 certificate extensions to end-entity certificates the server issues. Similarly, the wizard that helps you generate the certificates required by the Certificate Manager, Registration Manager, Data Recovery Manager, and Online Certificate Status Manager enables you to select extensions that you want to include in the certificates.
  • Page 46: Location

    Location Location The ExtJoiner program is located with the rest of the command-line tools in this directory: <server_root>/bin/cert/tools Syntax To run the tool, type the following command: ExtJoiner java ExtJoiner <ext_file0> <ext_file1> ... <ext_fileN> where specifies the path, including the filename, to files that contain <ext_file>...
  • Page 47 Usage Verify that the extensions are joined correctly before adding them to a certificate request. To do this, first you’ll need to convert the binary data to ASCII format using the utility and then verify the binary data by AtoB dumping the contents of the base-64 encoded blob using the utility.
  • Page 48 Usage Netscape Certificate Management System Command-Line Tools Guide • May 2002...
  • Page 49: Chapter 6 Backing Up And Restoring Data

    Chapter 6 Backing Up and Restoring Data This chapter explains how to back up the Netscape Certificate Management System (CMS) data and configuration information and how to use the backups to restore data if there is a need. The chapter has the following sections: •...
  • Page 50: Backing Up Data

    Backing Up Data The backup and restore tools are simple Perl scripts; most Perl programmers should find no difficulty in customizing or extending them. Read this chapter to familiarize yourself with how the scripts work as well as their capabilities and limitations.
  • Page 51 Backing Up Data • Copies non-CMS certificate and key databases and shared files • Copies files required to configure the Netscape Console and Administration Server • Backs up the configuration Directory Server using that server’s backup db2bak utility (if the server is running locally) •...
  • Page 52 Backing Up Data These CMS global and local class files are Java classes for custom plug-ins used by CMS servers. To back up this data, all files and subdirectories in the following directories are backed up: • <server_root>/bin/cert/classes • <server_root>/cert-<instance_id>/classes The following CMS global configuration files, which are used for access control and the certificate mapping, are also backed up: •...
  • Page 53: What The Backup Tool Does Not Do

    Backing Up Data What the Backup Tool Does Not Do script backs up only configuration and data related to a single CMS cmsbackup server instance. You may need to back up other files to recover from a failure completely, depending on the nature of the failure. For example, if some entries in your configuration Directory Server become corrupted then the data backed up by is sufficient to restore the directory to a previous state.
  • Page 54: After You Finish A Backup

    Backing Up Data • There is plenty of disk space in the output directory; the size of the backup archive will vary with the amount of data in your system, so you will learn from experience how much space you require. The configuration that you back up, of course, will use all of your current passwords.
  • Page 55: Restoring Data

    Restoring Data Move the zip archive to another machine or removable medium. If possible, encrypt the archive (do not use the private keys stored in your CMS server’s database, since they may not be available when you need to restore the data). If you copy the archive to removable media such as tape or CD, make sure the copy is kept in a limited-access, locked area.
  • Page 56 Restoring Data You cannot restore data to a CMS instance that has not been configured. If you re-installed CMS prior to attempting to restore data, you must configure the new CMS instance. When you configure the new installation, keep the following points in mind: •...
  • Page 57: Running The Restore Tool

    Restoring Data Running the Restore Tool To run cmsrestore Log in to the machine where the CMS instance you want to restore is installed and open a command shell. Change to the CMS server instance directory in the server root. For example, if your server root is and the instance ID of the server /usr/netscape/servers...
  • Page 58 Restoring Data If you answer , no Administration Server data will be restored; proceed with the next step. If you answer , you will be asked three more questions about specific Administration Server data you want to restore: Main admin data is data in the Administration Server’s configuration directory.
  • Page 59 Restoring Data After you answer these questions, the tool stops the CMS server, restores the data, then restarts the server. You will be asked to enter the single sign-on password that unlocks the password cache when the server restarts (see section “Password Cache”...
  • Page 60 Restoring Data Netscape Certificate Management System Command-Line Tools Guide • May 2002...
  • Page 61: Chapter 7 Ascii To Binary Tool

    Chapter 7 ASCII to Binary Tool You can use the ASCII to Binary tool to convert ASCII base-64 encoded data to binary base-64 encoded data. This chapter has the following sections: • Location (page 61) • Syntax (page 61) • Example (page 62) Location The tool is located with the rest of the command-line tools in this directory:...
  • Page 62: Example

    Example Example AtoB.bat C:\test\data.in C:\test\data.out The above command takes the base-64 encoded data (in ASCII format) in the file named and writes the binary equivalent of the data to the file named data.in data.out Netscape Certificate Management System Command-Line Tools Guide • May 2002...
  • Page 63: Chapter 8 Binary To Ascii Tool

    Chapter 8 Binary to ASCII Tool You can use the Binary to ASCII tool to convert binary base-64 encoded data to ASCII base-64 encoded data. The chapter has the following sections: • Location (page 63) • Syntax (page 63) • Example (page 64) Location The tool is located with the rest of the command-line tools in this directory:...
  • Page 64: Example

    Example Example BtoA.bat C:\test\data.in C:\test\data.out The above command takes the base-64 encoded data (in binary format) in the file named and writes the ASCII equivalent of the data to the file named data.in data.out Netscape Certificate Management System Command-Line Tools Guide • May 2002...
  • Page 65: Chapter 9 Pretty Print Certificate Tool

    Chapter 9 Pretty Print Certificate Tool You can use the Pretty Print Certificate tool to print the contents of a certificate stored as ASCII base-64 encoded data in a human-readable form. The chapter has the following sections: • Location (page 65) •...
  • Page 66: Example

    Example Example PrettyPrintCert.bat C:\test\cert.in C:\test\cert.out The above command takes the ASCII base-64 encoded certificate in the file cert.in and writes the certificate in the pretty-print form to the output file named cert.out The base-64 encoded certificate (content of the file) would look similar to cert.in this: -----BEGIN CERTIFICATE-----...
  • Page 67 Example 31:F2:CA:C9:16:87:B9:AD:B8:39:69:18:CE:29:81:5F: F3:4D:97:B9:DF:B7:60:B3:00:03:16:8E:C1:F8:17:6E: 7A:D2:00:0F:7D:9B:A2:69:35:18:70:1C:7C:AE:12:2F: 0B:0F:EC:69:CD:57:6F:85:F3:3E:9D:43:64:EF:0D:5F: EF:40:FF:A6:68:FD:DD:02:03:01:00:01: Extensions: Identifier: 2.16.840.1.113730.1.1 Critical: no Value: 03:02:00:A0: Identifier: Authority Key Identifier - 2.5.29.35 Critical: no Key Identifier: EB:B5:11:8F:00:9A:1A:A6:6E:52:94:A9:74:BC:65:CF: 07:89:2A:23: Signature: Algorithm: OID.1.2.840.113549.1.1.5 - 1.2.840.113549.1.1.5 Signature: 3E:8A:A9:9B:D1:71:EE:37:0D:1F:A0:C1:00:17:53:26: 6F:EE:28:15:20:74:F6:C5:4F:B4:E7:95:3C:A2:6A:74: 92:3C:07:A8:39:12:1B:7E:C4:C7:AE:79:C8:D8:FF:1F: D5:48:D8:2E:DD:87:88:69:D5:3A:06:CA:CA:9C:9A:55: DA:A9:E8:BF:36:BC:68:6D:1F:2B:1C:26:62:7C:75:27: E2:8D:24:4A:14:9C:92:C6:F0:7A:05:A1:52:D7:CC:7D: E0:9D:6C:D8:97:3A:9C:12:8C:25:48:7F:51:59:BE:3C: 2B:30:BF:EB:0A:45:7D:A6:49:FB:E7:BE:04:05:D6:8F: Chapter 9 Pretty Print Certificate Tool...
  • Page 68 Example Netscape Certificate Management System Command-Line Tools Guide • May 2002...
  • Page 69: Chapter 10 Pretty Print Crl Tool

    Chapter 10 Pretty Print CRL Tool You can use the Pretty Print CRL tool to print the contents of a CRL stored as ASCII base-64-encoded data in a human-readable form. The chapter has the following sections: • Location (page 69) •...
  • Page 70: Example

    Example Example PrettyPrintCrl.bat C:\test\crl.in C:\test\crl.out The above command takes the ASCII base-64 encoded CRL in the file and crl.in writes the CRL in the pretty-print form to the output file named crl.out The base-64 encoded CRL (content of the file) would look similar to this: crl.in -----BEGIN CRL----- MIIBkjCBAIBATANBgkqhkiG9w0BAQQFADAsMREwDwYDVQQKEwhOZXRzY2FwZTEXMBUG...
  • Page 71 Example Serial Number: 0x11 Revocation Date: Wednesday, December 16, 1998 4:51:54 AM Extensions: Identifier: Revocation Reason - 2.5.29.21 Critical: no Reason: Key_Compromise Serial Number: 0x10 Revocation Date: Thursday, December 17, 1998 2:37:24 AM Extensions: Identifier: Revocation Reason - 2.5.29.21 Critical: no Reason: Affiliation_Changed Serial Number: 0xA Revocation Date: Wednesday, November 25, 1998 5:11:18 AM...
  • Page 72 Example Netscape Certificate Management System Command-Line Tools Guide • May 2002...
  • Page 73: Index

    Index for adding extensions to CMS certificates 45 location 13 adding Password Cache tool 27 new entries to the password cache 29 PasswordCache tool 13 ASCII to Binary tool 61 PIN Generator 33 example 62 Pretty Print Certificate 65 location 61 Pretty Print CRL 69 syntax 61 some guidelines 15...
  • Page 74 ExtJoiner tool syntax 34 example 46 where to find 33 location 46 Pretty Print Certificate tool 65 syntax 46 example 66 location 65 syntax 65 Pretty Print CRL tool 69 example 70 location 69 syntax 69 fonts used in this book 9 setpin command 34 listing contents of password cache 29...

This manual is also suitable for:

Certificate management system 6.01

Table of Contents