Contents Ftp://ftp.software.ibm.com/software/webserver/appserv/library/v61/ihs/GSK7c_Capi Cmd_User Guide GSK7c Capi Cmd User

User Manual: ftp://ftp.software.ibm.com/software/webserver/appserv/library/v61/ihs/GSK7c_CapiCmd_UserGuide

Open the PDF directly: View PDF PDF.
Page Count: 72

DownloadContents Ftp://ftp.software.ibm.com/software/webserver/appserv/library/v61/ihs/GSK7c_Capi Cmd_User Guide GSK7c Capi Cmd User
Open PDF In BrowserView PDF
IBM Global Security Kit

GSKCapiCmd User’s Guide
GSKit Version 7

Edition 12 March 2007
(C) Copyright International Business Machines Corporation 2005-2007. All
rights reserved.
U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted
by GSA ADP Schedule Contract with IBM Corp.

Note: Before using this information and the product it supports, read the
information in Appendix 3. Notices.

2

Contents
Preface............................................................................................................................4
Chapter 1.
Using The GSKCapiCmd Program........................................................7
GSKCapiCmd command line syntax .........................................................................8
Chapter 2.
Key Database Commands ......................................................................9
Create Key Database..................................................................................................9
Delete Key Database................................................................................................11
Change Password for Key Database ........................................................................12
Stash the Password for Key Database......................................................................14
List Supported Key Databases .................................................................................15
Convert Key Database .............................................................................................15
Display Key Database Password Expiry..................................................................17
Chapter 3.
Certificate Commands .........................................................................19
Create a Self-Signed Certificate...............................................................................19
Add a Certificate ......................................................................................................22
Delete a Certificate ..................................................................................................23
Display Details of a Certificate................................................................................25
Export a Certificate ..................................................................................................26
Receive a Certificate ................................................................................................28
Import a Certificate ..................................................................................................29
Extract a Certificate .................................................................................................31
List Details of Default Certificate............................................................................33
Set Default Certificate..............................................................................................34
List Certificates........................................................................................................35
Modify Certificate....................................................................................................37
Sign a Certificate......................................................................................................38
Chapter 4.
Certificate Request Commands............................................................41
Create a Certificate Request.....................................................................................41
Delete Certificate Request .......................................................................................43
List Certificate Request Details ...............................................................................44
Extract Certificate Request ......................................................................................46
List all Certificate Requests .....................................................................................47
Re-create Certificates Requests ...............................................................................48
Chapter 5.
Random Password Generation.............................................................51
Create a Random Password .....................................................................................51
Chapter 6.
Help Commands...................................................................................53
Chapter 7.
Version Commands..............................................................................54
Chapter 8.
Error Codes and Messages...................................................................55
Appendix 1. CMS Key Database..............................................................................61
Appendix 2. A Simple Example ...............................................................................64
Appendix 3. Notices .................................................................................................70

3

Preface
This manual is intended for network or system security administrators who have installed
GSKit and want to use the GSKCapiCmd program to modify CMS or PKCS11 key databases.
This manual assumes the reader is familiar with the GSKit product range and the functionality
of the CMS key database.
Before continuing to read this manual ensure you have read and understood the following
prerequisite readings. This will ensure that you understand the required concepts and terms
used throughout the manual:
•
•

Appendix 1 of this manual, “CMS Key Databases”.
Appendix 2 of this manual, “A Simple Example”.

Please ensure that you read all of the identified readings before you continue with this
manual.

How this book is organized
This manual contains the following sections:
•
•
•
•
•
•
•
•
•
•
•

Chapter 1, “Using the GSKCapiCmd Program”, on page 6. This chapter contains general
information about the GSKCapiCmd program.
Chapter 2, “Key Database Commands”, on page 8. This chapter looks at the different
commands that are available to the GSKCapiCmd program for CMS key databases.
Chapter 3, “Certificate Commands”, on page 17. This chapter looks at the different
commands that are available to the GSKCapiCmd program for managing certificates.
Chapter 4, “Certificate Request Commands” on page 38. This chapter looks at the different
commands that are available to the GSKCapiCmd program for managing certificate requests.
Chapter 5, “Random Commands”, on page 48.
Chapter 6 “Help Command”, on page 50.
Chapter 7 “Version Command”, on page 51.
Chapter 8 “Error Codes and messages”, on page 52.
Appendix 1, “CMS Key Databases”, on page 58.
Appendix 2, “A Simple Example”, on page 61
Appendix 3, “Notices”, on page 67

