GSK CapiCmd UserGuide
GSK CapiCmd UserGuide
GSKit version 8
IBM Global Security Kit
GSKit version 8
Note
Before using this information and the product it supports, read the information in Appendix D, “Notices,” on page 89.
This edition applies to GSKCapiCmd version 8.0.14 and to all subsequent releases and modifications until otherwise
indicated in new editions.
© Copyright IBM Corporation 2005, 2011.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract
with IBM Corp.
Contents
Preface . . . . . . . . . . . . . . . v List the certificates stored in a keystore (-list) . . . 35
Who should read this book . . . . . . . . . v Modify a certificate in a keystore (-modify) . . . . 37
Accessibility . . . . . . . . . . . . . . v Sign a certificate (-sign) . . . . . . . . . . 38
IBM and accessibility . . . . . . . . . . v Validate a certificate (-validate) . . . . . . . . 40
Contacting software support . . . . . . . . . v
Conventions used in this book . . . . . . . . vi Chapter 4. Certificate request
Typeface conventions . . . . . . . . . . vi commands . . . . . . . . . . . . . 43
Operating system differences . . . . . . . vi Create a certificate request (-create) . . . . . . 43
Delete certificate request (-delete) . . . . . . . 45
Chapter 1. Using the GSKCapiCmd List certificate request details (-details) . . . . . 46
program. . . . . . . . . . . . . . . 1 Extract certificate request (-extract) . . . . . . 48
Language support overview . . . . . . . . . 1 List all certificate requests (-list) . . . . . . . 49
Locale environment variables . . . . . . . . 1 Re-create certificate requests (-recreate) . . . . . 50
LANG variable on UNIX or Linux systems . . . 1
Forcing output to a different locale . . . . . . 2 Chapter 5. Random commands . . . . 53
Using locale variants . . . . . . . . . . 2 Create a random password of a specified length
Text encoding (code set) support. . . . . . . 3 (-create) . . . . . . . . . . . . . . . 53
KeyStore Overview . . . . . . . . . . . . 3
GSKCapiCmd command-line syntax . . . . . . 4 Chapter 6. Help commands . . . . . . 55
Chapter 2. Key database commands . . 7 Chapter 7. Version command . . . . . 57
Keystore access control . . . . . . . . . . . 7
Create a key database (-create) . . . . . . . . 8
Delete a key database (-delete) . . . . . . . . 10
Chapter 8. Runtime messages. . . . . 59
Change the password of an existing key database
(-changepw) . . . . . . . . . . . . . . 10 Chapter 9. Error codes and messages 73
Stash the password of an existing key database
(-stashpw) . . . . . . . . . . . . . . . 12 Appendix A. CMS key databases . . . 79
List the supported key databases (-list) . . . . . 12 What is a CMS key database? . . . . . . . . 79
Convert a key database (-convert) . . . . . . . 13 How is a CMS key database organized? . . . . . 79
Display the expiry date associated with a key How is a CMS key database protected . . . . . 79
database (-expiry) [deprecated] . . . . . . . . 14 What can I put in a CMS key database? . . . . . 80
What is a label? . . . . . . . . . . . . . 80
Chapter 3. Certificate commands . . . 17 How can I manipulate certificates in a CMS
Signature algorithms . . . . . . . . . . . 17 keystore? . . . . . . . . . . . . . . . 80
Information about key sizes . . . . . . . . . 18
Information about elliptic curves . . . . . . . 18 Appendix B. A Simple Example . . . . 83
Suite B algorithm and key size selection . . . . . 18 The requirement . . . . . . . . . . . . . 83
Create a self-signed certificate in a keystore (-create) 19 Considerations for the administrator . . . . . . 83
Add a certificate to a keystore (-add) . . . . . . 21 Step 1 – Obtain a company-wide intermediate
Delete a certificate from a keystore (-delete) . . . 23 certificate . . . . . . . . . . . . . . . 83
Display details of a certificate (-details) . . . . . 24 Step 2 – Sign all employee certificates using the
Export a certificate (-export) . . . . . . . . . 26 ACME intermediate . . . . . . . . . . . 84
Receive a certificate into a keystore (-receive) . . . 27 Step 3. Create the web server certificate . . . . . 85
Import a certificate (-import) . . . . . . . . 28 So do we meet the requirements? . . . . . . . 86
Extract a certificate from a keystore (-extract) . . . 30
List details of the default certificate (-getdefault) Appendix C. Resources . . . . . . . 87
[deprecated] . . . . . . . . . . . . . . 32
Set default certificate in a keystore (-setdefault)
[deprecated] . . . . . . . . . . . . . . 33 Appendix D. Notices . . . . . . . . . 89
Rename a certificate in a keystore (-rename) . . . 34 Trademarks . . . . . . . . . . . . . . 91
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 79.
v Appendix B, “A Simple Example,” on page 83.
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 C, “Resources,” on page 87.
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.
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. The
KeyStore used maybe one of a number of supported formats. The following table
lists the format and relevant capabilities:
Footnotes:
v 1IBM Proprietary Format
v 2PKCS#12 Format transparently supported and interchanged with CMS format
by GSKit
v 3PKCS#11 Format
v 4Microsoft Key Store
v 5Deprecated
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 program runs in FIPS mode by default. If however the -fips
true is set and the provider cannot be initialized in FIPS mode then
the gsk8capicmd operation will fail. If FIPS mode is not forced and
the provider cannot be initialized in FIPS mode then the utility will
fall back to a non-fips mode of operation.
-locale <language>
Set the display language preference.
-trace <pathname>
Enable trace logging to the named file.
object Is one of the following:
-keydb
Actions acted on a key database.
-cert Actions acted on a certificate stored within an identified key
database.
-certreq
Actions acted on a certificate request stored within an identified
key database.
-random
Generates a random string of characters that can be used as a
password for other commands.
-version
Displays version information for GSKCapiCmd.
-help Displays help for the GSKCapiCmd commands.
action Is the specific action to be taken on the object.
options Are the options associated with the specified object and task.
4
The following chapters of this manual describe each particular object, its associated
actions, and what options are available.
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 "calcs" on Windows 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
administrator to manually enter the password to open a keystore. When accessing
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 "calcs" on
Windows or "chmod" on UNIX operating systems.
where:
object -keydb
action -create
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
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).
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: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
The syntax for changing the password of an existing key database with
GSKCapiCmd is as follows:
10
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]
where:
object -keydb
action -changepw
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
The syntax for stashing the password of an existing key database with
GSKCapiCmd is as follows:
gsk8capicmd -keydb -stashpw -db <name> [-pw <passwd>]
where:
object -keydb
action -stashpw
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
The syntax for listing the key databases supported by GSKCapiCmd is as follows:
gsk8capicmd -keydb –list [-crypto <driver_name> | -db <name>]
where:
object -keydb
action -list
12
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.
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]
where:
object -keydb
action -convert
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
14
The syntax for displaying the expiry of the password associated with a key
database with GSKCapiCmd is as follows:
gsk8capicmd -keydb -expiry -db <name> -type <cms | kdb| pkcs12 | p12>
[-pw <passwd>]
where:
object -keydb
action -expiry (Deprecated.)
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
IMPORTANT: An expiry of 0 means that the password associated with the key
database does not expire.
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 | sha384 | SHA384_WITH_RSA | SHA384WithRSA |
SHA3WithRSA | sha512 | SHA512_WITH_RSA | SHA512WithRSA | SHA5WithRSA |
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
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 |
SHA2WithRSA | sha384 | SHA384_WITH_RSA | SHA384WithRSA |
SHA3WithRSA | sha512 | SHA512_WITH_RSA | SHA512WithRSA |
SHA5WithRSA
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
18
Create a self-signed certificate in a keystore (-create)
A self-signed certificate provides a certificate that can be used for testing while
waiting for the officially signed certificate to be returned from the CA. Both a
private and public key are created during this process.
The 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>]
[-ca <true | false>] [{-sigalg | -sig_alg} <algorithm_name>] [-ca_label
<label>] [-san_dns_name <name>] [-san_emailaddr <address>] [-san_ipaddr
<address>] [-certpolicy <policy>] [-eku <name>]
where:
object -cert
action -create
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string 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).
20
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>
The type of the secondary key database.
-ca <true | false>
This tag adds the Basic Constraint extension to the self-signed
certificate. The Basic Constraint extension value is set to true or
false depending on what value is associated with the tag.
-san_dns_name <name>
The SAN DNS name(s) for the entry being created.
-san_emailaddr <address>
The SAN email address(es) for the entry being created.
-san_ipaddr <address>
The 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.
-eku <list>
Extended key usage property list. Specifies the valid uses for the
certificate.
-sigalg | -sig_alg <signature_algorithm>
The signing algorithm used during the creation of the self-signed
certificate. This algorithm is used to create the signature associated
with the new self-signed certificate. The generated key type is
chosen to match this signing algorithm. See “Signature algorithms”
on page 17 for the allowed values.
-ca_label <label>
The label of the CA key to use to sign the certificate.
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>]
where:
object -cert
22
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.
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: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
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:
24
gsk8capicmd -cert -details [-showOID] {-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 -details
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
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] -label <label>
[-type <cms | kdb| pkcs12 | p12> ] -target <name> [-target_pw <passwd>]
[-target_type <cms | kdb| pkcs12 | p12>] [-encryption <strong | weak>]
where:
object -cert
action -export
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
26
-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_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: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
28
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]
[-label <label>] [-type <cms | kdb| pkcs7 | pkcs12 | p12>] [-pfx ]
{ -target <name> | -crypto <module_name> -tokenlabel <token_label>} [-secondaryDB
<filename> -secondaryDBpw <password> -secondaryDBtype <cms | kdb| pkcs12 | p12>]
[-target_pw <passwd>] [-target_type <cms | kdb| pkcs11 | pkcs12 | p12>]
[-new_label <label>] [-t61]
where:
object -cert
action -import
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
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> -target <name> [-format
<ascii | binary>] [-secondaryDB <filename> -secondaryDBpw <password>
-secondaryDBtype <cms | kdb| pkcs12 | p12>]
30
where:
object -cert
action -extract
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
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: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
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: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
The syntax for changing a certificate label name in an existing key database with
GSKCapiCmd is as follows:
gsk8capicmd -cert -rename {-db <filename> | -crypto <module_name> -tokenlabel
<token_label>} [-pw <passwd> | -stashed] [-type <cms | kdb| pkcs12 | p12>]
-label <label> -new_label <name> [-secondaryDB <filename> -secondaryDBpw
<password> -secondaryDBtype <cms | kdb| pkcs12 | p12>]
where:
object -cert
action -rename
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
34
-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.
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: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
36
Entrust.net Client Certification Authority
Entrust.net Certification Authority (2048)
Entrust.net Secure Server Certification Authority
VeriSign Class 3 Public Primary Certification Authority
VeriSign Class 2 Public Primary Certification Authority
VeriSign Class 1 Public Primary Certification Authority
VeriSign Class 4 Public Primary Certification Authority - G2
VeriSign Class 3 Public Primary Certification Authority - G2
VeriSign Class 2 Public Primary Certification Authority - G2
VeriSign Class 1 Public Primary Certification Authority - G2
VeriSign Class 4 Public Primary Certification Authority - G3
VeriSign Class 3 Public Primary Certification Authority - G3
VeriSign Class 2 Public Primary Certification Authority - G3
VeriSign Class 1 Public Primary Certification Authority - G3
Thawte Personal Premium CA
Thawte Personal Freemail CA
Thawte Personal Basic CA
Thawte Premium Server CA
Thawte Server CA
RSA Secure Server Certification Authority
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: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
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: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
38
-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
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.
40
The syntax for validating a certificate in an existing key database with
GSKCapiCmd is as follows:
gsk8capicmd -cert -validate {-db <filename> | -crypto <module_name> -tokenlabel
<token_label>} [-pw <passwd> | -stashed] [-type <cms | kdb| pkcs12 | p12>]
-label <label> -ldap <location> [-secondaryDB <filename>
-secondaryDBpw <password> -secondaryDBtype <cms | kdb| pkcs12 | p12>]
where:
object -cert
action -validate
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
42
Chapter 4. Certificate request commands
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 46
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>]
[-eku <name>]
where:
object -certreq
action -create
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string 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.
-target | -file <name>
The file name that the certificate request will be extracted to during
the certificate request creation process.
44
Note: "-file <name> continues to operate for this command for
backwards compatibility.
-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_dns_name <name>
The SAN DNS name(s) for the entry being created.
-san_emailaddr <address>
The SAN email address(es) for the entry being created.
-san_ipaddr <address>
The 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.
-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 syntax for deleting a certificate request in an existing key database with
GSKCapiCmd is as follows:
gsk8capicmd -certreq -delete {-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 -delete
options
IMPORTANT: On UNIX operating systems, always encapsulate string
46
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] {-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: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
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: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
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>]
where:
object -certreq
action -list
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
where:
object -certreq
50
action -recreate
options
IMPORTANT: On UNIX operating systems, always encapsulate string
values associated with all tags in double quotation marks (“”). You must
also use a backslash (‘\’) character to escape the following characters if
they appear in the string values:
'!’, '\’, '”’, '’’
52
Chapter 5. 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.
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
60
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.
62
Table 6. Runtime Messages (continued)
Message ID Message Details Explanation
CTGSK2104W The new password is identical to the old See message.
one.
CTGSK2105W No key was found in the key database. See message.
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.
64
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.
66
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.
68
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.
70
Table 6. Runtime Messages (continued)
Message ID Message Details Explanation
CTGSK3049W An attempted operation has failed: name An unexpected internal error
other : detail occurred.
72
Chapter 9. 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.
74
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.
98 The required common name field is empty.
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.
76
Table 7. Error Messages (continued)
Error Code Error Message
147 The root certificate is not trusted.
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.
78
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 simply a convenient, human readable way to
reference a certificate.
80
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.
84
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 -target
DavesCertReq.arm -expire 365 -file 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:
86
Appendix C. Resources
ASN.1 Project
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.
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:
90
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 D. Notices 91
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.
92
Printed in USA