We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › Sign your applet for using ESS online.
Pages: 1 2 
Sign your applet for using ESS online. (Read 13269 times)
Sign your applet for using ESS online.
Jun 27th, 2007, 2:51pm
 
I am doing this post because it took me a while to understand how to ( bloody ) sign my applet so it could work online. Krister Olsson explain it on his website but I still couldn't work out how it work. I am sure that I am not the only one. I am also doing this post because I couldn't find any one that could explain it properly on this forum. It could be because english is not ny first language and I don't understand everything sometimes ( I am sure a lot of none english person understand that ).

I only tried it on a mac but It must the same on a pc.

1/ Export your applet like usual

2/ Open the Terminal in application/utilities

3/ In the Terminal, type the path to your applet ( I don't know if you need to do this ) for exemple:
    cd /Users/YourName/Desktop/applet
You use cd to navigate in your folders and pwd to show where you are.

4/ Now follow what Krister says on his website, follow the instructions:
    http://www.tree-axis.com/Ess/signed_applets.html

I know it look stupid because it's really dead easy to do, but when you don't know how and you don't know much about java applet and terminal it can be pretty frustrating. The only thing is that it sign your applet for only 6 months. Can't help on this......

Here is the applet I wanted to put online. It's a simple one that I made when I was trying to understand the class. http://sosobering.free.fr/art/?p=104
Re: Sign your applet for using ESS online.
Reply #1 - Nov 5th, 2007, 9:20pm
 
Hi,

Thanks for pointing this out. For me it doesn't work when I use keytool nor jarsigner. Commandprompt doesn't recognize those commands as something that can be executed. I did 'cd' to get me in the directory where my applet is located.

I have copied the keytool.exe and jarsigner.exe into the applet folder. This seems to work a bit. When I try to execute the commands it asks me for jli.dll. I also copied this in the applet folder. Now I can make a key with keytool. The only thing is that jarsigner.exe doesn't seem to work proper. It sais: "Exception in thread "main" java.lang.noClassDefFoundError: sun/security/tools/JarSigner"

I think this is because I tried to copy the keytool.exe and jarsigner.exe to make them work. Why aren't those command recognized by default, except for copying them in the directory of the applet where I should execute them?

Can anyone give me any help on this?

Cheers,

Jeroen
Re: Sign your applet for using ESS online.
Reply #2 - Nov 5th, 2007, 10:42pm
 
Moving the .exe's isn't the solution, what you need to do is type the full path to where the programs were installed e.g.:

Code:
c:\j2sdk-1.6.0_02\bin\keytool -genkey -alias theKey
Re: Sign your applet for using ESS online.
Reply #3 - Nov 6th, 2007, 11:24pm
 
Thanks,

What you did, didn't work here. What worked for me is to copy the .jar into the java-bin directory. Signed it there, and replaced the old .jar with the new.

Cheers Smiley
Re: Sign your applet for using ESS online.
Reply #4 - Nov 7th, 2007, 10:39pm
 
thank you very much!
Re: Sign your applet for using ESS online.
Reply #5 - Nov 7th, 2007, 10:59pm
 
how do i delete the sign?
Re: Sign your applet for using ESS online.
Reply #6 - Nov 7th, 2007, 11:17pm
 
Don't know about deleting the sign, but you can't you just leave your jar unsigned?
Re: Sign your applet for using ESS online.
Reply #7 - Nov 8th, 2007, 9:49am
 
I'm having the problem that if i export my jar and then sign it, afterwards if i delete the jar and export a new one with changes it is automatically signed because of the path. WORSE, changes dont appear; the jar is the same as the one you signed, somehow the sign stores all the information from the old jar and locks it to that location. of course i can just save it a new place but do you have aclue on how to avoid this?
Re: Sign your applet for using ESS online.
Reply #8 - Nov 8th, 2007, 11:44am
 
Hmmm... that's kinda weird. The applet you exported comes out signed? And what if you sign the applet in another location then where you normally export it? That's in fact what I did.

Haven't got a clue why java is doing this though... I am fairly new to java. It seems like the core of java remembers signed files and their locations on your hard drive, so maybe when processing is using this core to generate the applets, the .jar will be automatically signed. But, I don't know how things work on that level.

Maybe some one else has a clue?

And does anyone know why the command

C:\Program Files\Java\jre1.6.0_03\bin\keytool -genkey -alias theKey

isn't working in commandprompt. The path is correct, but it sais that 'C:\Program' isn't recognized as a command. 'Program Files' is separeted by a space, maybe this is the problem? It has something to to with my way of writing I guess.
Re: Sign your applet for using ESS online.
Reply #9 - Nov 8th, 2007, 3:58pm
 
You need to put the file path in quotes so that space is treated right. e.g.
"c:\Program Files\Java\jre1.6.0_03\bin\keytool" -genkey -alias theKey
Re: Sign your applet for using ESS online.
Reply #10 - Mar 9th, 2008, 8:00pm
 
I followed the instructions and signed my applet and uploaded it to my server but I still dont get an image on the applet when I try to view it in the browser. I'm using a simple brightness tracking code and trying to see if I can get live video feed exported to my website. is a signed applet enough for putting live video capture on a website???
I'd really appreciate some insight.
Re: Sign your applet for using ESS online.
Reply #11 - Mar 12th, 2008, 12:29pm
 
Yeah its a shame there is no debugging in web applets. I have the same problem. After signing, my applet asks you to accept the key, but then displays nothing Sad.
Re: Sign your applet for using ESS online.
Reply #12 - Mar 12th, 2008, 12:37pm
 
There is debugging, there should be a java console (accessed via an icon in the system tray on windows) that will show error messages/println statements.
Re: Sign your applet for using ESS online.
Reply #13 - Mar 12th, 2008, 1:19pm
 
I should have known! Thanks john! I just need to work around this now.

Code:

Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (javax.sound.sampled.AudioPermission record)


I wonder if I need to sign the ess.jar as well.

- edit -

Yep after signing all the jar files it now works!
Re: Sign your applet for using ESS online.
Reply #14 - May 17th, 2008, 1:33am
 
If you are a beginner at Processing, Java and signing, this might help.

I was trying to have my web applet access online images (from flickr), and was puzzled by the fact the sketch was working as a standalone app, yet was giving me security errors in the Java console when run in a browser.  If you find yourself in the same situation, it means your app needs to be 'signed'.  Here's how I did it:


First, create a signing key.

Open a command prompt and use this command (substitute JRE version and path if necessary):

"C:\Program Files\Java\jre1.6.0_06\bin\keytool" -genkey -alias yourKeyName -validity 10000 -keypass yourKeyPassword -dname "cn=Your Name, ou=Your Organizational Unit, o=Your Company, c=US"

'validity' is the nr of days you want the key to remain valid

It will ask you a keystore password - say 'yourStorePassword'.

Then sign all your exported jar files using jarsigner.

I'm not sure all the .jar files need to be signed, but this worked for me.  jarsigner is included in the JDK, which can be found here for example:
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-
/USD/ViewProductDetail-Start?ProductRef=jdk-6u6-oth-JPR@CDS-CDS_Developer

cd C:\yourPath\Processing\yourSketch\applet
"C:\Program Files\Java\jdk1.6.0_06\bin\jarsigner" -keypass yourKeyPassword -storepass yourStorePassword yourSketch.jar yourKeyName

Do this for all you .jar files in the applet dir.


Here are some docs for keytool and jarsigner:

http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/keytool.html

http://java.sun.com/javase/6/docs/technotes/tools/windows/jarsigner.html

Pages: 1 2