Contacting software support
Before contacting IBM Tivoli Software Support with a problem, refer to the IBM Tivoli Software
Support site by clicking the Tivoli support link at the following Web site:
http://www.ibm.com/software/support/ If you need additional help, contact software support by using
the methods described in the IBM Software Support Guide at the following Web site:
http://techsupport.services.ibm.com/guides/handbook.html The guide provides the following
information: Registration and eligibility requirements for receiving support v Telephone numbers,
depending on the country in which you are located v A list of information you should gather before
contacting customer support

Conventions used in this book
The following typeface conventions are used through out this manual:
Bold: Draws emphasis to a key word, indicating that the user needs to take note as the word will be
used at a later stage. In relation to the options of each command a bolded value indicates the default
value for that option.

4

Italic: Non-specific command line options or identifiers.

Symbol conventions
[ ] - Identifies an option that is optional, if an option is not surrounded by this style of brackets the
option is required.
| - Indicates an “OR” relationship between the options on either side of it.
{} – Identifies mutually exclusive set of options.

Operating system differences
This book uses the UNIX convention for specifying environment variables and for directory notation.
When using the Windows command line, replace $variable with %variable% for environment
variables and replace each forward slash (/) with a backslash (\) in directory paths. If you are using the
bash shell on a Windows system, you can use the UNIX conventions.

Acronyms
The following is a list of acronyms that are used throughout this manual.
CA
CMS
FIPS
GSKit
ICC
IE

-

Certificate Authority
Certificate Management System
Federal Information Processing Standards
Global Security Kit
IBM Crypto for C
Internet Explorer

Revision History
Revision Description

On Date

Refer to...

First draft of document

11/08/2004

Anthony Ferguson

Updating document with
additional information

24/08/2004

Anthony Ferguson

Updating the document with 3/11/2004
additional information.

Anthony Ferguson

Corrected a number of error 2/12/2004
in the document after a
review.

Anthony Ferguson

Updated a number of errors
after an @sec review

21/12/2004

Anthony Ferguson

Adding the random
password generation
information

7/1/2005

Anthony Ferguson

Correcting some minor
errors.

24/01/2005

Anthony Ferguson

Adding important warning to 14/02/2005
ensure quotes are used for all
commands

Anthony Ferguson

Addressing atsec comments

28/02/2005

Alex Hennekam

Adding the email and dc

11/08/2005

Anthony Ferguson

5

attributes to the DN tags
Adding the –sernum tag to
25/08/2005
the certificate sign command

Anthony Ferguson

Adding the –expiry action

16/02/2006

Anthony Ferguson

Adding pfx documentation
for certificate import and
export commands

10/04/2006

Anthony Ferguson

Adding additional error
codes to Chapter 8

27/04/2006

Anthony Ferguson

Adding newly supported
SHA algorithms

29/06/2006

Anthony Ferguson

Updating required fields for
DN tags

10/07/2006

Kai Gorman

Adding error codes 232 and
233

24/07/2006

Kai Gorman

Some corrections to
argument lists

12/March/2007

Simon McMahon

6

