Create Client Keystore
A client keystore is used to store a client's private certificate.
Required inputs
- client alias (for example, "myclient")
- key algorithm (for example, "RSA")
- key store filename (for example, "keystore_client")
- key store password (for example, "secretPassword")
- distinguished name to be associated with the certificate
(for example, CN=myclient,OU="my site",O="Acme, Inc.",L="Cary",ST="NC",C="US")
Procedure
- Open a command window
- Ensure that the command window contains the JRE\bin directory in its path
set path=%path%;C:\j2sdk1.4.2_02\bin
- Navigate the command window to a private directory which will contain the client's keystore file
(for example, C:\TomCat\webapps\MyWebApp\private\)
- Create a client keystore which will have a private key associated with it.
- keytool -genkey -alias <client_alias> -keyalg <key_algorithm> -keystore <keystore_filename>
(for example, keytool -genkey -alias myclient -keyalg RSA -keystore keystore_client )
- Enter keystore password: secretPassword <Return>
- What is your first and last name?
[Unknown]: myclient <Return>
- What is the name of your organizational unit?
[Unknown]: my site <Return>
- What is the name of your organization?
[Unknown]: Acme, Inc. <Return>
- What is the name of your City or Locality?
[Unknown]: Cary <Return>
- What is the name of your State or Province?
[Unknown]: NC <Return>
- What is the two-letter country code for this unit?
[Unknown]: US <Return>
- Is CN=myserver, OU="my site", O="Acme, Inc.", L=Cary, ST=NC, C=US correct?
[no]: yes <Return>
- Enter key password for <myserver>
(RETURN if same as keystore password): <Return>
- Verify creation of the client's keystore file keystore_client.
- The client's public
certificate can now be exported from the keystore.