tutorial - How to create a self signed certificates for Java Applets

1. Create your code for the applet as usual.

2. Install JDK and set the class-path/path

3. Generate key: keytool -genkey -keyalg rsa -alias key

Enter keystore password:
What is your first and last name?
[Unknown]: Nikesh
What is the name of your organizational unit?
[Unknown]: Cybage
What is the name of your organization?
[Unknown]: Cybage
What is the name of your City or Locality?
[Unknown]: Pune
What is the name of your State or Province?
[Unknown]: MH
What is the two-letter country code for this unit?
[Unknown]: IN
Is CN=Nikesh, OU=Cybage, O=Cybage, L=Pune, ST=MH, C=IN correct?
[no]: yes

(wait...)

Enter key password for
(RETURN if same as keystore password):
Re-enter new password:

(press [enter])

4. Export key: keytool -export -alias key -file cert.crt

Enter keystore password: *******
Certificate stored in file cert.crt

5. Create JAR: jar cvf applet.jar main.class
Add all classes used in your project by typing the classnames in the same line.

added manifest
adding: main.class(in = 671) (out= 460)(deflated 31%)

6. Verify JAR: jar tvf applet.jar

0 Fri Jun 20 17:51:38 IST 2008 META-INF/
68 Fri Jun 20 17:51:38 IST 2008 META-INF/MANIFEST.MF
671 Wed Jun 18 11:48:34 IST 2008 main.class

7. Sign JAR: jarsigner applet.jar key
Enter Passphrase for keystore:******

Warning:
The signer certificate will expire within six months.

8. Verifiy Signing: jarsigner -verify -verbose -certs applet.jar


131 Fri Jun 20 17:53:04 IST 2008 META-INF/MANIFEST.MF
252 Fri Jun 20 17:53:04 IST 2008 META-INF/KEY.SF
889 Fri Jun 20 17:53:04 IST 2008 META-INF/KEY.RSA
0 Fri Jun 20 17:51:38 IST 2008 META-INF/
smk 671 Wed Jun 18 11:48:34 IST 2008 main.class

X.509, CN=Nikesh, OU=Cybage, O=Cybage, L=Pune, ST=MH, C=IN (key)
[certificate will expire on 9/18/08 5:47 PM]


s = signature was verified
m = entry is listed in manifest
k = at least one certificate was found in keystore
i = at least one certificate was found in identity scope

jar verified.

Warning:
This jar contains entries whose signer certificate will expire within six months.

9. Create HTML-File for use of the Applet


Free, facebook, tips, Links, blogging, Downloads, Google, facebookTips, money, news, apps, Social, Media, Website, Tricks, games, Android, software, PIctures, Internet, Security, Web, codes, Review, bloggers, SAMSUNG, Worldwide, Contest, Exitic, Phones, facebookTricks, hacking, London, Olympics, SEO, Youtube, iOS, Adsense, gadgets, iPHONE, widgets, Doodle, twitter, video, Deals, technology, Aircel, Airtel, iPAD, Angry, Birds, BSNL, TechLife, GMAIL, Idea, Microsoft, SmartPhones, Stress, Buster, Windows, Yahoo, Infolinks, Nokia, Scam, Uninor, browsers, Amazon, Euro, CUP, Chat, IDM, JOBS, Modem, Music, Reliance, Results, SSC, Tata, Docomo, bing, freebie, mobile, placements, AIEEE, AlertPay, Chrome, College, Competetive, Exam, Dehradun, Extension, FireFox, GPRS, HTC, IMPACT, Info, MTS, Mark, Zukerberg, Paypal, Promotional, Post, Torrent, UTU, Unlocking, VodaFone, Wall, Paper, apple, books, engineering, iCAR, iTunes, pinterest, rovio, AVG, Admit, Card, Adobe, Affiliate, Marketing, Akhilesh, Amul, Girl, BlackBerry, ChromeBook, Clixsense, Coupon, Digitallife, Discovery, Emoticons, Festival, GATE, GIMP, Income, Tax, International, JSS, JailBreaking, Kindle, Linux, Local, MAX, PAYNE, Mac, Mango, Memory, Speed, Nexus, Online, Shopping, Raakhi, Report, Rising, Stars, Sample, Science, Sony, Syllabus, TabletBooK, Teamviewer, Templates, Dark, Knight, Rises, USA, UPMT, Virgin, Xperia, ZTE, challan, counselling, course, btech, funny, iMOVE, registration

source:http://linuxpoison.blogspot.com/2008/06/135781758016870.html