Latest Entries »

Tuesday, October 6, 2009

Steps to create Digital Certificate

The following steps will help you to create a Digital Certificate and to create a signed jar/applet.

Open the command prompt and navigate to

D:\Program Files\Java\jdk1.6.0_14\jre\lib\security

To generate certificate

keytool -genkey -alias SravanModugula -keypass smodugula

To change password/keypass

keytool -keypasswd -alias SravanModugula -keypass smodugula -new newsmodugula

To export the generated certificate

keytool -export -alias SravanModugula -file SravanModugula.cer




To print generated certificate on console

keytool -printcert -file SravanModugula.cer

To display the list of available certificates

keytool -list -alias SravanModugula

Alternative way to create a certificate, this command carry's all the information required

keytool -genkey -dname "cn=Sravan Modugula, ou= Java, o=Sun, c=IN"
-alias SravanModugula -keypass SravanKM -keystore -storepass -validity 720


keytool -selfcert -alias SravanModugula -dname "cn=Sravan Modugula, ou=Java, o=Sun, c=IN"

To create a signed jar file

jarsigner "D:\myfolder\your.jar" SravanModugula

To verify the signed jar file

jarsigner -verify -verbose -certs "D:\myfolder\your.jar"

3 comments:

Parveen said...

hi

Sravan Modugula said...

yes

lauren said...

As you shared the steps for creating Digital Certificate.These are really easy to follow.First we have to goto the directory D:\Program Files\Java\jdk1.6.0_14\jre\lib\security.To generate certificate.Secondly we need to run the required commands as you mentioned.Thanks for useful blog.digital signature