GSK CapiCmd UserGuide
GSK CapiCmd UserGuide
GSKit version 8
IBM
IBM Global Security Kit
GSKit version 8
IBM
Note
Before using this information and the product it supports, read the information in Appendix F, “Notices,” on page 97.
This edition applies to GSKCapiCmd version 8.0.50 and to all subsequent releases and modifications until otherwise
indicated in new editions.
Note: The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD
NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in
RFC 2119 [RFC2219].
© Copyright IBM Corporation 2005, 2018.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract
with IBM Corp.
Contents
Preface . . . . . . . . . . . . . . . v Modify a certificate in a keystore (-modify) . . . . 37
Who should read this book . . . . . . . . . v Sign a certificate (-sign) . . . . . . . . . . 38
Accessibility . . . . . . . . . . . . . . v Validate a certificate (-validate) . . . . . . . . 40
IBM and accessibility . . . . . . . . . . v
Contacting software support . . . . . . . . . v Chapter 4. Certificate request
Conventions used in this book . . . . . . . . vi commands . . . . . . . . . . . . . 43
Typeface conventions . . . . . . . . . . vi Create a certificate request (-create) . . . . . . 43
Operating system differences . . . . . . . vi Delete certificate request (-delete) . . . . . . . 45
List certificate request details (-details) . . . . . 47
Chapter 1. Using the GSKCapiCmd Extract certificate request (-extract) . . . . . . 48
program. . . . . . . . . . . . . . . 1 List all certificate requests (-list) . . . . . . . 49
Language support overview . . . . . . . . . 1 Re-create certificate requests (-recreate) . . . . . 50
Locale environment variables . . . . . . . . 1
LANG variable on UNIX or Linux systems . . . 1 Chapter 5. Secret Key commands . . . 53
Forcing output to a different locale . . . . . . 2 Create a random secret key to a keystore (-create) 53
Using locale variants . . . . . . . . . . 2 Add a secret key to a keystore (-add) . . . . . . 54
Text encoding (code set) support. . . . . . . 3 Extract a Secret Key from a keystore (-extract) . . . 55
Shell and command line interpretation. . . . . 3
Warning: KeyStore Backups . . . . . . . . 4 Chapter 6. Random commands . . . . 57
KeyStore Overview . . . . . . . . . . . . 4 Create a random password of a specified length
Supported Distinguished Name (DN) attributes . . 5 (-create) . . . . . . . . . . . . . . . 57
GSKCapiCmd command-line syntax . . . . . . 5
Chapter 7. Help commands . . . . . . 59
Chapter 2. Key database commands . . 7
Keystore access control . . . . . . . . . . . 7
Create a key database (-create) . . . . . . . . 8
Chapter 8. Version command . . . . . 61
Delete a key database (-delete) . . . . . . . . 10
Change the password of an existing key database Chapter 9. Runtime messages. . . . . 63
(-changepw) . . . . . . . . . . . . . . 11
Stash the password of an existing key database Chapter 10. Error codes and messages 77
(-stashpw) . . . . . . . . . . . . . . . 12
List the supported key databases (-list) . . . . . 13 Appendix A. CMS key databases . . . 83
Convert a key database (-convert) . . . . . . . 13
What is a CMS key database? . . . . . . . . 83
Display the expiry date associated with a key
How is a CMS key database organized? . . . . . 83
database (-expiry) [deprecated] . . . . . . . . 15
How is a CMS key database protected . . . . . 83
What can I put in a CMS key database? . . . . . 84
Chapter 3. Certificate commands . . . 17 What is a label? . . . . . . . . . . . . . 84
Signature algorithms . . . . . . . . . . . 17 How can I manipulate certificates in a CMS
Information about key sizes . . . . . . . . . 18 keystore? . . . . . . . . . . . . . . . 85
Information about elliptic curves . . . . . . . 19
Suite B algorithm and key size selection . . . . . 19 Appendix B. A Simple Example . . . . 87
Create a self-signed certificate in a keystore (-create) 19
The requirement . . . . . . . . . . . . . 87
Add a certificate to a keystore (-add) . . . . . . 22
Considerations for the administrator . . . . . . 87
Delete a certificate from a keystore (-delete) . . . 24
Step 1 – Obtain a company-wide intermediate
Display details of a certificate (-details) . . . . . 25
certificate . . . . . . . . . . . . . . . 87
Export a certificate (-export) . . . . . . . . . 26
Step 2 – Sign all employee certificates using the
Receive a certificate into a keystore (-receive) . . . 27
ACME intermediate . . . . . . . . . . . 88
Import a certificate (-import) . . . . . . . . 29
Step 3. Create the web server certificate . . . . . 89
Extract a certificate from a keystore (-extract) . . . 31
So do we meet the requirements? . . . . . . . 90
List details of the default certificate (-getdefault)
[deprecated] . . . . . . . . . . . . . . 32
Set default certificate in a keystore (-setdefault) Appendix C. Troubleshooting . . . . . 91
[deprecated] . . . . . . . . . . . . . . 33 Certificate not validating . . . . . . . . . . 91
Rename a certificate in a keystore (-rename) . . . 33 Case sensitivity . . . . . . . . . . . . . 91
List the certificates stored in a keystore (-list) . . . 35
iv
Preface
This guide describes how to use the GSKCapiCmd utility to manage keys,
certificates, and certificate requests within a key database.
This document assumes that Global Security Kit (GSKit) is installed, configured,
and running on your network.
Before continuing to read this manual, ensure that you have read and understood
the following prerequisite readings. This will ensure that you understand the
required concepts and terms used throughout the manual:
v Appendix A, “CMS key databases,” on page 83.
v Appendix B, “A Simple Example,” on page 87.
Accessibility
Accessibility features help users with a physical disability, such as restricted
mobility or limited vision, to use software products successfully. Standard shortcut
and accelerator keys are used by the product and are documented by the operating
system. See the documentation provided by your operating system for more
information.
If you need additional help, contact software support by using the methods
described in the Software Support Handbook http://www14.software.ibm.com/
webapp/set2/sas/f/handbook/home.html.
Typeface conventions
The following typeface conventions are used in this reference:
Bold Lowercase commands or mixed case commands that are difficult to
distinguish from surrounding text, keywords, parameters, options, names
of Java™™ classes, and objects are in bold.
Italic Variables, non-specific command-line options or identifiers, and special
words are in italic.
Monospace
Code examples, command lines, screen output, file and directory names
that are difficult to distinguish from surrounding text, system messages,
text that the user must type, and values for arguments or command
options are in monospace.
Symbol conventions
[ ] - Identifies an option that is optional, if an option is not surrounded by this
style of brackets the option is required.
vi
Chapter 1. Using the GSKCapiCmd program
GSKCapiCmd is a tool that can be used to manage keys, certificates, and certificate
requests within a key database. The following chapters go into detail for each of
the functions supported by GSKCapiCmd.
GSKCapiCmd uses some encoding rules, and implements aspects of certain RFCs
and standards. It is not strictly necessary for users to have a full understanding of
these items in order to use this utility. However, if you want to learn more then
you can examine the resources contained in: Appendix D, “Resources,” on page 93.
If you are in a Windows environment, you can modify the language setting in the
Regional Settings of the Control Panel.
If you specify the LANG environment variable and also modify the regional
settings then the LANG environment variable will override the regional setting. As
specified by open systems standards, other environment variables override LANG
for some or all locale categories. These variables include the following:
v LC_COLLATE
v LC_CTYPE
v LC_MONETARY
v LC_NUMERIC
v LC_TIME
v LC_MESSAGES
v LC_ALL
To do this, set the locale option to the appropriate canonical name, based on the
ISO language or territory codes.
For example, to display the help message in German issue the command:
gsk8capicmd –help –locale de
If a message catalog is not found for the desired language, the English message
catalogs are used. For example, suppose you specify the AIX® locale for German in
Switzerland as follows:
LANG=De_CH.IBM-850
In this example, the catalogs are searched in the following order to locate the
specified locale:
1. de_CH
2. de
3. en
2
Since gsk8capicmd does not provide a German in Switzerland language pack,
de_CH is not found. If the German language package is available, de is used.
Otherwise, the default locale en is used, causing text to be displayed in English.
In addition, you can provide multiple locales for the same language so that
different code sets are used for the same language on the same machine. Message
catalogs are encoded using UTF-8, and the text is converted to the locale encoding
before being presented to the user. In this way, the same French message catalog
files can be used to support a variety of Latin 1 code sets, such as ISO8859-1,
Microsoft 1252, IBM PC 850, and IBM MVS™ 1047.
Interoperability across your domain depends on code set files, which are used to
perform UTF-8 conversion and other types of encoding-specific text processing.
For messages to display correctly on some platforms, you might need to specify
the correct code set that supports your locale.
For example if you wish to create a keystore with a password containing a single
quote such as wxyz'abcd12 under UNIX shell you would do this:
gsk8capicmd -keydb -create -db key.kdb -pw ’wxyz’"’"’abcd12’
For Windows the simple solution is to always encapsulate string values associated
with tags in double quotation marks (" "). This will prevent the command-line shell
from interpreting specific characters within these values. For example if you wish
to create a keystore with a password such as wxyz'abcd12 under Windows you
would do this:
gsk8capicmd -keydb -create -db key.kdb -pw "wxyz’abcd12"
Note: Backed-up KeyStores need the same physical protection as online KeyStores.
Passwords of backed-up KeyStores must be managed with the same care as
online KeyStores.
KeyStore Overview
KeyStores are databases used to store Private Keys and Public Keys contained in
X.509 Certificates. The database may exist as a file or Hardware storage device e.g.
Smart Card. The database may also be used to store certificate requests, secret
keys, and key generation parameters. The KeyStore used maybe one of a number
of supported formats. The following table lists the format and relevant capabilities:
Footnotes:
1
v IBM Proprietary Format
2
v PKCS#12 Format transparently supported and interchanged with CMS format
by GSKit
3
v PKCS#11 Format
4
v Microsoft Key Store
5
v Deprecated
6
v Deprecated
7
v Secondary KeyStore must be CMS or P12
8
v Password does not apply/exist when P12 KeyStore is empty
9
v Deprecated
4
10
v Must use Vendor Tools
11
v Must Not use Vendor Tools
where:
modifiers
May include the following:
-fips [<true>|<false>]
Enable or disable forced Federal Information Processing Standards
(FIPS) mode.
In FIPS mode, gsk8capicmd initializes the underlaying
cryptographic provider in FIPS mode so that it only uses
algorithms that have been FIPS 140-2 validated.
The following chapters of this manual describe each particular object, its associated
actions, and what options are available.
6
Chapter 2. Key database commands
The key database commands are associated with the -keydb object. This object
supports the following actions:
v “Create a key database (-create)” on page 8.
v “Delete a key database (-delete)” on page 10.
v “Change the password of an existing key database (-changepw)” on page 11.
v “Stash the password of an existing key database (-stashpw)” on page 12.
v “List the supported key databases (-list)” on page 13.
v “Convert a key database (-convert)” on page 13.
v “Display the expiry date associated with a key database (-expiry) [deprecated]”
on page 15.
Note: This feature is deprecated as CMS keystores no longer have this capability.
Keystore password lifetime management must be done outside of the
gskcapicmd utility.
Each of the following sections details the key database commands and the options
available for each command.
The access control settings of the keystore file default to those settings of the user
running the create operation. The user can change the access control settings to
provide additional protection to the default encryption by using the appropriate
operating system services. That is, services such as "caclc" on Windows before
Windows Vista and "icacls" for Windows Vista+ or "chmod" on UNIX operating
systems.
You can stash the keystore password in a file that can automatically provide the
password when required. Stashing the password removes the need for an
If you elect to create a stash file when creating a key database, the password is
stashed into a file named as follows: <key_database_name>.sth. The access control
settings for the stash file are set so that the stash file is readable only by the owner
of the file. It is not recommended that multiple users be given access to the stash
file. However, it is possible to change the access control settings on the stash file by
using the appropriate operating system services. That is, services such as "caclcs"
on Windows before Windows Vista and "icacls" for Windows Vista+ or "chmod" on
UNIX operating systems.
Note: Refer to the “Warning: KeyStore Backups” on page 4 section before updating
a keystore.
where:
object -keydb
action -create
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
Fully qualified path name of a key database. A good example of a
key database file name might be /home/<user_name>/keydb.db.
-pw <passwd>
The password for the key database identified by the –db tag. If you
want to create a keystore without a password simply leave the -pw
tag out of the command.
-type <cms | kdb | pkcs12 | p12>
The type of the key database to be created. This tool only supports
the creation of a CMS or PKCS#12 format key database. If this tag
is omitted then the tool creates a CMS key database by default.
The value 'kdb' can be used as a synonym for 'cms' and 'p12' for
'pkcs12'.
A CMS key database consists of three files:
v The first file is the certificate key database itself. By convention,
the name of this file should include the .kdb extension (for
8
example, key.kdb). This extension is not required, but it is a
good idea as it makes it easy to identify the file as a key
database.
v 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.
v 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 with a .crl extension.
A PKCS#12 keystore is a single file, which by convention is created
with the .p12 extension.
-expire <days>
(Deprecated). The number of days before the password for the key
database is to expire. If this tag is not used then the key database
password will never expire. If specified, the duration must be from
1 to 7300 days (20 years).
The delete key database command simply deletes the identified key database. To
identify the key database, simply specify the correct 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.
where:
object -keydb
action -delete
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
10
-pw <passwd>
The password for the key database that has been identified by the
–db tag. 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 match the password for
the identified key database, the key database is not deleted.
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 re-encrypted. The new password is used as input to create the
encryption key that will be used during the encryption process.
The syntax for changing the password of an existing key database with
GSKCapiCmd is as follows:
gsk8capicmd -keydb -changepw {-db <name>|-crypto <module_name> -tokenlabel
<token_label>} [-type <cms|kdb|pkcs12|p12>] [-pw <passwd>] -new_pw
<new_passwd> [-expire <days>] [-stash] [-strong] [-v1stash]
where:
object -keydb
action -changepw
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the –db tag.
-new_pw <new_passwd>
The new password for the key database.
-expire <days>
(Deprecated.) The number of days before the new password is to
The syntax for stashing the password of an existing key database with
GSKCapiCmd is as follows:
gsk8capicmd -keydb -stashpw -db <name> {-pw <passwd> | -stashed} [-v1stash]
where:
object -keydb
action -stashpw
12
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-pw <passwd>
The password for the key database identified by the –db tag.
-stashed
The password for the key database is recovered from the stash file.
-v1stash
Generate an old format stash file (not recommended) . Note that if
a stash file already exists for the keystore, and it is in a newer
format than v1, then the stash file will only be back leveled to v1 if
the -pw flag gives the current correct password.
The syntax for listing the key databases supported by GSKCapiCmd is as follows:
gsk8capicmd -keydb –list [-crypto <driver_name> | -db <name>
[-pw <password>] [-stashed]]
where:
object -keydb
action -list
options
-crypto <driver_name>
Lists the token labels for the named PKCS#11 cryptographic device.
-db <name>
Keystore name for format validation. The program checks that the
named keystore is usable.
-pw <passwd>
The password for the key database identified by the -db tag.
-stashed
The password for the key database is recovered from the stash file.
This command requires that you assign a name to the new key database that is
different to the existing old key database. That is, the name cannot be the same as
the existing one. This requirement 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:
gsk8capicmd -keydb –convert –db <name> [-pw <passwd>] [{-type|-old_format}
<cms|kdb|pkcs12|p12>] [{–new_db|-target} <name>][-new_pw <passwd>]
[-new_format <cms|kdb|pkcs12|p12>] [-preserve|-populate] [-expire <days>]
[-strong] [-stash] [-v1stash]
where:
object -keydb
action -convert
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-type | -old_format <cms | kdb | pkcs12 | p12>
The keystore type. If this option is not specified, the program uses
the file extension of the database path name to determine the
keystore type.
-pw <passwd>
The password for the key database identified by the –db tag.
-new_db | -target <filename>
Fully qualified path name of a new key database to be created
during the conversion.
-new_pw <passwd>
The password for the key database identified by the –new_db tag.
-new_format <cms | kdb | pkcs12 | p12>
The type of the new keystore. If this option is not specified, the
program uses the file name suffix of the new database path name
to determine the keystore type.
-preserve | -populate
The preserve option has no action and is deprecated. The newly
created key database will include the same certificates as the old
key database, unless the populate option is selected.
The populate option adds a number of predefined trusted
certificate authority (CA) certificates to the newly created key
database. The CA certificates loaded should be reviewed by
inspecting the output of the list certificates command. Any or all of
14
the added CA certificates can be removed from the key database. If
you want to remove any of the certificates, use the delete certificate
command in this manual.
-expire <days>
(Deprecated.) The number of days before the password is to
expire. If this 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).
where:
object -keydb
action -expiry (Deprecated.)
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-pw <passwd>
The password for the key database identified by the –db tag. 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.
-type <cms | kdb| pkcs12 | p12>
The keystore type. If this option is not specified, the program uses
the file name suffix of the database path name to determine the
keystore type.
IMPORTANT: An expiry of 0 means that the password associated with the key
database does not expire.
16
Chapter 3. Certificate commands
Note: Refer to the “Warning: KeyStore Backups” on page 4 section before updating
a keystore.
The certificate commands are associated with the -cert object. This object supports
the following actions:
v “Create a self-signed certificate in a keystore (-create)” on page 19
v “Add a certificate to a keystore (-add)” on page 22
v “Delete a certificate from a keystore (-delete)” on page 24
v “Display details of a certificate (-details)” on page 25
v “Export a certificate (-export)” on page 26
v “Receive a certificate into a keystore (-receive)” on page 27
v “Import a certificate (-import)” on page 29
v “Extract a certificate from a keystore (-extract)” on page 31
v “List details of the default certificate (-getdefault) [deprecated]” on page 32
v “Set default certificate in a keystore (-setdefault) [deprecated]” on page 33
v “Rename a certificate in a keystore (-rename)” on page 33
v “List the certificates stored in a keystore (-list)” on page 35
v “Modify a certificate in a keystore (-modify)” on page 37
v “Sign a certificate (-sign)” on page 38
v “Validate a certificate (-validate)” on page 40
The following sections describe how to use each of the identified certificate actions
and what options are available. Supporting information to assist with generating
and manipulating certificates is also included:
Signature algorithms
The following signature algorithms are supported for use with commands that
accept the -sigalg parameter:
md5 | MD5_WITH_RSA | MD5WithRSA |
sha1 | SHA_WITH_RSA | SHAWithRSA | SHA1WithRSA |
sha224 | SHA224_WITH_RSA | SHA224WithRSA |
sha256 | SHA256_WITH_RSA | SHA256WithRSA | SHA2WithRSA (deprecated) |
sha384 | SHA384_WITH_RSA | SHA384WithRSA | SHA3WithRSA (deprecated) |
sha512 | SHA512_WITH_RSA | SHA512WithRSA | SHA5WithRSA (deprecated) |
sha3_256 | SHA3_256WithRSA |
sha3_384 | SHA3_384WithRSA |
sha3_512 | SHA3_512WithRSA |
RSASSAPSS | SHA256WithRSASSAPSS | SHA384WithRSASSAPSS | SHA512WithRSASSAPSS
SHA3_256WithRSASSAPSS | SHA3_384WithRSASSAPSS | SHA3_512WithRSASSAPSS |
SHA_WITH_DSA | SHA1WithDSA | SHAWithDSA |
SHA1WithECDSA | EC_ecdsa_with_SHA1 |
SHA224WithECDSA | EC_ecdsa_with_SHA224 |
SHA256WithECDSA | EC_ecdsa_with_SHA256 |
SHA384WithECDSA | EC_ecdsa_with_SHA384 |
SHA512WithECDSA | EC_ecdsa_with_SHA512 |
SHA3_256WithECDSA | SHA3_384WithECDSA | SHA3_512WithECDSA
The following table shows the key types matched with their corresponding
signature algorithms.
Table 2. Signature algorithms
Algorithm Signing algorithm
RSA md5 | MD5_WITH_RSA | MD5WithRSA | sha1 | SHA_WITH_RSA |
SHAWithRSA | SHA1WithRSA | sha224 | SHA224_WITH_RSA |
SHA224WithRSA | sha256 | SHA256_WITH_RSA | SHA256WithRSA |
sha384 | SHA384_WITH_RSA | SHA384WithRSA | sha512 |
SHA512_WITH_RSA | SHA512WithRSA | RSASSAPSS |
SHA256_WITH_RSASSAPSS | SHA384_WITH_RSASSAPSS |
SHA512_WITH_RSASSAPSS|sha3_256 | SHA3_256WithRSA | sha3_384
| SHA3_384WithRSA | sha3_512 | SHA3_512WithRSA |
SHA3_256WithRSASSAPSS | SHA3_384WithRSASSAPSS |
SHA3_512WithRSASSAPSS |
EC EC_ecdsa_with_SHA1 | SHA224WithECDSA | EC_ecdsa_with_SHA224
| SHA256WithECDSA | EC_ecdsa_with_SHA256 | SHA384WithECDSA
| EC_ecdsa_with_SHA384 | SHA512WithECDSA |
EC_ecdsa_with_SHA512|SHA3_256WithECDSA |
SHA3_384WithECDSA | SHA3_512WithECDSA
DSA SHA_WITH_DSA | SHA1WithDSA | SHAWithDSA
DH DH (key/cert gen only)
18
Table 3. Key sizes (continued)
Algorithm Size (bits) Default value (bits)
DH 512-4096; key sizes in this range 1024
should be selected as per NIST
SP800-131; 8192 is supported for
validation only.
To operate in Suite B Mode, certificates must be created with specific key and
algorithm choices as specified in RFC 5430. Refer to 4.1 and 4.2 of RFC 5430 for
specific details on the available choices. The following table provides a mapping of
the security levels to signing algorithms:
Table 5. Suite B algorithm security levels
Suite B security level Signing algorithm
128 bit EC_ecdsa_with_SHA256 | SHA256WithECDSA
192 bit EC_ecdsa_with_SHA384 | SHA384WithECDSA
The syntax for creating a certificate in an existing key database with GSKCapiCmd
is as follows:
gsk8capicmd -cert -create {-db <name> [-type <cms | kdb| pkcs12 | p12>] |
-crypto <module_name> -tokenlabel <token_label> [-secondarydb <name>]
[-secondarydbpw <passwd>] [-secondarydbtype <cms | kdb| pkcs12 | p12>]}
[-pw <passwd> | -stashed] -label <label> -dn <dist_name> [-size <key_size>]
[-x509version <1 | 2 | 3>] [-default_cert <yes | no>] [-expire <days>]
where:
object -cert
action -create
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
Fully qualified path name of a key database to store the self-signed
certificate.
-type <cms | kdb| pkcs12 | p12>
Type of the keystore.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the –db or
–tokenlabel tags. Specify a hyphen (-) as the password to cause the
program to read the password from stdin. This allows you to pipe
in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-label <label>
Label attached to the certificate. The label is used to uniquely
identify the certificate by a human user.
-dn <dist_name>
The X.500 distinguished name that uniquely identifies the
certificate. The input must be a quoted string of the following
format:
CN=common name
O=organization
OU=organization unit
L=location
ST=state, province
C=country
DC=domain component
EMAIL=email address
20
For Example: “CN=weblinux.Raleigh.ibm.com,O=ibm,OU=IBM HTTP
Server,OU=GSKit\\, Gold Coast,L=RTP,ST=NC,C=US”
Binary characters may be included as escaped hex values e.g. \\e9.
-size <key_size>
The size of the new key pair to be created. This size ranges in
value depending on the key type. Consult Table 3 on page 18 for
valid values.
Note: For some algorithms, you can specify a zero (0) value to use
the default key size. This is typically the minimum size that
is considered secure.
-x509version <1 | 2 | 3>
The version of X.509 certificate to create, default is 3.
-default_cert <yes | no>
(Deprecated.). Sets the newly created certificate as the default
certificate for the key database. By default the newly created
self-signed certificate is not set as the default (no). A default
certificate in the key database is used when a specific certificate is
not specified for an operation.
-expire <days>
Expiration time of the certificate in days, default 365 days. The
duration is 1 to 7300 days (20 years).
The syntax for adding a certificate in an existing key database with GSKCapiCmd
is as follows:
gsk8capicmd -cert -add {-db <name> -type <cms | kdb| pkcs12 | p12> |
-crypto <module_name> -tokenlabel <token_label>} [-pw <passwd> |
-stashed] -label <label> -file <name> [-format <ascii | binary>]
[-trust <enable | disable>] [-secondaryDB <filename> -secondaryDBpw
<password> -secondaryDBtype <cms | kdb| pkcs12 | p12>] [-nolabelupdate]
where:
object -cert
action -add
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-type <cms | kdb | pkcs12 | p12>
Type of the key database. If this option is not present, the type is
implied by the file extension of database path name.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
22
-pw <passwd>
The password for the key database identified by the –db or
–tokenlabel tags. Specify a hyphen (-) as the password to cause the
program to read the password from stdin. This allows you to pipe
in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-label <label>
Label attached to the certificate.
-file <name>
File name of the certificate to add. If the extension is “.p7”,
“.smime” or “.eml” then it is assumed to be a PKCS#7 encoding.
The first certificate will take the ‘label’ given and all other
certificates that are present, will be labelled with their subject
name. PEM (extension “.pem”) single or multi certificate encodings
may also be added.
-format <ascii | binary>
Format of a certificate The default is Base64 encoded ASCII.
Additional information about Base64 encoding can be found in
RFC 2045 and RFC 3548. The binary format is a binary dump of
the DER encoded certificate structure. For additional information,
see ITU-T Rec. X.690 (2002) | ISO/IEC 8825-1:2002.
-trust <enable | disable>
(Deprecated). Trust status of a CA certificate, where the default is
‘enable’. When a CAs certificate trust status is enabled then that
CA certificate is permitted to be involved in a certificate chain
validation. If the CAs certificate trust status is disabled then it
cannot be used to validate any certificates. For example if
certificate “ABC” is signed by the CA certificate “VeriSign CA” and
“VeriSign CA” is not marked as trusted then the validation of
“ABC” will fail.
-secondaryDB <filename>
A CMS key database used to support the PKCS#11 device. A
PKCS#11 device does not normally have a large amount of space
available to store a lot of signer certificates. The signer certificates
are used for the validation of certificates when they are added to
the PKCS#11 device.
-secondaryDBpw <password>
Password for the secondary CMS key database supporting the
PKCS#11 device.
-secondaryDBtype <cms | kdb| pkcs12 | p12>
Keystore type of the secondary key database.
-nolabelupdate
By default, if a certificate that already exists in the keystore is
added again with a different label, the action becomes a rename
operation. If this flag is set then an error will be returned if the
certificate to be added already exists in the keystore and a label
change would have occurred.
The delete certificate command removes the certificate with the identified label.
Once the delete operation is complete, there is no way of recovering the certificate
unless you add the certificate back into the key database.
The syntax for deleting a certificate in an existing key database with GSKCapiCmd
is as follows:
gsk8capicmd -cert -delete {-db <name> -type <cms | kdb| pkcs12 | p12> |
-crypto <module_name> -tokenlabel <token_label>} [-pw <passwd> | -stashed]
-label <label> [-secondaryDB <filename> -secondaryDBpw <password>
-secondaryDBtype <cms | kdb| pkcs12 | p12>]
where:
object -cert
action -delete
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-type <cms | kdb | p12 | pkcs12>
Type of the key database. If this option is not present, the type is
implied by the database file extension.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the –db or
–tokenlabel tags. Specify a hyphen (-) as the password to cause the
program to read the password from stdin. This allows you to pipe
in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-label <label>
Label attached to the certificate that is to be deleted.
-secondaryDB <filename>
A CMS key database used to support the PKCS#11 device. A
PKCS#11 device does not normally have a large amount of space
available to store a lot of signer certificates. The signer certificates
are used for the validation of certificates when they are added to
the PKCS#11 device.
24
-secondaryDBpw <password>
Password for the secondary CMS key database supporting the
PKCS#11 device.
-secondaryDBtype <cms | kdb| pkcs12 | p12>
Keystore type of the secondary key database.
If more details for the certificate are required, use the –showOID option. This
option displays a more detailed listing of the certificate details.
The syntax for displaying the details for a certificate in an existing key database
with GSKCapiCmd is as follows:
gsk8capicmd -cert -details [-showOID] [-file <name>] {-db <name> [-type
<cms | kdb| pkcs12 | p12>] | -crypto <module_name> -tokenlabel
<token_label>} [-pw <passwd> | -stashed] -label <label> [-rfc3339]
[-secondaryDB <filename> -secondaryDBpw <password>
-secondaryDBtype <cms | kdb| pkcs12 | p12>] -showsizeonly
where:
object -cert
action -details
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-showOID
Display a more in-depth listing of the certificate.
-file <name>
File name of the certificate to display. ASCII or binary encoded
certificate.
-db <filename>
The fully qualified path name of a key database.
-type <cms | kdb | pkcs12 | p12 | pkcs7>
Type of the key database. If this option is not present, the type is
implied by the file extension of the database path name.
The syntax to export a certificate from an existing key database to another key
database with GSKCapiCmd is as follows:
gsk8capicmd -cert -export -db <name> [-pw <passwd> | -stashed]
[-type <cms | kdb | pkcs7 | pkcs11 | pkcs12 | p12 > ][-label <label>]-target <name>
[-target_pw <passwd> | -target_stashed] [-target_type <cms | kdb| pkcs11 | pkcs12 | p12>]
[-encryption <strong | weak>]
where:
object -cert
26
action -export
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified file name of the key database that contains the
certificate to export. If the supplied file name has an extension of
either ".p12" or ".pfx" then it is assumed that it is in PKCS#12
format. If it is “.p7”, “.smime” or “.eml” then it is assumed to be a
PKCS#7 encoding.
-pw <passwd>
The password for the key database identified by the –db or
–tokenlabel tags. Specify a hyphen (-) as the password to cause the
program to read the password from stdin. This allows you to pipe
in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-label <label>
Label attached to the certificate that is to be exported.
-type <cms |kdb | pkcs12 | p12>
The type of the key database that contains the certificate to export.
The default is cms.
-target <name>
Destination key database or file where the certificate is to be
exported. If the supplied file name has an extension of either
“.p12” or .pfx” then it is assumed that it is in PKCS#12 format. If
the target keystore does not exist, it will be created.
-target_pw <passwd>
The password of the destination key database or file.
-target_stashed
The password for the destination key database will be recovered
from the stash file.
-target_type <cms | kdb| pkcs12 | p12>
The type of the destination key database or file where the
certificate is to be exported. The default is cms.
-encryption <strong | weak>
The strength of encryption used during the export. The default is
strong. This tag is no longer used as the export restrictions in the
USA have eased. This tag is simply added to this command-line
tool for backward compatibility reasons. It has no effect on the
operation. Strong is always used.
If the certificate request is required after receiving the certificate, you will need to
use the recreate certificate request command: “Re-create certificate requests
(-recreate)” on page 50.
where:
object -cert
action -receive
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-file <name>
The file name of the certificate that is to be received. This file can
be either binary or base64 encoded.
-format <ascii | binary>
Format of a certificate. The default is Base64 encoded ASCII.
Additional information about base64 encoding can be found in
RFC 2045 and RFC 3548. The binary format is a binary dump of
the DER encoded certificate structure. For additional information,
see ITU-T Rec. X.690 (2002) | ISO/IEC 8825-1:2002
-db <filename>
The fully qualified path name of a key database.
-type <cms | kdb | pkcs12 | p12>
The keystore type. If this option is not specified, the program will
use the database path name extension to determine the keystore
type.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the –db or
–tokenlabel tags. Specify a hyphen (-) as the password to cause the
program to read the password from stdin. This allows you to pipe
in the password.
-stashed
The password for the key database will be recovered from the
stash file.
28
-default_cert <yes|no>
(Deprecated). Sets the newly created certificate as the default
certificate for the key database. By default the newly created
self-signed certificate is not set as the default (no). A default
certificate in a key database is used during operations where a
specific certificate is not specified.
-t61 Substitute ISO8859-1 character set encodings for malformed
TELETEX strings.
The syntax for importing a certificate from an existing key database to another key
database with GSKCapiCmd is as follows:
gsk8capicmd -cert -import {-db <name> | -file <name>} [-pw <passwd> | -stashed]
[-type <cms | kdb| pkcs7 | pkcs11 | pkcs12 | p12>] [-pfx]
[-secondaryDB <filename> -secondaryDBpw <password> -secondaryDBtype <cms | kdb| pkcs12 | p12>]
[-label <label>]
{ -target <name> | -crypto <module_name> -tokenlabel <token_label>}
[-target_pw <passwd> | -target_stashed] [-target_type <cms | kdb| pkcs11 | pkcs12 | p12>]
[-new_label <label>] [-t61]
where:
object -cert
action -import
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of the source key database that
contains the certificate to be imported. If the supplied file name
has an extension of either “.p12” or .pfx” then it is assumed that it
is in PKCS#12 format. If it is “.p7”, “.smime” or “.eml” then it is
assumed to be a PKCS#7 encoding.
-file <filename>
The fully qualified path name of a PKCS#12, PKCS#7 or PFX
format file of:
v The certificate to be imported, or
v An import script (.txt file).
-pw <passwd>
The password for the key database or PKCS#11 cryptographic
device identified by either the -db or -crypto tags respectively.
Specify a hyphen (-) as the password to cause the program to read
the password from stdin. This allows you to pipe in the password.
-stashed
The password for the key database will be recovered from the
stash file.
30
Extract a certificate from a keystore (-extract)
The extract certificate command simply extracts the certificate data from the key
database and places it into the identified file. If the file does not exist then it will
be created. If the file already exists, an error indicating this will be returned. The
data will be saved as either base64 encoding or binary. No private key components
are extracted.
The syntax to extract a certificate from an existing key database with GSKCapiCmd
is as follows:
gsk8capicmd -cert -extract {-db <name> | -crypto <module_name> -tokenlabel
<token_label>} [-pw <passwd> | -stashed] -label <label> -param <dsa|dh>
-target <name> [-format
<ascii | binary>] [-secondaryDB <filename> -secondaryDBpw <password>
-secondaryDBtype <cms | kdb| pkcs12 | p12>]
where:
object -cert
action -extract
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the –db or
–tokenlabel tags. Specify a hyphen (-) as the password to cause the
program to read the password from stdin. This allows you to pipe
in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-label <label>
Label attached to the certificate that is to be extracted.
-param <dsa|dh>
Extract Diffie Hellman or DSA parameters.
-target <name>
Destination file to which the certificate or parameters is to be
extracted.
-format <ascii | binary>
Format of an output file. The default is Base64 encoded ASCII.
Additional information about base64 encoding can be found in
RFC 2045 and RFC 3548. The binary format is a binary dump of
The list default certificate details command lists the following details for the
default certificate of the identified key database:
v The label of the default certificate.
v The size of the key associated with the default certificate.
v The X509 version that the default certificate was created.
v The serial number for the default certificate.
v The issuer and subject distinguished names.
v The default certificates validity period.
v The fingerprint of the default certificate.
v The signature of the algorithm used during creation of the default certificate.
v An indication of the default certificates trust status.
The syntax for listing the details for the default certificate in an existing key
database with GSKCapiCmd is as follows:
gsk8capicmd -cert -getdefault -db <name> [-type <cms | kdb| pkcs12 | p12>]
[-pw <passwd> | -stashed]
where:
object -cert
action -getdefault (deprecated)
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-pw <passwd>
The password for the key database identified by the –db tag.
Specify a hyphen (-) as the password to cause the program to read
the password from stdin. This allows you to pipe in the password.
32
-stashed
The password for the key database will be recovered from the
stash file.
-type <cms | kdb | pkcs12 | p12>
The keystore type. If this option is not specified, the program uses
the file extension of the database file name to determine the
keystore type.
The set default certificate command sets a certificate to be used as the default
certificate for the identified key database. During this command the current default
certificate, if there is one, has its default setting removed. The new certificate is
then set as the default certificate. There can only ever be one default certificate in a
key database.
The syntax for setting the default certificate in an existing key database with
GSKCapiCmd is as follows:
gsk8capicmd -cert -setdefault -db <name> [-pw <passwd> | -stashed] -label
<label> [-type <cms | kdb| pkcs12 | p12>]
where:
object -cert
action -setdefault (deprecated)
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-pw <passwd>
The password for the key database identified by the –db tag.
Specify a hyphen (-) as the password to cause the program to read
the password from stdin. This allows you to pipe in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-label <label>
Label that uniquely identifies the certificate that is to be set as the
default certificate in the identified key database.
-type <cms | kdb | pkcs12 | p12>
The keystore type. If this option is not specified, the program uses
the file extension of the database file name to determine the
keystore type.
where:
object -cert
action -rename
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the –db tag.
Specify a hyphen (-) as the password to cause the program to read
the password from stdin. This allows you to pipe in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-label <label>
Label attached to the certificate that is to be renamed.
-new_label <new_name>
A new label name to uniquely identify the certificate in the key
database.
-type <cms | kdb | pkcs12 | p12>
The keystore type. If this option is not specified, the program uses
the file extension of the database file name to determine the
keystore type.
-secondaryDB <filename>
A CMS key database used to support the PKCS#11 device. A
PKCS#11 device does not normally have a large amount of space
available to store a lot of signer certificates. The signer certificates
are used for the validation of certificates when they are added to
the PKCS#11 device.
-secondaryDBpw <password>
Password for the secondary CMS key database supporting the
PKCS#11 device.
-secondaryDBtype <cms | kdb| pkcs12 | p12>
Keystore type of the secondary key database.
34
List the certificates stored in a keystore (-list)
The list certificate command lists all of the certificates and secret keys stored
within the identified key database.
where:
object -cert
action -list
The list command has optional special tags that can be associated with it.
These tags are used to identify what type of certificates you are requesting
to be displayed. The tags are not required. By default all certificate stored
within the key database will be displayed. The following list describes
these tags:
all List the labels of all certificates in the identified key database. This
is the default for the list command.
personal
List all personal certificates in the identified key database.
CA List all of the certificate authority (CA) certificates in the identified
key database.
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-expiry <number of days>
The expiry tag identifies the number of days from today that a
certificate remains valid. If a certificate is due to expire within this
number of days then its validity range ("Not Before" and "Not
After") displays along with the certificate name. The list also
includes the name and validity range details for expired
certificates. A certificate that is not expiring within this number of
days has only its name listed. You can enter the value 0 to list
expired certificates. If no value is given to the -expiry tag, then a
default of 1 year is used. If you do not specify this tag, it is not
applied during the execution of the command.
-db <filename>
The fully qualified path name of a key database. If the supplied
file name has an extension of either “.p12” or .pfx” then it is
assumed that it is in PKCS#12 format. If it is “.p7”, “.smime” or
“.eml” then it is assumed to be a PKCS#7 encoding.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
36
Thawte Personal Freemail CA
Thawte Personal Basic CA
Thawte Premium Server CA
Thawte Server CA
RSA Secure Server Certification Authority
The default key is marked with the ‘*’ symbol (deprecated) and all trusted
self-signed (root) certs are listed with a ‘!’ symbol. (deprecated) The ‘-‘
symbol is used to show where a private key is present.
The syntax for modifying the trust status of a certificate in an existing key
database with GSKCapiCmd is as follows:
gsk8capicmd -cert -modify -db <name> [-pw <passwd> | -stashed] -label <label>
-trust <enable | disable>
where:
object -cert
action -modify
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-pw <passwd>
The password for the key database identified by the –db tag.
Specify a hyphen (-) as the password to cause the program to read
the password from stdin. This allows you to pipe in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-label <label>
Label attached to the certificate.
-trust <enable | disable>
(Deprecated). Trust status of a CA certificate. The default is enable.
When a CAs certificate trust status is enabled then that CA
certificate is permitted to be involved in a certificate chain
validation. If the CAs certificate trust status is disabled then it
cannot be used to validate any certificates. For example if
certificate “ABC” is signed by the CA certificate “VeriSign CA” and
“VeriSign CA” is not marked as trusted then the validation of
“ABC” will fail.
If a certificate is not identified, the private key of the default certificate in the key
database is used during the signing process. (deprecated)
where:
object -cert
action -sign
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-type <cms | kdb | pkcs12 | p12>
The keystore type. If this option is not specified, the program uses
the file name extension to determine the keystore type.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the –db tag.
Specify a hyphen (-) as the password to cause the program to read
the password from stdin. This allows you to pipe in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-label <label>
Label of the certificate that has the private key to use for the
signing operation.
-target <name>
The name of the file that will contain the signed certificate.
-format <acsii | binary>
The format of the signed certificate. The default is Base64 encoded
38
ASCII. Additional information about base64 encoding can be found
in RFC 2045 and RFC 3548. The binary format is a binary dump of
the DER encoded certificate structure. For additional information,
see ITU-T Rec. X.690 (2002) | ISO/IEC 8825-1:2002
-expire <number of days>
The expiry tag identifies the number of days from today that a
certificate is valid. The default is 365 days.
where:
object -cert
action -validate
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
40
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the –db tag.
Specify a hyphen (-) as the password to cause the program to read
the password from stdin. This allows you to pipe in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-label <label>
Label attached to the certificate that is to be validated.
-type <cms | kdb | pkcs12 | p12>
The keystore type. If this option is not specified, the program uses
the file extension of the database file name to determine the
keystore type.
-ldap <location>
TCP/IP name or address of the LDAP server that is to be used for
certificate revocation checking.
-secondaryDB <filename>
A CMS key database used to support the PKCS#11 device. A
PKCS#11 device does not normally have a large amount of space
available to store a lot of signer certificates. The signer certificates
are used for the validation of certificates when they are added to
the PKCS#11 device.
-secondaryDBpw <password>
Password for the secondary CMS key database supporting the
PKCS#11 device.
-secondaryDBtype <cms | kdb| pkcs12 | p12>
Keystore type of the secondary key database.
The certificate request commands are associated with the -certreq object. This object
supports the following actions:
v “Create a certificate request (-create)”
v “Delete certificate request (-delete)” on page 45
v “List certificate request details (-details)” on page 47
v “Extract certificate request (-extract)” on page 48
v “List all certificate requests (-list)” on page 49
v “Re-create certificate requests (-recreate)” on page 50
The following sections provide details on how to use each of the identified
certificate request actions and what options are available.
The syntax for creating a certificate request in an existing key database with
GSKCapiCmd is as follows:
gsk8capicmd -certreq -create {-db <name> | -crypto <module_name> -tokenlabel
<token_label>} [-pw <passwd> | -stashed] [-type <cms | kdb| pkcs12 | p12>]
-label <label> -dn <dist_name> [-size <key_size>] {-target | -file} <name>
[{-sigalg | -sig_alg} <algorithm>] [-secondaryDB <filename> -secondaryDBpw
<password> -secondaryDBtype <cms | kdb| pkcs12 | p12>] [-san_dns_name <name>]
[-san_emailaddr <address>] [-san_ipaddr <address>] [-certpolicy <policy>]
[-ku <name>] [-eku <name>]
where:
object -certreq
action -create
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
Note: For some algorithms, you can specify a zero (0) value to use
the default key size. This is typically the minimum size that
is considered secure.
-target | -file <name>
The file name that the certificate request will be extracted to during
the certificate request creation process.
44
-secondaryDB <filename>
A CMS key database used to support the PKCS#11 device. A
PKCS#11 device does not normally have a large amount of space
available to store a lot of signer certificates. The signer certificates
are used for the validation of certificates when they are added to
the PKCS#11 device.
-secondaryDBpw <password>
Password for the secondary CMS key database supporting the
PKCS#11 device.
-secondaryDBtype <cms | kdb| pkcs12 | p12>
Keystore type of the secondary key database.
-san_dnsname <name>
The Subject Alternative Name (SAN) DNS name(s) for the entry
being created.
-san_emailaddr <address>
The Subject Alternative Name (SAN) email address(es) for the
entry being created. Multiple values can be separated with
commas.
-san_ipaddr <address>
The Subject Alternative Name (SAN) IP address(es) for the entry
being created.
-certpolicy <policy>
The certificate policy. A named set of rules limiting the
applicability of the certificate. Multiple values can be separated
with commas.
-ku <list>
Key usage property list. Specifies the valid uses for the private key
or certificate.
-eku <list>
Extended key usage property list. Specifies the valid uses for the
certificate.
-sigalg | -sig_alg <signature_algorithm>
The signing algorithm to be used during the creation of the
certificate request. This algorithm is used to create the signature
associated with the new certificate request. The generated key type
will be chosen to match this signing algorithm. See “Signature
algorithms” on page 17 for the allowed values.
The delete certificate request removes the certificate request from the identified
key database. This means that the entry in the “.rdb” associated with the certificate
request is deleted.
The syntax for deleting a certificate request in an existing key database with
GSKCapiCmd is as follows:
where:
object -certreq
action -delete
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the –db or
–tokenlabel tags. Specify a hyphen (-) as the password to cause the
program to read the password from stdin. This allows you to pipe
in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-type <cms | kdb | pkcs12 | p12>
The keystore type. If this option is not specified, the program will
use the database path name suffix to determine the keystore type.
-label <label>
Label attached to the certificate request that is to be deleted.
-secondaryDB <filename>
A CMS key database used to support the PKCS#11 device. A
PKCS#11 device does not normally have a large amount of space
available to store a lot of signer certificates. The signer certificates
are used for the validation of certificates when they are added to
the PKCS#11 device.
-secondaryDBpw <password>
Password for the secondary CMS key database supporting the
PKCS#11 device.
-secondaryDBtype <cms | kdb| pkcs12 | p12>
Keystore type of the secondary key database.
46
List certificate request details (-details)
The list certificate request details command simple lists the identified certificate
requests details. These details include:
v The label of the certificate request.
v The size of the key associated with the certificate request.
v The subject distinguished name.
v The fingerprint of the certificate.
v The signature of the algorithm used during creation of the certificate.
For a more detailed listing of the certificate request details use the -showOID
option in the command.
The syntax for listing a certificate requests details in an existing key database with
GSKCapiCmd is as follows:
gsk8capicmd -certreq -details [-showOID] [-file <name>] {-db <name> |
-crypto <module_name> -tokenlabel <token_label>} [-pw <passwd> | -stashed]
[-type <cms | kdb| pkcs12 | p12>] -label <label> [-secondaryDB <filename>
-secondaryDBpw <password> -secondaryDBtype <cms | kdb| pkcs12 | p12>]
where:
object -certreq
action -details
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-showOID
Display a more in-depth listing of the certificate requests.
-file <name>
File name of the certificate request to display. Ascii or binary
encoded certificate request.
-db <filename>
The fully qualified path name of a key database.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the –db or
–tokenlabel tags. Specify a hyphen (-) as the password to cause the
program to read the password from stdin. This allows you to pipe
in the password.
-stashed
The password for the key database will be recovered from the
stash file.
The syntax for extracting a certificate request from an existing key database with
GSKCapiCmd is as follows:
gsk8capicmd -certreq -extract {-db <name> | -crypto <module_name> -tokenlabel
<token_label>} [-pw <passwd> | -stashed] [-type <cms | kdb| pkcs12 | p12>]
-label <label> -target <name> [-secondaryDB <filename>
-secondaryDBpw <password> -secondaryDBtype <cms | kdb| pkcs12 | p12>]
where:
object -certreq
action -extract
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-token_label <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the –db or
–tokenlabel tags. Specify a hyphen (-) as the password to cause the
program to read the password from stdin. This allows you to pipe
in the password.
48
-stashed
The password for the key database will be recovered from the
stash file.
-type <cms | kdb | pkcs12 | p12>
The keystore type. If this option is not specified, the program will
use the database path name suffix to determine the keystore type.
-label <label>
Label attached to the certificate request that is to be extracted.
-target <name>
Destination file to which the certificate request is to be extracted.
-secondaryDB <filename>
A CMS key database used to support the PKCS#11 device. A
PKCS#11 device does not normally have a large amount of space
available to store a lot of signer certificates. The signer certificates
are used for the validation of certificates when they are added to
the PKCS#11 device.
-secondaryDBpw <password>
Password for the secondary CMS key database supporting the
PKCS#11 device.
-secondaryDBtype <cms | kdb| pkcs12 | p12>
Keystore type of the secondary key database.
The syntax for listing the certificate requests stored within an existing key database
with GSKCapiCmd is as follows:
gsk8capicmd -certreq -list { -db <name> | -crypto <module_name> -tokenlabel
<token_label>} [-pw <passwd> | -stashed] [-type <cms | kdb| pkcs12 | p12>]
[-secondaryDB <filename> -secondaryDBpw <password> -secondaryDBtype
<cms | kdb| pkcs12 | p12>] [-v]
where:
object -certreq
action -list
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the –db tag or the
where:
object -certreq
action -recreate
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
50
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-type <cms | kdb | pkcs12 | p12>
The keystore type. If this option is not specified, the program will
use the database path name suffix to determine the keystore type.
-pw <passwd>
The password for the key database identified by the –db tag or the
-crypto tag. Specify a hyphen (-) as the password to cause the
program to read the password from stdin. This allows you to pipe
in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-label <label>
Label attached to the certificate request that is to be recreated.
-target <name>
Destination file to which the certificate request is to be recreated.
-secondaryDB <filename>
A CMS key database used to support the PKCS#11 device. A
PKCS#11 device does not normally have a large amount of space
available to store a lot of signer certificates. The signer certificates
are used for the validation of certificates when they are added to
the PKCS#11 device.
-secondaryDBpw <password>
Password for the secondary CMS key database supporting the
PKCS#11 device.
-secondaryDBtype <cms | kdb| pkcs12 | p12>
Keystore type of the secondary key database.
-san_dnsname <name>
The Subject Alternative Name (SAN) DNS name(s) for the entry
being created.
-san_emailaddr <address>
The Subject Alternative Name (SAN) email address(es) for the
entry being created. Multiple values can be separated with
commas.
-san_ipaddr <address>
The Subject Alternative Name (SAN) IP address(es) for the entry
being created.
-certpolicy <policy>
The certificate policy. A named set of rules limiting the
applicability of the certificate. Multiple values can be separated
with commas.
-ku <list>
Key usage property list. Specifies the valid uses for the private key
or certificate.
52
Chapter 5. Secret Key commands
Note: : “-cert –list” and “–cert –details” will function on secret keys providing
information regarding the specific secret key. Use the -secretkey option when
listing information about secret keys to suppress displaying the actual secret
key.
The syntax for creating a random secret key in an existing key database with
GSKCapiCmd is as follows:
gsk8capicmd -secretkey -create {-db <name> -type <cms | kdb| pkcs12 |
p12> -crypto <module_name> -tokenlabel <token_label>} [-pw <passwd> |
-stashed] -label <label> -size <key length in bytes> [-secondaryDB
<filename> -secondaryDBpw <password> -secondaryDBtype <cms | kdb|
pkcs12 | p12>]
where:
object -secretkey
action -create
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-type <cms | kdb | pkcs12 | p12>
The type of the key database. If this option is not present, the type
is implied by the file extension of database path name.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the -db or
-tokenlabel tags. Specify a hyphen (-) as the password to cause the
program to read the password from stdin. This allows you to pipe
in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-label <label>
Label attached to the key.
© Copyright IBM Corp. 2005, 2018 53
-size <key length>
Key length in bytes.
-secondaryDB <filename>
A CMS key database used to support the PKCS#11 device.
-secondaryDBpw <password>
Password for the secondary CMS key database supporting the
PKCS#11 device.
-secondaryDBtype <cms | kdb| pkcs12 | p12>
Keystore type of the secondary key database.
where:
object -secretkey
action -add
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-type <cms | kdb | pkcs12 | p12>
Type of the key database. If this option is not present, the type is
implied by the file extension of database path name.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the -db or
-tokenlabel tags. Specify a hyphen (-) as the password to cause the
program to read the password from stdin. This allows you to pipe
in the password.
-stashed
The password for the key database will be recovered from the
stash file.
-label <label>
Label attached to the key.
file <name>
File name of the key to add.
54
-format <ascii | binary>
Format of a certificate The default is Base64 encoded ASCII.
Additional information about Base64 encoding can be found in
RFC 2045 and RFC 3548. The binary format is a binary dump of
key.
-secondaryDB <filename>
A CMS key database used to support the PKCS#11 device.
-secondaryDBpw <password>
Password for the secondary CMS key database supporting the
PKCS#11 device.
-secondaryDBtype <cms | kdb| pkcs12 | p12>
Keystore type of the secondary key database.
The syntax to extract a secret key from an existing key database with
GSKCapiCmd is as follows:
gsk8capicmd -secretkey -extract {-db <name> | -crypto <module_name>
-tokenlabel <token_label>} [-pw <passwd> | -stashed] -label <label>
-target <name> [-format <ascii | binary>] [-secondaryDB <filename>
-secondaryDBpw <password> -secondaryDBtype <cms | kdb| pkcs12 | p12>]
where:
object -secretkey
action -extract
options
IMPORTANT: Read the section "“Shell and command line interpretation”
on page 3" before continuing.
-db <filename>
The fully qualified path name of a key database.
-crypto <module_name>
Indicates a PKCS#11 cryptographic device operation, where
<module_name> is the path to the module to manage the crypto
device.
-tokenlabel <token_label>
The PKCS#11 cryptographic device token label.
-pw <passwd>
The password for the key database identified by the -db or
-tokenlabel tags. Specify a hyphen (-) as the password to cause the
program to read the password from stdin. This allows you to pipe
in the password.
-stashed
The password for the key database will be recovered from the
stash file.
56
Chapter 6. Random commands
The GSKCapiCmd program provides its users with the ability to generate random
passwords. Users can specify the password length and whether the generated
password is required to conform to GSKits minimum password requirements.
The random commands are associated with the -random object. This object
supports the following action:
The following section describes how to use and what options are available for this
random action.
where:
object -random
action -create
options
-length <password_length>
The length of the random password. There is a maximum length
when the -strong tag is used for this command. The maximum
length is 125 character.
-strong
Check that the password entered satisfies the minimum
requirements for the passwords strength. The minimum
requirements for a password are as follows:
v The minimum password length is 14 characters.
v A password must have at least one lower case character, one
uppercase character, and one digit or special character (for
example, *$#% etc). A space is classified as a special character.
v Each character must not occur more than three times in a
password.
v No more than two consecutive characters of the password can be
identical.
v All characters are in the standard ASCII printable character set
within the range from 0x20 to 0x7E inclusive.
Additionally the specific operating environment of the installation
should be considered. For example sites where the backup
58
Chapter 7. Help commands
GSKCapiCmd has an extensive help command system. You are able to get help on
what objects are available, what actions are associated with a particular object, and
how to use each of the actions.
The help commands are associated with the -help object. The syntax for the help
commands is as follows:
gsk8capicmd -help <object> <action>
where:
<object>
The object you want to find out information about.
<action>
The action you are wanting to find out information about. This action must
be associated with the identified object. If it is not the system will display
the help associated with the requested object.
Examples:
v Listing all of the objects and their associated actions: gsk8capicmd -help
v Listing the actions for the -keybd object: gsk8capicmd -help -keydb
v Listing the specific help for the -create action associated with the -keydb object.
gsk8capicmd -help -keydb -create
To find out the different objects and their associated actions see:
v Chapter 2, “Key database commands,” on page 7
v Chapter 3, “Certificate commands,” on page 17
v Chapter 4, “Certificate request commands,” on page 43
The version command is associated with the -version object. The syntax is as
follows:
gsk8capicmd -version
64
Table 6. Runtime Messages (continued)
Message ID Message Details Explanation
CTGSK2048W The validity period does not include See message.
today or does not fall within its issuer's
validity period.
CTGSK2049W An error occurred while validating See message.
validity private key usage extension.
CTGSK2050W The issuer of the key was not found. See message.
CTGSK2051W A required certificate extension is See message.
missing.
CTGSK2052W An invalid basic constraint extension See message.
was found.
CTGSK2053W The key signature validation failed. See message.
CTGSK2054W The root key of the key is not trusted. See message.
CTGSK2055W The key has been revoked. See message.
CTGSK2056W An error occurred while validating See message.
authority key identifier extension.
CTGSK2057W An error occurred while validating See message.
private key usage extension.
CTGSK2058W An error occurred while validating See message.
subject alternative name extension.
CTGSK2059W An error occurred while validating See message.
issuer alternative name extension.
CTGSK2060W An error occurred while validating key See message.
usage extension.
CTGSK2061W An unknown critical extension was See message.
found.
CTGSK2062W An error occurred while validating key See message.
pair entries.
CTGSK2063W An error occurred while validating CRL. See message.
CTGSK2064W A mutex error occurred. See message.
CTGSK2065W An invalid parameter was found. See message.
CTGSK2066W A null parameter or memory allocation See message.
error was encountered.
CTGSK2067W Number or size is too large or too small. See message.
CTGSK2068W The old password is invalid. See message.
CTGSK2069W The new password is invalid. See message.
CTGSK2070W The password has expired. See message.
CTGSK2071W A thread related error occurred. See message.
CTGSK2072W An error occurred while creating See message.
threads.
CTGSK2073W An error occurred while a thread was See message.
waiting to exit.
CTGSK2074W An I/O error occurred. See message.
CTGSK2075W An error occurred while loading CMS. See message.
CTGSK2076W A cryptography hardware related error See message.
occurred.
66
Table 6. Runtime Messages (continued)
Message ID Message Details Explanation
CTGSK2106W No request key was found. See message.
CTGSK2107W No trusted CA was found See message.
CTGSK2108W No request key was found for the See message.
certificate.
CTGSK2109W There is no private key in the key See message.
database
CTGSK2110W There is no default key in the key See message.
database.
CTGSK2111W There is no private key in the key See message.
record.
CTGSK2112W There is no certificate in the key record. See message.
CTGSK2113W There is no CRL entry. See message.
CTGSK2114W An invalid key database file name was See message.
found.
CTGSK2115W An unrecognized private key type was See message.
found.
CTGSK2116W An invalid distinguished name input See message.
was found.
CTGSK2117W No key entry was found that has the See message.
specified key label.
CTGSK2118W The key label list has been corrupted. See message.
CTGSK2119W The input data is not valid PKCS#12 See message.
data.
CTGSK2120W The password is invalid or the PKCS#12 See message.
data has been corrupted or been created
with a later version of PKCS#12.
CTGSK2121W An unrecognized key export type was See message.
found.
CTGSK2122W An unsupported password-based See message.
encryption algorithm was found.
CTGSK2123W An error occurred while converting the See message.
key ring file to a CMS key database.
CTGSK2124W An error occurred while converting the See message.
CMS key database to a keyring file.
CTGSK2125W An error occurred while creating a See message.
certificate for the certificate request.
CTGSK2126W A complete issuer chain cannot be built. See message.
CTGSK2127W Invalid WEBDB data was found. See message.
CTGSK2128W There is no data to be written to the key See message.
ring file.
CTGSK2129W The number of days that you entered See message.
extends beyond the permitted validity
period.
CTGSK2130W The password is too short. See message.
CTGSK2131W A password must contain at least one See message.
numeric digit.
68
Table 6. Runtime Messages (continued)
Message ID Message Details Explanation
CTGSK3001W Cannot load keystore: filename The nominated keystore cannot
be opened.
Operator response:The
password must be reset before
the keystore can be opened.
CTGSK3008W The entry for label "name" could not be An attempt to delete an object
deleted. from a database failed.
70
Table 6. Runtime Messages (continued)
Message ID Message Details Explanation
CTGSK3018W The action "name" is not supported for The attempted action was not
database type "other". supported for the database.
72
Table 6. Runtime Messages (continued)
Message ID Message Details Explanation
CTGSK3033W No read permissions for file "name" The file cannot be accessed.
Operator response:Choose a
different name or delete the file
if it is no longer required.
CTGSK3037W The output file "name" could not be A file could not be created.
created.
Operator response: Check the
file path and ensure that you
have read/write permissions to
the directory.
CTGSK3038W An error occurred while trying to The changed password could
change the password of the request not be written to the password
database. stash file.
74
Table 6. Runtime Messages (continued)
Message ID Message Details Explanation
CTGSK3049W An attempted operation has failed: name An unexpected internal error
other : detail occurred.
76
Chapter 10. Error codes and messages
GSKCapiCmd, returns GSKKM_OK (0) on success or a positive number indicating
the error that has occurred. The following table lists all of the error codes and their
associated error messages.
Table 7. Error Messages
Error Code Error Message
1 Unknown error occurred
2 An asn.1 encoding/decoding error occurred.
3 An error occurred while initializing asn.1 encoder/decoder.
4 An asn.1 encoding/decoding error occurred because of an out-of-range index
or non-existent optional field.
5 A database error occurred.
6 An error occurred while opening the database file, check for file existence and
permission.
7 An error occurred while re-opening the database file.
8 Database creation failed.
9 The database already exists.
10 An error occurred while deleting the database file.
11 The database could not be opened.
12 An error occurred while reading the database file.
13 An error occurred while writing data to the database file.
14 A database validation error occurred.
15 An invalid database version was encountered.
16 An invalid database password was encountered.
17 An invalid database file type was encountered.
18 The specified database has been corrupted.
19 An invalid password was provided or the key database has been tampered or
corrupted.
20 A database key entry integrity error occurred.
21 A duplicate certificate already exists in the database.
22 A duplicate key already exists in the database (Record ID).
23 A certificate with the same label already existed in the key database.
24 A duplicate key already exists in the database (Signature).
25 A duplicate key already exists in the database (Unsigned Certificate).
26 A duplicate key already exists in the database (Issuer and Serial Number).
27 A duplicate key already exists in the database (Subject Public Key Info).
28 A duplicate key already exists in the database (Unsigned CRL).
29 The label has been used in the database.
30 A password encryption error occurred.
31 An LDAP related error occurred.
78
Table 7. Error Messages (continued)
Error Code Error Message
70 The password has expired. (deprecated)
71 A thread related error occurred.
72 An error occurred while creating threads.
73 An error occurred while a thread was waiting to exit.
74 An I/O error occurred.
75 An error occurred while loading CMS.
76 A cryptography hardware related error occurred.
77 The library initialization routine was not successfully called.
78 The internal database handle table is corrupted.
79 A memory allocation error occurred.
80 An unrecognized option was found.
81 An error occurred while getting time information.
82 Mutex creation error occurred.
83 An error occurred while opening message catalog.
84 An error occurred while opening error message catalog.
85 A null file name was found.
86 An error occurred while opening files, check for file existence and
permissions.
87 An error occurred while opening files to read.
88 An error occurred while opening files to write.
89 There is no such file.
90 The file cannot be opened because of its permission setting.
91 An error occurred while writing data to files.
92 An error occurred while deleting files.
93 Invalid Base64-encoded data was found.
94 An invalid Base64 message type was found.
95 An error occurred while encoding data with Base64 encoding rule.
96 An error occurred while decoding Base64-encoded data.
97 An error occurred while getting a distinguished name tag.
99 The required country or region name field is empty.
100 An invalid database handle was found.
101 The key database does not exist.
102 The request key pair database does not exist.
103 The password file does not exist.
104 The new password is identical to the old one.
105 No key was found in the key database.
106 No request key was found.
107 No trusted CA was found
108 No request key was found for the certificate.
109 There is no private key in the key database
80
Table 7. Error Messages (continued)
Error Code Error Message
148 A revoked certificate was encountered.
149 A cryptographic object function failed.
150 There is no certificate revocation list data source available.
151 There is no cryptographic token available.
152 FIPS mode is not available.
153 There is a conflict with the FIPS mode settings.
154 The password entered does not meet the minimum required strength.
200 There was a failure during initialization of the program.
201 Tokenization of the arguments passed to the GSKCapiCmd Program failed.
202 The object identified in the command is not a recognized object.
203 The action passed is not a known -keydb action.
204 The action passed is not a known -cert action.
205 The action passed is not a known -certreq action.
206 There is a tag missing for the requested command.
207 The value passed with the –version tag is not a recognized value.
208 The value passed with the –size tag is not a recognized value.
209 The value passed in with the –dn tag is not in the correct format.
210 The value passed in with the –format tag is not a recognized value.
211 There was an error associated with opening the file.
212 PKCS#12 is not supported at this stage.
213 The cryptographic token you are trying to change the password for is not
password protected.
214 PKCS#12 is not supported at this stage.
215 The password entered does not meet the minimum required strength.
216 FIPS mode is not available.
217 The number of days you have entered as the expiry date is out of the allowed
range.
218 Password strength failed the minimum requirements.
219 No Default certificate was found in the requested key database. (deprecated)
220 An invalid trust status was encountered.
221 An unsupported signature algorithm was encountered. At this stage only MD5
and SHA1 are supported.
222 PKCS#11 not supported for that particular operation.
223 The action passed is not a known –random action.
224 A length than less than zero is not allowed.
225 When using the –strong tag the minimum length password is 14 characters.
226 When using the –strong tag the maximum length password is 300 characters.
227 The MD5 algorithm is not supported when in FIPS mode.
228 The site tag is not supported for the –cert –list command. This attribute is
simply added for backward compatibility and potential future enhancement.
82
Appendix A. CMS key databases
What is a CMS key database?
Certificate Management System (CMS) is the native GSKit key database (keystore)
containing:
v X.509 certificates
v Certificate requests (ones pending signing by an authority), and
v Private keys for the stored certificates where applicable.
Typically, only personal certificates contain private keys. If a certificate has an
associated private key, it is stored encrypted in the keystore with its associated
certificate. Private keys cannot be stored without an associated certificate.
A key record in a .kdb file is either a certificate on its own or a certificate plus its
encrypted private key information. Private keys cannot be stored in a CMS
keystore without a corresponding certificate.
When a certificate request is created, a .rdb file with the same file stem as the key
database file is created. This file is used to store the requested key pair, along with
the PKCS#10 certificate request data. The request entry is only deleted from the
request key database when a signed certificate is obtained from a signing authority
and received into the key database. The signed certificate is matched up with the
private key in the .rdb file and together they are added to the .kdb file as a
certificate with private key information.
A .crl file is also created, purely for legacy reasons (in the past it contained
Certificate Revocation Lists (CRLs)). This file is no longer used and is always
empty.
The access control does not limit unauthorized users from reading and writing the
file. GSKit relies on the OS for these protections, but access to sensitive data is
effectively controlled because all sensitive data in the keystore is encrypted, all
records hashed, and the index to all records is hashed. This ensures that any
modification to the file is detectable. If tampering is detected, GSKit will deny
access to the keystore (the behaviour is similar to receipt of an incorrect password).
What is a label?
A label is a friendly name that an administrator can attach to a certificate that is
contained in a CMS keystore. It is a convenient, human readable way to refer to a
certificate. Only the UTF-8 character set is supported for keystore labels. Use of
characters outside of UTF-8 is unsupported and behaviour is undefined.
84
How can I manipulate certificates in a CMS keystore?
Certificates in a CMS keystore are standard X.509 certificates. X.509 entities can be:
v imported (for personal certificates),
v added (for a certificate needed in a validation chain such as a CA or
intermediate certificate),
v exported (from one CMS keystore to another - this takes the private key with it
if one exists), or
v extracted (extract the public certificate – the private key is not extracted).
The requirement
The ACME company wishes to set up a web site for its employees to access certain
sensitive business information across a wide geographical area. Some employees
are more senior than others and therefore will be allowed access to more resources
on the server than the junior employees. It is expected that employees can be
assured they are connecting to their company web site (not some fraudulent site
pretending to be their company site). Employees use a customized web browser
that can read CMS keystores to access certificates contained in them.
The CEO of ACME has asked the system administrator to implement this system
in a manner that is secure and cost conscious.
88
5. Upon receipt of each employee's certificate request the administrator signs it
and returns the signed certificate to the employee. The administrator uses the
“Sign a Certificate” command to achieve this:
gsk8capicmd -cert -sign -db acme.kdb -pw offs64b -label acmeCert -file
DavesCertReq.arm -expire 365 -target DavesSignedCert.arm -sigalg sha1
6. As each employee obtains their signed certificate they receive it into their CMS
keystore. Employees use the “Receive a Certificate” command:
gsk8capicmd -cert -receive -file DavesSignedCert.arm -db Dave.kdb -pw Davepwd
7. Make the new certificate the default one. This means that it will be the
certificate sent to the web server when it requests one via SSL for client
authentication purposes. The employee makes it the default certificate using the
following command:
gsk8capicmd -cert -setdefault -db Dave.kdb -pw Davepwd -label myCert
Each employee has a CMS keystore containing the CA certificate, the ACME
Intermediate Certificate (minus the corresponding private key), and their own
certificate that has been signed by the ACME Intermediate Certificate.
The remaining task for the administrator is to create a CMS keystore with a
certificate to be used by the web server. Although the administrator could have
used the ACME Intermediate Certificate for this purpose, as stated previously, it is
considered bad practice to use a certificate for more than one purpose. The
intermediate certificate is already being used to sign employees' certificates. To
create a keystore and server certificate the administrator performs the following
actions:
1. The administrator creates a new CMS keystore using the “Create a Key
Database” command:
gsk8capicmd -keydb -create -db acmeWebServer.kdb -pw ejed43dA
2. The administrator adds the CA certificate to the keystore using the “Add a
Certificate command:
gsk8capicmd -cert -add -db acmeWebServer.kdb -pw ejed43dA -label OurCA -file
CACert.arm –format ascii
3. The administrator creates a new certificate request to be sent to the CA that he
has chosen to sign our web server certificate using the “Create a Certificate
Request” command:
gsk8capicmd -certreq -create -db acmeWebServer.kdb –pw ejed43dA -label
OurServerCert -dn “CN=web.acme.com,O=acme,C=US” -file serverCertReq.arm
-sigalg sha1
4. The administrator takes the request file (serverCertReq.arm in this case) and
sends it to the CA for signing. Sometime later the signed certificate is returned
by the CA. The administrator then receives the certificate into the CMS
keystore using the “Receive a Certificate command:
gsk8capicmd -cert -receive -file signedServerCert.arm -db acmeWebServer.kdb
-pw ejed43dA
5. Make the new certificate the default one. This means that when a client
connects to the web server the server will offer this certificate to the client. The
administrator makes it the default certificate using the following command:
90
Appendix C. Troubleshooting
Use this troubleshooting information to help resolve any certificate management
problems that you encounter.
A common error is to forget to install some certificates on the chain. There might
be one or more certificates in the chain that are missing or invalid. For example,
expired certificates.
You can use the following command to check a certificate chain that is in the
keystore:
gskcapicmd -cert -validate -db key.kdb -pw **** -label endentity
You can use the following command to list a certificate chain from a selected label
to the trusted root certificate:
gskcapicmd -cert -list -db key.kdb -pw **** -label endentity
You can find the name of the certificate issuer by listing the certificate details with
the following command:
gskcapicmd -cert -details -db key.kdb -pw **** -label endentity
Case sensitivity
GSKit is fully case-sensitive on its certificate label lookups. Other tools such as
iKeyman, OpenSSL for PKCS12 keystores, and PKCS11 vendor tools might be able
to process keystores. These tools might not be case-sensitive. Some tools might
even change the case of the key and certificate label names when displaying them.
It is important to use the case-sensitive name exactly as displayed by gskcapicmd,
which is the native GSKit utility for managing keystores.
You can list all certificate labels with the following command:
gskcapicmd -cert -list -db key.kdb -pw ****
DER encoding is defined in the specification ITU-T Rec. X.690 (2002). See the
Internet RFC/STD/FYI/BCP Archives http://www.faqs.org/rfcs.
X.509
RFC 3280: Internet X.509 Public Key Infrastructure - Certificate and Certificate
Revocation List (CRL), obsoletes RFC 2459, April 2002. See RSA Security
http://www.rsasecurity.com/rsalabs/.
PKCS#7
PKCS#10
RFC 2986: PKCS #10: Certification Request Syntax Specification, Version 1.7,
November 2000.
PKCS#11
PKCS#12
PKCS 12 v1.0: Personal Information Exchange Syntax, RSA Laboratories, June 24,
1999.
This section covers some of the FIPS considerations when using the gskcapicmd
tool
Warning: When using the utility, ensure that the user or application only uses FIPS
approved algorithms to be FIPS compliant. For example, do not use MD5 for hash
and signature functions.
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not give you
any license to these patents. You can send license inquiries, in writing, to:
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
Any references in this information to non-IBM Web sites are provided for
convenience only and do not in any manner serve as an endorsement of those Web
sites. The materials at those Web sites are not part of the materials for this IBM
product and use of those Web sites is at your own risk.
Licensees of this program who wish to have information about it for the purpose
of enabling: (i) the exchange of information between independently created
programs and other programs (including this one) and (ii) the mutual use of the
information which has been exchanged, should contact:
IBM Corporation
2Z4A/101
11400 Burnet Road
Austin, TX 78758 U.S.A.
The licensed program described in this document and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Program License Agreement or any equivalent agreement
between us.
All statements regarding IBMs future direction or intent are subject to change or
withdrawal without notice, and represent goals and objectives only.
This information is for planning purposes only. The information herein is subject to
change before the products described become available.
This information contains examples of data and reports used in daily business
operations. To illustrate them as completely as possible, the examples include the
names of individuals, companies, brands, and products. All of these names are
fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
COPYRIGHT LICENSE:
98
been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or
imply reliability, serviceability, or function of these programs. You may copy,
modify, and distribute these sample programs in any form without payment to
IBM for the purposes of developing, using, marketing, or distributing application
programs conforming to IBMs application programming interfaces.
Each copy or any portion of these sample programs or any derivative work, must
include a copyright notice as follows:
© (your company name) (year). Portions of this code are derived from IBM Corp.
Sample Programs. © Copyright IBM Corp. _enter the year or years_. All rights
reserved.
If you are viewing this information in softcopy form, the photographs and color
illustrations might not be displayed.
Trademarks
IBM, the IBM logo, AIX, DB2®, IBMLink, Tivoli, Tivoli Enterprise Console®, and
TME are trademarks or registered trademarks of International Business Machines
Corporation in the United States, other countries, or both.
Adobe, the Adobe logo, Acrobat, PostScript and all Adobe-based trademarks are
either registered trademarks or trademarks of Adobe Systems Incorporated in the
United States, other countries, or both.
Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino logo,
Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or
registered trademarks of Intel Corporation or its subsidiaries in the United States
and other countries.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of
Microsoft Corporation in the United States, other countries, or both.
Appendix F. Notices 99
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Other company, product, and service names may be trademarks or service marks
of others.
100
Appendix F. Notices 101
IBM®
Printed in USA