Chapter 1. Using The GSKCapiCmd Program
GSKCapiCmd is a tool that can be used to manage keys, certificates and certificate
requests within a CMS key database. The tool has all of the functionality that GSKit’s
existing java command line tool has except that GSKCapiCmd supports CMS and
PKCS11 key databases. If you are intending to manage key databases other than CMS
or PKCS11 you will need to use the existing java tool.
GSKCapiCmd can be used to manage all aspects of a CMS key database. The
following chapters go into detail for each of the functions supported by
GSKCapiCmd.
The advantage of using this tool over the existing one is that GSKCapiCmd does not
require java to be installed on the system.
GSKCapiCmd uses some encoding rules, and implements aspects of certain RFC’s
and standards. While it is not strictly necessary for users to have a full understanding
of these items in order to use this utility, those wishing to learn more should examine
the following resources:
http://asn1.elibel.tm.fr/en/standards/index.htm
Basic Encoding Rules (BER)
BER encoding is defined in the specification ITU-T Rec. X.690 (2002).
Distinguished Encoding Rules (DER)
DER encoding is defined in the specification ITU-T Rec. X.690 (2002).
http://www.faqs.org/rfcs
PKCS#10
RFC 2986: PKCS #10: Certification Request Syntax Specification, Version 1.7,
November 2000
X.509
RFC 3280: Internet X.509 Public Key Infrastructure - Certificate and Certificate
Revocation List (CRL), obsoletes RFC 2459, April 2002.
http://www.rsasecurity.com/rsalabs/
PKCS#11
Cryptographic Token Interface Standard

7

PKCS#12
PKCS 12 v1.0: Personal Information Exchange Syntax, RSA Laboratories, June 24,
1999
PKCS#7
PKCS 7 v1.5: Cryptographic Message Syntax, RSA Laboratories, March 1998
CMS
Appendix 1 offers some additional information concerning the format and use of a
CMS keystore, while appendix 2 takes the reader though a simple example of how
CMS keystores can be used to enable SSL communication between a server and client
application.

GSKCapiCmd command line syntax
The syntax for the GSKCapiCmd program is as follows:
gsk7capicmd   
where:
object

Is one of the one of the following:
-keydb
Actions acted on a key database.
-cert
Actions acted on a certificate stored within an identified key database.
-certreq
Actions acted on a certificate request stored within an identified key database.
-random
Generates a random string of characters that can be used as a password for other
commands.
-version
Displays version information for GSKCapiCmd
-help
Displays help for the GSKCapiCmd commands.

action

Is the specific action to be taken on the object.

options Are the options associated with the specified object and task

This manual will go into detail for each particular object, its associated actions, and
what options are available in the following chapters.

8

Chapter 2. Key Database Commands
The key database commands are associated with the -keydb object. This object
supports the following actions:
•
•
•
•
•
•
•

Create a Key Database (-create)
Delete a Key Database (-delete)
Change the Password of an existing Key Database (-changepw)
Stash the Password of an existing Key Database (-stashpw)
List the Supported Key Databases (-list)
Convert an old style CMS Key Database to the updated style of CMS Key
Database (-convert)
Display the expiry date associated with a CMS key databases password
(-expiry)

Each of the following sections goes into detail on how to use each of the key database
commands and what options are available for each command.

Create Key Database
The create command creates a new CMS key database. During the creation process
three files are created. The first file is the certificate key database itself. By standard it
is a good idea to name this file with a .kdb extension (key.kdb). This is not required,
but it is a good idea, it makes easy to identify the file as a key database.
The second file created is used to store certificate requests associated with the key
database. This file is created with the same name as given to the key database but with
a .rdb extension. The third file is used to hold the certificate revocation list used by
the key database; this file has become obsolete and is no longer used. This file is
created with the same name as the key database but this time with a .crl extension.
Once the key database has been created it is populated with a number of pre-defined
trusted certificate authority (CA) certificates. There is no way of preventing this from
occurring. The trusted CA certificates are as follows:
Entrust.net Global Secure Server Certification Authority
Entrust.net Global Client Certification Authority
Entrust.net Client Certification Authority
Entrust.net Certification Authority (2048)
Entrust.net Secure Server Certification Authority
VeriSign Class 3 Public Primary Certification Authority
VeriSign Class 2 Public Primary Certification Authority
VeriSign Class 1 Public Primary Certification Authority
VeriSign Class 4 Public Primary Certification Authority - G2
VeriSign Class 3 Public Primary Certification Authority - G2
VeriSign Class 2 Public Primary Certification Authority - G2
VeriSign Class 1 Public Primary Certification Authority - G2
VeriSign Class 4 Public Primary Certification Authority - G3
VeriSign Class 3 Public Primary Certification Authority - G3
VeriSign Class 2 Public Primary Certification Authority - G3
VeriSign Class 1 Public Primary Certification Authority - G3
Thawte Personal Premium CA
Thawte Personal Freemail CA
Thawte Personal Basic CA

