Complete Contents
About This Guide
PART 1: Netscape Certificate Management System
Chapter 1: Introduction to Certificate Management System
Chapter 2: Administration Tasks and Tool
Chapter 3: Configuration
PART 2: Managing Certificate Management System
Chapter 4: Installing and Uninstalling Instances
Chapter 5: Starting and Stopping Instances
PART 3: System-Level Configuration
Chapter 6: Configuring Ports, Database, and SMTP Settings
Chapter 7: Managing Privileged Users and Groups
Chapter 8: Keys and Certificates
PART 4: Authentication
Chapter 9: Introduction to Authentication
Chapter 10: Using the PIN Generator Tool
Chapter 11: Configuring Authentication for End Entities
Chapter 12: Developing Authentication Plug-ins
PART 5: Job Scheduling and Notification
Chapter 13: Introduction to Job Scheduling and Notifications
Chapter 14: Configuring Jobs
PART 6: Policies
Chapter 15: Introduction to Policies
Chapter 16: Configuring Policies
PART 7: LDAP Publishing
Chapter 17: Introduction to LDAP Publishing
Chapter 18: Configuring Subsystems for LDAP Publishing
Chapter 19: Publishing CRLs
PART 8: Agent and End-Entity Interfaces
Chapter 20: Introduction to End-Entity and Agent Interfaces
Chapter 21: Customizing End-Entity and Agent Interfaces
PART 9: Logs
Chapter 22: Introduction to Logs
Chapter 23: Managing Logs
PART 10: Issuance and Management of End-Entity Certificates
Chapter 24: Issuing and Managing End-Entity Certificates
Chapter 25: Recovering Encrypted Data
PART 11: Appendixes
Appendix A: Distinguished Names
Appendix B: Backing Up and Restoring Data
Appendix C: Command-Line Utilities
Appendix D: Certificate Database Tool
Appendix E: Key Database Tool
Appendix F: Netscape Signing Tool
Appendix G: SSL Strength Tool
Appendix H: SSL Debugging Tool
Previous Next Contents Index Bookshelf


Chapter 10 Using the PIN Generator Tool

For Netscape Certificate Management System (CMS) to use the plug-in module for directory-based authentication with PINs, your authentication directory must 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. This tool allows you to generate unique PINs for entries in an LDAP-compliant user directory. The tool stores these PINs (as hashed values) in the same directory against the corresponding user entries, and it copies the PINs to a text file, from which you can deliver the PINs to end entities by an appropriate, secure means.

This chapter explains how to use the PIN Generator. The chapter has the following sections:


Locating the PIN Generator Tool
You can find the PIN Generator at this location:

<server_root>/bin/cert/tools/setpin.exe

<server_root> is the directory where the CMS binaries are kept. You first specified this directory during installation.


The setpin Command
You run the PIN Generator by entering the setpin command and its arguments in a command shell and monitoring the output in the shell window. This section gives the syntax for the setpin command and its arguments. For instructions on generating PINs and storing them in your authentication directory, see "Generating PINs".

Command-Line Syntax

Use the following command in a Unix or DOS command shell:

setpin [arguments]

Arguments

The setpin command takes the following arguments and options:

setpin

[host=<host_name> [port=<port_number>]]

[certdb=<path> nickname=<certificate_nickname> | "binddn=<user_id>" bindpw=<bind_password> [SSL=yes | no]]

[objectclass=<objectclass_to_add>]

[attribute=<attribute_name_for_pins>]

["filter=<LDAP_search_filter>"]

[input=<file_name>]

[length=<PIN_length> | minlength=<minimum_PIN_length> maxlength=<maximum_PIN_length>]

[gen=RNG-alpha | RNG-alphanum | RNG=printableascii]

[case=upperonly]

[hash=sha1 | md5 | none]

[output=<file_name>]

[clobber]

[write]

[saltattribute=<LDAP_attribute_to_use_for_salt_creation>]

[debug]

A description for each argument follows:

Example

The following command generates PINs for all entries that have the CN attribute (in their distinguished name) defined in an LDAP directory named laiking that is listening at port 19000. The PIN Generator binds to the directory as user DirectoryManager and starts searching the directory from the node dn=o=airius.com in the directory tree. The tool overwrites the existing PINs, if any, with the new ones.

