Signing and Digital Certificates

I was wondering if anyone knew how to assign a digital certificate at runtime.

currently my applet asks to accept the certificate before the applet starts.
I really didnt want to display the Java loading circle, so i was hoping there was a way to prompt the user at runtime.

Something like this?

:persecutioncomplex:

Was just about to make a shameless plug, but you beat me to it!

haha, this is awesome. I have been wanting ot do this for a while :slight_smile:

so you should have looked to 3DzzD before ! :stuck_out_tongue:

anyway, used with the Applet Boot class (wich can check the java version before loading classes) and proper HTML this is a perfect solution for professional/smooth looking applets.

Indeed.

It only occured to me that it was even possible, when I saw DzzD’s 3DzzD applet switching between software/hardware renderers. I tried to see how ‘they’ (DzzD and thijs) did it, but the answer was obscured by the JOGL loader. After a few minutes I lost patience and did some trial-and-error until it worked. So credits to DzzD and thijs!

SWEEEET! thanx bleb and Riven.

http://indiespot.net/signature

Riven: I didnt know so many people were interested in my code

edit: i just relised it was a script, I feel dumb :persecutioncomplex:

What!? How does this foreign site is able to access my javagaming cookies? I thought there’s a restriction for that.

Please use the forum search to find numerous other derailed threads discussing this.

Let’s not ruin this thread! :wink:


PrivilegedAction>Object<()

I think the ‘<’ ‘>’ characters are ment to be flipped around?

Haha! Gratitude successfully stolen! ;D

All props to Riven, I only spotted the post while nicking his LUT-based trig functions.

Oh thanks, I screwed up on my > and <

In eclipse, Im getting a few errors with this code

I can comment out the @Override.
When I do compile without errors, the applet won’t prompt to accept ther certificate before running the code.

Iv tried changing the original SecureAccess to both a class/abstract class. but the problem still remains with both uses of “run()”[quote]The method run() of type new PrivilegedAction(){} must override a superclass method
[/quote]

If the compiler -source is 1.5, you cannot @Override interface methods yet, that is allowed since 1.6.

system: JRE6 WinXP Eclipse
If I comment out @Override the applet compiles fine and runs.

When I test it in Internet Explorer,
I sign the jar that contains the LocalSecureAccess classes.
but not the SecureAccess and TestApplet class.

I end up getting the exception


java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at sun.plugin2.applet.Plugin2ClassLoader.checkPackageCerts(Unknown Source)
	at sun.plugin2.applet.Plugin2ClassLoader.access$200(Unknown Source)
	at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
	at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at TestApplet.start(TestApplet.java:16)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)


I can only repeat what I said: either you have Eclipse’s compiler setup with -source 1.5 or you are compiling with a 1.5 compiler.

… so what’s the ‘cause’ stracktrace + message. ::slight_smile:

Which MSIE version? 6? 7? 8?

Maybe put some files online so I can check for myself, to prevent this from me debugging your code, and wasting a lot of time.

For the sake of sweet fluffy things, provide all info you have.

Could you test it here?

http://pageflip.betaproject.nl/html/applet/pageflip_applet.html

Click the [full system access] button in the bottom-right corner

thanx that fixed the compiling problem.

test case: http://users.on.net/~bobjob/testcer.html

The classes are a copy and paste of your code. as for the applet:

I can reproduce your problem in your applet – it works in mine.

I have the interface and the implementation in different packages, maybe try that.

I tried the pageflip example. and it works just fine. it prompts to accept a certificate.
the certificate im using works just fine, if I sign the unsigned jar. so i really cant see the difference, except that maybe its trying to execute to early in the applet (in the start method).

ill try the package idea