9

Thawte Premium Server CA
Thawte Server CA
RSA Secure Server Certification Authority

Any or all of these CA certificates can be removed from the key database. If you want
to remove any of the certificates look at the delete certificate command in this
manual.
The syntax for creating a CMS key database with GSKCapiCmd is as follows:
gsk7capicmd -keydb -create -db  [-pw ] [-type ] [-expire
] [-stash] [-fips] [-strong]
Where:
object -keydb
action -create
options
IMPORTANT: On Unix type operating systems it is recommended to always
encapsulate string values associated with all tags in double quotes (“”). You
will also need to escape, using a ‘\’ character, the following characters if they
appear in the string values: ‘!’, ‘\’, ‘”’, ‘`’. This will prevent some command
line shells from interpreting specific characters within these values. (e.g.
gsk7capicmd –keydb –create –db “/tmp/key.kdb” –pw “j\!jj”). Note however
when prompted by gsk7capicmd for a value (for example a password) quoting
the string and adding the escape characters should not be done. This is because
the shell is no longer influencing this input.
-db 
Fully qualified path name of a key database. A good example of a key
database filename might be /home//keydb.db.
-pw 
The password for the key database identified by the –db tag above. If
you want to create a key store without a password simply leave the
-pw tag out of the above command.
-type 
The type of the key database to be created. At this stage this tool only
supports the creation of CMS key database. If the tag is left off the tool
will assume that a CMS key database is to be created.
-expire 
The number of days before the password for the key database is to
expire. If the tag is left off, the key database password will never
expire. If specified the duration must be from 1 to 7300 days (20
years).
-stash

10

Stash the password for the key database after creation. A stash file is
used as an automatic way of providing a password. When accessing a
key database the system will first check for the existence of a stash file.
If one exists the contents of the file will be decrypted and used as input
for the password. When the -stash option is specified during the create
action, the password is stashed into a file with the name as follows:
.sth.
-fips
This disables the use of the BSafe cryptographic library. Only the ICC
component which must be successfully intialized in FIPS* mode will
be used. If the ICC component does not intialize in FIPS mode then the
gsk7capicmd operation will fail.
* When in FIPS mode the ICC component uses algorithms that have been FIPS 140-2
validated.

-strong
Check that the password entered satisfies the minimum requirements
for the passwords strength. The minimum requirements for a password
are as follows:
•
•
•
•
•

The minimum password length is 14 characters.
A password needs to have at least one lower case character, one upper case
character, and one digit or special character ( eg. *$#% etc, a space is
classified as special characters).
Each character should not occur more than three times in a password.
No more than two consecutive characters of the password should be
identical.
All characters mentioned above are in the standard ASCII printable character
set within the range from 0x20 to 0x7E inclusive.

Delete Key Database
The delete key database command simply deletes the identified key database. When
identifying the key database you simply need to specify the file name of the key
database. The request database (.rdb) and certificate revocation list (.crl) files are
removed automatically during the process. If a stash file was created it is not
removed.
If a password was provided for this command it is used to ensure that the user is
actually allowed to delete the key database. If the password is not correct the key
database is not deleted.
The syntax for deleting a key database with GSKCapiCmd is as follows:
gsk7capicmd -keydb -delete -db  [-pw ]
Where:
object -keydb

11

action -delete
options
IMPORTANT: On Unix type operating systems it is recommended to always
encapsulate string values associated with all tags in double quotes (“”). You
will also need to escape, using a ‘\’ character, the following characters if they
appear in the string values: ‘!’, ‘\’, ‘”’, ‘`’. This will prevent some command
line shells from interpreting specific characters within these values. (e.g.
gsk7capicmd –keydb –create –db “/tmp/key.kdb” –pw “j\!jj”). Note however
when prompted by gsk7capicmd for a value (for example a password) quoting
the string and adding the escape characters should not be done. This is because
the shell is no longer influencing this input.
-db 
The fully qualified path name of a key database.
-pw 
The password for the key database identified by the –db tag above. The
–pw tag is required if the key database was created with a password. It
is an additional check to ensure that the user deleting the key database
is authorized to do so. If the key database does not have a password the
–pw tag is not required.
If a password is provided and it does not patch the password for the
identified key database the key database is not deleted.

