certreq

Description

Creates a server certificate request and corresponding private key. This utility can be used in interactive mode, or you can provide all optional parameters on the command line. Located in $SYBASE/$SYBASE_OCS/bin.

NoteOpenSSL is distributed as a convenience in the Open Client Server (OCS) release. Documentation is available at the OpenSSL Web site.

Windows The utility is certreq.exe, and is located in %SYBASE%\%SYBASE_OCS%\bin.

Syntax

certreq
	[-F input_file]
	[-R request_filename]
	[-K PK_filename]
	[-P password]

Or

certreq -v

Parameters

-F input_file

specifies the file name that contains attribute information to build a certificate request. If you do not specify an input_file name, the required information must be interactively entered by a user.

The input_file needs an entry for each of the following:

req_certtype={Server,Client}
req_keytype={RSA,DSA}
req_keylength={for RSA: 512-4096; 
               for DSA: 512,768,1024}
req_country={string}
req_state={string}
req_locality={string}
req_organization={string}
req_orgunit={string}
req_commonname={string}

NoteThe common name must be the same as the server name.

See the Examples section for a sample file called input_file.

-R request_filename

specifies the name for the certificate-request file.

-K PK_filename

specifies the name for the private-key file.

-P password

specifies the password used to protect the private key.

-v

displays the version number and copyright message, then exits.

Examples

Example 1

This example does not use the -F input_file parameter, and is therefore in interactive mode. To create a server certificate request (server_req.txt) and its private key (server_pkey.txt), enter:

certreq
Choose certificate request type:
    S – Server certificate request
    C – Client certificate request (not supported)
    Q – Quit
Enter your request [Q] : s

Choose key type:

    R – RSA key pair
    D – DSA/DHE key pair
    Q – Quit

Enter your request [Q] : r

Enter key length (512, 768, 1024 for DSA; 512-2048 for
RSA) : 512

Country: US

State: california

Locality: dublin

Organization: sybase

Organizational Unit: dst

Common Name: server

The utility returns the message:

Generating key pair (please wait) . . . 

After the key pair is generated, the certreq utility prompts you for more information.

Enter password for private key : password

Enter file path to save request: server_req.txt

Enter file path to save private key : server_pkey.txt

Example 2

In this sample text file, the format, tag=value, is used for noninteractive entry for a certificate request. You can use the -F option for noninteractive mode. When you use the -F option, be sure to use valid values and follow the format described above. Failure to do so prevents the certificate from being built correctly.

certreq -F input_file
req_certtype=server
req_keytype=RSA
req_keylength=512
req_country=us
req_state=california
req_locality=dublin
req_organization=sybase
req_orgunit=dst
req_commonname=server

After you create and save this file, enter on the command line, where path_and_file is the location of the text file:

certreq -F path_and_file -R server_req.txt -K server_pkey.txt -P password

This file creates a server certificate request, server_req.txt, and its private key, server_pkey.txt which is protected by password.

You can edit the server certificate file with any standard ASCII text editor.

Usage

See also

Utilities certauth, certpk12