It's not a secret anymore!*
The moose likes Beginning Java and the fly likes jar sha question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "jar sha question" Watch "jar sha question" New topic
Author

jar sha question

Steve Noll
Greenhorn

Joined: Dec 05, 2005
Posts: 5
Alrighty I am completely new to java so please bare with me. The company I work for has an online java applet that has several .jar files. I've extract the .jar file, and decompiled the .class files with DJ Java Decompiler. I found the line in the class file that I need to re-write. (It's a basic println string) The problem is when I change the wording in the string and save the file. I get an error because the SHA key doesn't match.

How do I update the SHA key so that the changes I make in the class file doesn't prevent the applet from running? I've found a few things in sun's website but it all sounded a little too complicated. If someone could please tell me what to do in lehman's terms I'd really appreciate it.

Thanks!
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

Is the JAR digitally signed?
Then it is working correctly. The digital signiture makes tampering with the JAR impossible. You need to obtain your company's digital certificate and sign the JAR after you have changed it. Have a look at this tutorial on Signed Applets for the mechanics on how to sign a JAR.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Steve Noll
Greenhorn

Joined: Dec 05, 2005
Posts: 5
I don't know that we have a digital certificate. My company hired a contractor to develope this java applet 2 or 3 years ago. Would it be possible to obtain a new certificate and re-sign all of the files? If so, where do I find a certificate?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

Ask your web server admin. Your company probably has a certificate to enable HTTPS on your web server. If not, you can obtain one from Thawte, VeriSign or some other certificate authority.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jar sha question