This is a multi-stage test. Click on "done" when you have completed
reading these instructions. For each instruction, make sure the output
from keytool is correct (you can read everything in english fine).
- rm ~/.keystore
If you are on a Windows platform, delete the .keystore file in
your home directory.
- keytool -help
- keytool -genkey -v -keysize 512
Enter "a" for the keystore password. Check error (password too short).
Enter "password" for the keystore password.
Re-enter "password" to confirm.
Hit 'return' for "first and last name", "organizational unit",
"organization", "City", "State", and "Country Code".
Type "yes" when they ask you if everything is correct.
Type 'return' for new key password.
- keytool -list -v -storepass password
- keytool -list -v
Type "a" for the keystore password.
Check error (wrong keystore password).
- keytool -genkey -v -keysize 512
Enter "password" as the password.
Check error (alias 'mykey' already exists).
- keytool -genkey -v -keysize 512 -alias mykey2 -storepass password
Hit 'return' for "first and last name", "organizational unit",
"organization", "City", "State", and "Country Code".
Type "yes" when they ask you if everything is correct.
Type 'return' for new key password.
- keytool -list -v
Type 'password' for the store password.
- keytool -keypasswd -v -alias mykey2 -storepass password
Type "a" for the new key password.
Type "aaaaaa" for the new key password.
Type "bbbbbb" when re-entering the new key password.
Type "a" for the new key password.
Check Error (too many failures).
- keytool -keypasswd -v -alias mykey2 -storepass password
Type "aaaaaa" for the new key password.
Type "aaaaaa" when re-entering the new key password.
- keytool -selfcert -v -alias mykey -storepass password
- keytool -list -v -storepass password
- keytool -export -v -alias mykey -file /tmp/cert -storepass password
- keytool -import -v -file /tmp/cert -storepass password
Check error (Certificate reply and cert are the same)
- keytool -printcert -file /tmp/cert
- keytool -list -storepass password -provider sun.security.provider.Sun
Error tests
- keytool -storepasswd -storepass password -new abc
Check error (password too short)
- keytool -storepasswd -storetype PKCS11 -keystore NONE
Check error (unsupported operation)
- keytool -keypasswd -storetype PKCS11 -keystore NONE
Check error (unsupported operation)
- keytool -list -protected -storepass password
Check error (password can not be specified with -protected)
- keytool -keypasswd -protected -keypass password
Check error (password can not be specified with -protected)
- keytool -keypasswd -protected -new password
Check error (password can not be specified with -protected)
MSCAPI tests (Only run on Windows)
- keytool -storetype Windows-MY -list
should list entries (may be 0) without asking for password
should not show ****** WARNING WARNING WARNING ****** lines
- keytool -storetype Windows-MY -list -keystore NONE
should list entries without asking for password
- keytool -storetype Windows-MY -list -keystore other
Error: storetype must be NONE
- keytool -storetype Windows-MY -list -storepass changeit
Error: storepass cannot be specfied
- keytool -storetype Windows-MY -list -storepasswd
Error: storepasswd not supported
PKCS#11 tests
- sccs edit cert8.db key3.db
- keytool -keystore NONE -storepass test12 -storetype PKCS11 -providerName SunPKCS11-nss -providerClass sun.security.pkcs11.SunPKCS11 -providerArg p11-nss.txt -genkey -alias genkey -dname cn=genkey -keysize 512 -keyalg rsa
- keytool -keystore NONE -storepass test12 -storetype PKCS11 -providerName SunPKCS11-nss -providerClass sun.security.pkcs11.SunPKCS11 -providerArg p11-nss.txt -list
- keytool -keystore NONE -storepass test12 -storetype PKCS11 -providerName SunPKCS11-nss -providerClass sun.security.pkcs11.SunPKCS11 -providerArg p11-nss.txt -list -alias genkey
- keytool -keystore NONE -storepass test12 -storetype PKCS11 -providerName SunPKCS11-nss -providerClass sun.security.pkcs11.SunPKCS11 -providerArg p11-nss.txt -certreq -alias genkey -file genkey.certreq
- keytool -keystore NONE -storepass test12 -storetype PKCS11 -providerName SunPKCS11-nss -providerClass sun.security.pkcs11.SunPKCS11 -providerArg p11-nss.txt -export -alias genkey -file genkey.cert
- keytool -printcert -file genkey.cert
- keytool -keystore NONE -storepass test12 -storetype PKCS11 -providerName SunPKCS11-nss -providerClass sun.security.pkcs11.SunPKCS11 -providerArg p11-nss.txt -selfcert -alias genkey -dname cn=selfCert
- keytool -keystore NONE -storepass test12 -storetype PKCS11 -providerName SunPKCS11-nss -providerClass sun.security.pkcs11.SunPKCS11 -providerArg p11-nss.txt -list -alias genkey -v
(check that cert subject DN is [cn=selfCert])
- keytool -keystore NONE -storepass test12 -storetype PKCS11 -providerName SunPKCS11-nss -providerClass sun.security.pkcs11.SunPKCS11 -providerArg p11-nss.txt -delete -alias genkey
- keytool -keystore NONE -storepass test12 -storetype PKCS11 -providerName SunPKCS11-nss -providerClass sun.security.pkcs11.SunPKCS11 -providerArg p11-nss.txt -list
(check for empty database listing)
- sccs unedit cert8.db key3.db
If all the output (english) is correct, then the test passed.
Otherwise, the test failed.
Press "Pass" if ... press "Fail" otherwise.