Skip to main content

How can an unsigned applet certify itself?

1 reply [Last post]
gcsaba2
Offline
Joined: 2005-04-21

Hello,

I have a graphics design applet which is not signed. With this applet the user can draw lines, circles etc. and may add regular images. There's a set of pre-made images, so the chances that the user will use his own are low.
However, there is an option for this, so if the user wants to insert his own images, an open dialog must show up and allow the user to select a file from his computer.

Unfortunately, to use an open dialog the applet must be signed, otherwise a security exception will be thrown. Because in most cases the user will not use his own images, it is stupid for me to sign the entire applet, and have the certificate window appear each time. The confirmation window should only appear when the user clicks on the Open button, in which case the applet should use the keystore which I'd provide and it should "sign itself", ie. certify itself with the browser's security manager.

How can I do this? I think the answer probably lies with the Keystore and Permission classes, but I haven't done this yet so I don't know.

If anyone can help please write!

Thanks, Csaba

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mthornton
Offline
Joined: 2003-06-10

Not exactly an answer, but I would note that an unsigned WebStart application can use a special file open mechanism that would suit your purpose.

http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/example...