Change Password for Key Database
The change password command allows the user to change the password associated
with the specified key database. When changing the password for a key database, all
key records containing encrypted private key information have the private key data reencrypted. The new password is used as input to create the new encryption key used
during the encryption process.
The syntax for changing the password of an existing key database with GSKCapiCmd
is as follows:
gsk7capicmd -keydb -changepw {-db  | -crypto  -tokenlabel
} [-pw ] -new_pw  [-expire ] [-stash]
[-fips] [-strong]
Where:
object -keydb
action -changepw
options

12

IMPORTANT: On Unix type operating systems it is recommended to always
encapsulate string values associated with all tags in double quotes (“”). You
will also need to escape, using a ‘\’ character, the following characters if they
appear in the string values: ‘!’, ‘\’, ‘”’, ‘`’. This will prevent some command
line shells from interpreting specific characters within these values. (e.g.
gsk7capicmd –keydb –create –db “/tmp/key.kdb” –pw “j\!jj”). Note however
when prompted by gsk7capicmd for a value (for example a password) quoting
the string and adding the escape characters should not be done. This is because
the shell is no longer influencing this input.
-db 
The fully qualified path name of a key database.
-crypto 
Indicates a PKCS11 cryptographic device operation, where  is the path to the module to manage the crypto device.
-tokenlabel 
The PKCS11 cryptographic device token label.
-pw 
The password for the key database identified by the –db tag above. If
you want to create a key store without a password simply leave the
-pw tag out of the above command.
-new_pw 
The new password for the key database.
-expire 
The number of days before the new password is to expire. If the tag is
not specified the key databases password never expires. If specified the
duration must be within the range of 1 to 7300 days (20 years).
-stash
Stash the password for the key database. When the –stash the new
password will be stashed in a file with the filename built as follows:
.sth.
-fips
This disables the use of the BSafe cryptographic library. Only the ICC
component which must be successfully intialized in FIPS* mode will
be used. If the ICC component does not intialize in FIPS mode then the
gsk7capicmd operation will fail.
* When in FIPS mode the ICC component uses algorithms that have been FIPS 140-2
validated

-strong
Check that the password entered satisfies the minimum requirements
for the passwords strength. The minimum requirements for a password
are as follows:

13

•
•
•
•
•

The minimum password length is 14 characters.
A password needs to have at least one lower case character, one upper case
character, and one digit or special character (eg. *$#% etc, a space is
classified as special characters).
Each character should not occur more than three times in a password.
No more than two consecutive characters of the password should be
identical.
All characters mentioned above are in the standard ASCII printable character
set within the range from 0x20 to 0x7E inclusive.

Stash the Password for Key Database
The stash password command takes an existing key databases password and stashes it
to a specified file. The reason that a user would want to stash a password for a key
database is to allow the password to be recovered from the file when automatic login
is required. The output of the command is a single file with the name of the key
database with a “.sth” extension.
The syntax for stashing the password of an existing key database with GSKCapiCmd
is as follows:
gsk7capicmd -keydb -stashpw -db  [-pw ] [-fips]
Where:
object -keydb
action -stashpw
options
IMPORTANT: On Unix type operating systems it is recommended to always
encapsulate string values associated with all tags in double quotes (“”). You
will also need to escape, using a ‘\’ character, the following characters if they
appear in the string values: ‘!’, ‘\’, ‘”’, ‘`’. This will prevent some command
line shells from interpreting specific characters within these values. (e.g.
gsk7capicmd –keydb –create –db “/tmp/key.kdb” –pw “j\!jj”). Note however
when prompted by gsk7capicmd for a value (for example a password) quoting
the string and adding the escape characters should not be done. This is because
the shell is no longer influencing this input.
-db 
The fully qualified path name of a key database.
-pw 
The password for the key database identified by the –db tag above.
-fips
This disables the use of the BSafe cryptographic library. Only the ICC
component which must be successfully intialized in FIPS* mode will