setpin host=lailing port=19000 "binddn=CN=directoryManager" bindpw=password "filter=(cn=*)" basedn=o=airius.com clobber write


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 setpin command, you need at a minimum to specify the following:

For example:

setpin host=laiking port=19000 "binddn=CN=Directory Manager" bindpw=netscape "filter=(ou=employees)" basedn=o=airius.com

This command, if run, will query the directory for all the entries that match the filter criteria, which in this case is all users belonging to an organizational unit (ou) called employees. For each entry matching the filter, information is printed out to standard error. Additionally, to the standard output or the file named in output; see "Output File".

You can also provide the tool with an input argument using the input option. The argument must be in the form of an ASCII file of pre-prepared DNs and PINs (see Figure 10.1). Note that the input file isn't a substitute for the LDAP directory entries; the filter attribute must still be provided. If an input file is provided, the tool updates only those filtered attributes that match the ones in the input file. For more information about the input file, see "Input File"

Figure 10.1 Using an input and output file for the PIN-generation process

Examples of output follow:

Processing: cn=QA Managers,ou=employees,o=airius.com

Adding new pin/password

dn:cn=QA Managers,ou=employees,o=airius.com

pin:lDWynV

status:notwritten

Processing: cn=PD Managers,ou=employees,o=airius.com

Adding new pin/password

dn:cn=PD Managers,ou=employees,o=airius.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; otherwise, you may change the wrong entries. As a safeguard, a write option is provided that you use to enable writing to the directory after you verify the output; the tool doesn't make any changes to the directory until you specify the write option on the command line.

The output also contains the status of each entry in the directory. It can be one of the values specified in Table 10.1.

Table 10.1 PIN Generator status

Exit code
Description
notwritten

Specifies that the PINs were not written to the directory, because the write option was not specified on the command line.

writefailed

Specifies that the tool made an attempt to modify the directory, but the write operation was unsuccessful.

added

Specifies that the tool added the new PIN to directory successfully.

replaced

Specifies that the tool replaced an old PIN with a new one (the clobber option was specified).

notreplaced
Specifies that the tool did not replace the old PIN with a new one (the clobber option was not specified).

If a PIN already exists for a user, it will by default not be changed if you run the setpin command a second time. This is so that you can generate PINs for new users without overwriting PINs for users who have previously been notified of their PINs. If you want to overwrite a PIN, you should use the clobber option.

Once you are sure that the filter is matching the right users, you should run the setpin command again with the write option, and with output set to the name of the file to capture the unhashed PINs. This output file is in the same format as the input file. For details about the output file, see "Output File".

Input File

The PIN Generator can receive a list of DNs to modify in a text file specified by the input=<file_name> argument. If you specify an input file, the tool compares the DNs it filtered from the LDAP directory with the ones in the input file, and updates only those DNs that matched the ones in the input file.

The purpose of the input file is multifold. It enables you to provide the Pin Generator with an exact list of DNs to modify. Via the input file, you can also provide the PIN Generator with PINs (in plain text format) for all DNs or for specific DNs.

The following examples explain why you might want to use the input file:

The format of the input file is the same as that of the output file (see "Output File"), with the omission of the status line. In the input file, you can choose to specify PINs for all the DNs in the file, for specific DNs, or for none of the DNs. If the PIN attribute is missing for a DN, the tool automatically generates a random PIN.

For example, you can set up your input file to look like this:

dn:cn=user1, o=netscape

<blank line>

dn:cn=user2, o=netscape

<blank line>

...

dn:cn=user3, o=netscape

You can also provide PINs, in plain-text format, for the DNs in the input file, which is then hashed according to the command-line arguments. For example, you can set up your input file to look like this:

dn:cn=user1, o=netscape

pin:pl229Ab

<blank line>

dn:cn=user2, o=netscape

pin:9j65dSf

<blank line>

...

dn:cn=user3, o=netscape

pin:3knAg60

<blank line>

Note You cannot provide hashed PINs to the tool.

Output File

The PIN Generator can capture the output to a text file specified by the output=<file_name> argument.

The captured output will contain a sequence of records and will be in the following format:

