File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Signed Applet - Using same alias while development Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Signed Applet - Using same alias while development" Watch "Signed Applet - Using same alias while development" New topic
Author

Signed Applet - Using same alias while development

Pt Patel
Greenhorn

Joined: Mar 05, 2009
Posts: 11
Hi,

I am working on Embedded Java Signed Applet. My applet using the TCP/IP thus required to load each time to my Lantronix XPort.
The problem is, every time I change something in the applet, I need to run the following commands again and finally load to Lantronix XPort.
And every time, I required to change the alias name i.e. signapplet17 in the following commands.

Is there any easy way while developing the signed applet
e.g. we can use the same alias name each time i.e. signapplet1 ( I reached to signapplet17)
Or we can avoid the following commands while developing.
---------------------------------------------------------------------------
jar cmf mainClass.txt DataMain.jar *.class

: Generate key pairs
keytool -genkey -alias signapplet17 -keystore mykeystore -keypass mykeypass -storepass mystorepass

: Sign the JAR file
jarsigner -keystore mykeystore -storepass mystorepass -keypass mykeypass -signedjar SDataMain.jar DataMain.jar signapplet17

: Export the public key certificate
keytool -export -keystore mykeystore -storepass mystorepass -alias signapplet17 -file mycertificate.cer
---------------------------------------------------------------------------

Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42634
    
  65
And every time, I required to change the alias name

Why is that?


Ping & DNS - my free Android networking tools app
Pt Patel
Greenhorn

Joined: Mar 05, 2009
Posts: 11
Thanks for reply,

Every time I change something in my Applet, I need to generate key pair, sign the jar file and export the key etc.
If I run the same command "keytool", I have to change the alias i.e. "signapplet17" in my last post. Because It is giving me error, alias already exist/used.

Actually I made a bat file for all these command given between dotted line in my last post. And every time after compiling the java file, I have to change to new alias name in my bat file and run that bat.

Up to this now, I have changed my alias from "signapplet1" to "signapplet17". I am evev not sure, where these alias stored and whether it is bad thing to have too many unnecessary alias.
Is there any way, I can simplify all this steps while developing the signed applet. And later at the end, put all these security back.

Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42634
    
  65
Why do you need to export the certificate each time you change something in the applet? You can reuse the file.

If -for some reason- you want to export the certificate repeatedly, just delete the old certificate file before doing so.
Pt Patel
Greenhorn

Joined: Mar 05, 2009
Posts: 11
Hi,
I have removed the "Generate Key Pairs" and "Export Public Key Certificate" lines and it is still working with the previously generated certificate.
I was in the impression that, it will require to generate new every time.
Thanks for all your help. I got another question regarding applet, but I will create the new post.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Signed Applet - Using same alias while development