14

be used. If the ICC component does not intialize in FIPS mode then the
gsk7capicmd operation will fail.
* When in FIPS mode the ICC component uses algorithms that have been FIPS 140-2
validated

List Supported Key Databases
The list supported key databases simply lists all of the key database types that the
GSKCapiCmd supports.

Deleted: . At this stage this command
will only indicate that CMS and PKCS11
key databases are supported.

The syntax for listing the key databases supported by GSKCapiCmd is as follows:

Deleted: [-fips]

gsk7capicmd -keydb –list
Where:
object -keydb
action -list

Convert Key Database
The convert key database command converts an old version CMS key database to the
new version of CMS key database. The latest version of CMS is more secure because
it uses more secure algorithms to secure the contents of the key databases during
creation.
This command requires that you assign a name to the new key database that is
different to the existing old key database. This name cannot be the same as the
existing one. This is to ensure that the old key database is not destroyed until the user
destroys it. Once all testing of the new version key database has been completed the
user can remove the old key database and rename the new key database to the old key
databases name if required.
The syntax for converting a key database to the latest CMS version by GSKCapiCmd
is as follows:
gsk7capicmd -keydb –convert –db  [-pw ] –new_db 
[-new_pw ] [-preserve] [-strong] [-fips]
Where:
object -keydb
action -list
options

15

Deleted: ¶
options¶
¶
-fips¶
This disables the use of the BSafe
cryptographic library. Only the ICC
component which must be successfully
intialized in FIPS* mode will be used. If
the ICC component does not intialize in
FIPS mode then the gsk7capicmd
operation will fail. ¶
¶
* When in FIPS mode the ICC
component uses algorithms that have
been FIPS 140-2 validated¶