dn: <user_dn>1

pin: <generated_pin>1

status: <status>1

<blank line>

dn: <user_dn>2

pin: <generated_pin>2

status: <status>2

<blank line>

...

dn: <user_dn>n

pin: <generated_pin>n

status: <status>n

<blank line>

where

<user_dn> is a distinguished name that matched the specified DN pattern (specified by the DN filter) or that was in the input file (the DN file). By default, the delimiter is ";" or the character defined on the command line.

<generated_pin> is a string of characters with either fixed or variable length, dependent on parameters passed into the command.

<status> is one of the values specified in Table 10.1.

The first line in each record will always be the distinguished name. The subsequent lines, for pin and status, are optional. The record ends with a blank line. The end of line (EOL) sequence is as follows:

Windows NT \r\n

Unix \n

How PINs Are Stored in the Directory

Each PIN is concatenated with the corresponding user's LDAP attribute named in the saltattribute argument. If this argument is not specified, the DN of the user is used. Then, this string is hashed with the hash routine specified in the hash argument (the default selection is SHA-1).

Then, one byte is prepended to indicate the hash type used. Here's how the PIN gets stored:

byte[0] = X

The value of X depends on the hash algorithm chosen during the PIN generation process:

X=0 if the hash algorithm chosen is SHA-1.

X=1 if the hash algorithm chosen is MD5.

X=45 if the hash algorithm chosen is none.

byte[1...] = hash("DN"+"pin")

The PIN is stored in the directory as a binary value, not as a base-64 encoded value.

Exit Codes

The PIN Generator returns exit codes to the shell window; for a list of codes, see Table 10.2. If you plan on automating the PIN-generation process, exit codes are useful in programming shell scripts.

Table 10.2 Exit codes returned by the PIN Generator

Exit code
Description
0
Indicates that PIN generation was successful; that is, PINs are set for all the DNs in the specified directory.

2
Indicates that the tool could not open the certificate database specified by the certdb parameter.

3

Indicates that the tool could not locate the certificate specified by the nickname parameter in the specified certificate database.

4

Indicates that the tool could not bind to the directory as the user specified by the binddn parameter (over SSL).

5

Indicates that the tool could not open the output file specified by the output parameter.

7

Indicates an error parsing command-line arguments.

8

Indicates that the tool could not open the input file specified by the input parameter.

9

Indicates that the tool encountered an internal error.

10

Indicates that the tool found a duplicate entry in the input file specified by the input parameter.

11
Indicates that the tool didn't find the salt attribute, specified by the saltattribute parameter, in the directory.


Generating PINs
Generating PINs for end entities is a six-step process:

Step 1. Check the Directory for User Entries

Before you run the PIN Generator, make sure that the directory you intend to use for generating PINs has been populated with all end-entity entries that require PINs. It is also a good idea to confirm with that directory's administrator that all pending directory requests have been processed before the PIN Generator starts its operation.

Step 2. Update the Directory Schema

By default, the PIN Generator modifies the pin attribute in the directory's user entry (see "Arguments"). Because this attribute is not part of the standard organizationalPerson, you need to add it--that is, create a new object class in your authentication directory's schema.

In general, you need to update the slapd.user_at.conf file to include the pin attribute and the slapd.user_oc.conf file to include the object class definition. The modified schema should look similar to this:

attribute pin bin

objectclass pinPerson

superior organizationalPerson

allows

pin

Netscape Directory Server provides the appropriate user interface to update its schema. It is recommended that you update the schema using the user interface (instead of editing the schema files directly). Sections that follow explain how to update the Directory Server 3.x and 4.x schema using the user interface. For complete information about the schema, see the appropriate Directory Server documentation.

Important Once you have modified the schema, you must restart Directory Server.

When the PIN Generator adds the PIN to the user entry, it also adds the appropriate object class. By default, the object class name is pinPerson, and the name of the attribute is pin, but you can override this with the object class and attribute options.

Updating Netscape Directory Server 3.x Schema

