keytool is a key and certificate management utility. It enables users to administer their own public/private key pairs and associated certificates for use in self-authentication. keytool stores the keys and certificates in a so-called keystore. Manages a keystore (database) of private keys and their associated X.509.
A certificate is a digitally signed statement from one entity (person, company, etc.), saying that the public key (and some other information) of some other entity has a particular value.
X.500 Distinguished Names are used to identify entities, such as those which are named by the subject and issuer (signer) fields of X.509 certificates. keytool supports the following subparts:
- commonName - common name of a person, e.g., "Susan Jones"
- organizationUnit - small organization (e.g, department or division) name, e.g., "Purchasing"
- organizationName - large organization name, e.g., "ABCSystems, Inc."
- localityName - locality (city) name, e.g., "Palo Alto"
- stateName - state or province name, e.g., "California"
- country - two-letter country code, e.g., "CH"
When supplying a distinguished name string as the value of a -dname option, as for the -genkey or -selfcert commands, the string must be in the following format:
CN=cName, OU=orgUnit, O=org, L=city, S=state, C=countryCode
Keystore Entries
There are two different types of entries in a keystore:
1. key entries - each holds very sensitive cryptographic key information, which is stored in a protected format to prevent unauthorized access. Typically, a key stored in this type of entry is a secret key, or a private key accompanied by the certificate "chain" for the corresponding public key.
2. trusted certificate entries - each contains a single public key certificate belonging to another party. It is called a "trusted certificate" because the keystore owner trusts that the public key in the certificate indeed belongs to the identity identified by the "subject" (owner) of the certificate. The issuer of the certificate vouches for this, by signing the certificate.
Following are some important commands
keytool -import -alias jks -file precert.arm.crt
keytool -list keytool -printcert -file precert.arm.crt
keytool -delete -alias sMiller
You can find keystore location is:
C:\Documents and Settings\user
For more detail refer following link:
http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/keytool.html
Few days back I came across a requirement where I required all these commands.
In my next post I will give you one live example which will give you idea.