IMPORTANT: On Unix type operating systems it is recommended to always
encapsulate string values associated with all tags in double quotes (“”). You
will also need to escape, using a ‘\’ character, the following characters if they
appear in the string values: ‘!’, ‘\’, ‘”’, ‘`’. This will prevent some command
line shells from interpreting specific characters within these values. (e.g.
gsk7capicmd –keydb –create –db “/tmp/key.kdb” –pw “j\!jj”). Note however
when prompted by gsk7capicmd for a value (for example a password) quoting
the string and adding the escape characters should not be done. This is because
the shell is no longer influencing this input.
-db 
The fully qualified path name of a key database.
-pw 
The password for the key database identified by the –db tag above.
-new_db 
Fully qualified path name of a new key database to be created during
the conversion.
-new_pw 
The password for the key database identified by the –new_db tag
above.
-preserve
When this option is specified during the convert command the newly
created key database will not include any new trusted CA certificates,
it will be identical to the old key database.
If you chose not to include this option the following CA certificates
will be added to the newly created key database:
Entrust.net Global Secure Server Certification Authority
Entrust.net Global Client Certification Authority
Entrust.net Client Certification Authority
Entrust.net Certification Authority (2048)
Entrust.net Secure Server Certification Authority
VeriSign Class 3 Public Primary Certification Authority
VeriSign Class 2 Public Primary Certification Authority
VeriSign Class 1 Public Primary Certification Authority
VeriSign Class 4 Public Primary Certification Authority - G2
VeriSign Class 3 Public Primary Certification Authority - G2
VeriSign Class 2 Public Primary Certification Authority - G2
VeriSign Class 1 Public Primary Certification Authority - G2
VeriSign Class 4 Public Primary Certification Authority - G3
VeriSign Class 3 Public Primary Certification Authority - G3
VeriSign Class 2 Public Primary Certification Authority - G3
VeriSign Class 1 Public Primary Certification Authority - G3
Thawte Personal Premium CA
Thawte Personal Freemail CA
Thawte Personal Basic CA
Thawte Premium Server CA
Thawte Server CA
RSA Secure Server Certification Authority

There is no way of adding just a couple of the CA certificates it is all
or none, but you are able to remove any of them at a later stage.
16

-strong
Check that the password entered satisfies the minimum requirements
for the passwords strength. The minimum requirements for a password
are as follows:
•
•
•
•
•

The minimum password length is 14 characters.
A password needs to have at least one lower case character, one upper case
character, and one digit or special character (eg. *$#% etc, a space is
classified as special characters).
Each character should not occur more than three times in a password.
No more than two consecutive characters of the password should be
identical.
All characters mentioned above are in the standard ASCII printable character
set within the range from 0x20 to 0x7E inclusive.

-fips
This disables the use of the BSafe cryptographic library. Only the ICC
component which must be successfully intialized in FIPS* mode will
be used. If the ICC component does not intialize in FIPS mode then the
gsk7capicmd operation will fail.
* When in FIPS mode the ICC component uses algorithms that have been FIPS 140-2
validated

Display Key Database Password Expiry
The expiry key database command simply displays the date that the password
associated with the identified key database will expire. When identifying the key
database you simply need to specify the file name of the key database.
The syntax for displaying the expiry of the password associated with a key database
with GSKCapiCmd is as follows:
gsk7capicmd -keydb -expiry -db  [-pw ]
Where:
object -keydb
action -expiry
options
IMPORTANT: On Unix type operating systems it is recommended to always
encapsulate string values associated with all tags in double quotes (“”). You
will also need to escape, using a ‘\’ character, the following characters if they
appear in the string values: ‘!’, ‘\’, ‘”’, ‘`’. This will prevent some command
line shells from interpreting specific characters within these values. (e.g.
gsk7capicmd –keydb –expiry –db “/tmp/key.kdb” –pw “j\!jj”). Note however
when prompted by gsk7capicmd for a value (for example a password) quoting

17

the string and adding the escape characters should not be done. This is because
the shell is no longer influencing this input.
-db 
The fully qualified path name of a key database.
-pw 
The password for the key database identified by the –db tag above. The
–pw tag is required if the key database was created with a password. If
the key database does not have a password the –pw tag is not required.
-fips
This disables the use of the BSafe cryptographic library. Only the ICC
component which must be successfully intialized in FIPS* mode will
be used. If the ICC component does not intialize in FIPS mode then the
gsk7capicmd operation will fail.
* When in FIPS mode the ICC component uses algorithms that have been FIPS 140-2
validated

IMPORTANT: An expiry of 0 means that the password associated with the key
database does not expire.

18

Chapter 3. Certificate Commands
The certificate commands are associated with the -cert object. This object supports the
following actions:
•
•
•
•
•
•
•
•
•
•
•
•
•

Create a self signed certificate in a key store (-create)
Add a certificate to a key store (-add)
Delete a certificate from a key store (-delete)
Display the details of a certificate in a key store (-details)
Export a certificate from a key store to another key store (-export)
Receive a certificate into a key store (-receive)
Import a certificate from a key store to another key store (-import)
Extract a certificate from a key store (-extract)
List the details of the default certificate in a key store (-getdefault)
Set the default certificate in a key store (-setdefault)
List the certificates stored in a key store (-list)
Modify a certificate in a key store (-modify)
Sign a certificate (-sign)

Each of the following sections goes into detail on how to use and what options are
available for each of the identified certificate actions.

Create a Self-Signed Certificate
A self-signed certificate provides a certificate that can be used for testing while
waiting for the officially signed certificate to be returned from the CA. Both a private
and public key are created during this process.
The create self-signed certificate command creates a self-signed X509 certificate in
the identified key database. A self-signed certificate has the same issuer name as its
subject name.
The syntax for creating a certificate in an existing key database with GSKCapiCmd is
as follows:
gsk7capicmd -cert -create {-db  | -crypto  -tokenlabel } [-pw ] -label