If you are using Netscape Directory Server version 3.x as your authentication directory, you can follow the instruction below to update the schema:

  1. Open a web browser window.
  2. Enter the URL to the Directory Server instance that you want to use for storing end-entity PINs.
  3. Click Schema.
  4. In the left frame, click the "Edit or View Attributes" link.
  5. The Manage Attributes form appears.

  6. In the Add New Attribute section, enter the information for the new attribute:
  7. Attribute Name. Type pin in this field.

    Attribute OID (optional). Entering information in this field is optional. So, you can leave it blank.

    Syntax. Choose binary from the drop-down list.

  8. Click Add New Attribute.
  9. In the left frame, click the Create Objectclass link.
  10. The Create Objectclass form appears; this form allows you to create a new object class to hold the new attribute you added.

  11. Enter information as appropriate:
  12. ObjectClass Name. Type pinPerson in this field.

    Parent Objectclass. Choose organizationalPerson from the drop-down list.

    ObjectClass OID (optional). Entering information in this field is optional. So, you can leave it blank.

  13. In the Available Attributes list, select pin and then click the Add button shown to the left of the Allowed Attributes list.
  14. This action moves the pin attribute to the Allowed Attributes list.

  15. Click Create New ObjectClass.
  16. The server informs you that the object class has been added to the schema.

  17. Restart the server, if prompted to do so.
Updating Netscape Directory Server 4.x Schema

If you are using Netscape Directory Server version 4.x as your authentication directory, you can follow the instruction below to update the schema:

  1. Access Netscape Console (see "Accessing Netscape Console").
  2. Select the directory that you want to use for storing end-entity PINs, and click Open to open the administration interface for Directory Server.
  3. Click the Configuration tab.
  4. In the navigation tree, expand the Database object.
  5. Click Schema, and then in the right pane, click the Attributes tab.

  6. Click Create.
  7. The Create Attribute window appears.

  8. Enter information as appropriate:
  9. Attribute name. Type pin in this field.

    Attribute OID (optional). Entering information in this field is optional. So, you can leave it blank.

    Syntax. Choose binary from the drop-down list.

  10. Click OK.
  11. You are returned to the Attributes tab.

  12. Click the Object Classes tab.
  13. Click Create.
  14. The Create Object Class window appears.

  15. Enter information as appropriate:
  16. Name. Type pinPerson in this field.

    Parent. Choose organizationalperson from the drop-down list.

  17. In the Available Attributes list, select pin and then click the Add button shown to the left of the Allowed Attributes list.
  18. This action moves the pin attribute to the Allowed Attributes list.

  19. Click OK.
  20. The server informs you that the object class has been added to the schema.

  21. Restart the server, if prompted to do so.
Step 3. Prepare the Input File

This step is optional.

If you want to generate PINs for specific user entries or want to provide your own PINs, use an input file (to provide the tool with such information). For information on constructing an input file, see "Input File".

Step 4. Run the Command Without the Write Option

Run the setpin command without the write option. Be sure to include the output option. For details, see "The setpin Command".

The tool will write PINs to the specified output file; no changes are made to the directory. This will give you the opportunity to check the PINs (by looking at the output file) before updating the directory.

To run the command:

  1. Open a terminal window.
  2. Go to <server_root>/bin/cert/tools
  3. <server_root> is the directory where the CMS binaries are kept. You first specified this directory during installation.

  4. Run the setpin command with the appropriate arguments.
Step 5. Check the Output File

Check the output file to be sure it contains PINs for your users; the output should look similar to the one specified in "Output File".

Verify that the tool has assigned PINs to the correct users and that the PINs conform to the length and character-set restrictions you specified. If the output isn't what you want, run the command again with appropriate arguments. Repeat the process until the output file shows the results you want.

Step 6. Run the Command Again with the Write Option

When you are sure about the results, run the command again (with exactly the same arguments) with the write option and the output option. The tool stores the hashed PINs in the directory. For information on how PINs are stored in the directory, see "How PINs Are Stored in the Directory".

Use the output file for delivering PINs to users; see "Delivering PINs to End Entities".


Delivering PINs to End Entities
After you have stored the PINs in the directory, you must deliver them to the users. To protect the privacy of PINs, be sure to use a secure, out-of-band mechanism for delivery. Here are a few suggested delivery mechanisms:

 

© Copyright 1999 Netscape Communications Corp., a subsidiary of America Online, Inc. All rights reserved.