Is there a way to sign a JAR file programatically?

Is there a way to sign a JAR file programatically?

great! can you give me a short code snippet?
what about signing J2ME MIDlets?

Similar Messages

  • Simplest way to sign a JAR?

    I made an applet using Eclipse that pulls information from a website while running. Apparently this needs to be signed before it works online -- what is the quickest, easiest way to sign it?
    I'm one of the few people who are going to be using this applet, and I have basically no knowledge about JARs. I read the tutorial here but it didn't help me at all, as I don't have a "keystore" on my computer and I don't even know where to type any of that ("that" being jarsigner -keystore mykeys -storepass abc123 -keypass mypass app.jar johndoe).
    I tried to run the unsigned JAR using Firefox (+<applet code="MU.class" archive="MU.jar" width=300 height=400>+). The applet didn't even initiate, it simply turned into a white box saying Error. Click for details -- clicking it brought up a Java Console starting with this line: java.security.AccessControlException: access denied (java.net.SocketPermission www.forsaken-mu.com:80 connect,resolve).

    coopkev2 wrote:
    ejp wrote:
    I don't have a "keystore" on my computerSee the Javadoc for the 'keytool' tool.The link for the "Keytool reference page for Windows" here redirects here which is of no use to me that I can see. Did I click the wrong link, or is it just out of date?Those are pointing to the 1.2 JavaDocs. I have always wished Sun would establish an URL for the current API and tool documentation. As the new JRE major versions are released for public use, the docs should change accordingly.
    Try instead [http://java.sun.com/javase/6/docs/technotes/tools/windows/keytool.html].
    Out of curiosity. How did you get that URL?
    As to your more general question of "Simplest way to sign a JAR?". I would answer that "Load a project (that signs code) with a build.xml into your IDE and call the main task."
    But there are some caveats to that advice.
    1) There are very few people on these forums willing to help with IDEs, so it is up to you to figure out how to import/build the ant based project, or take it to a forum for the IDE.
    2) Understanding what the build file is doing, depends on understanding the underlying tools it calls. Most of those tools come directly from the JDK.
    Having said that, I do have some open source projects that digitally sign code. For example the [demo. of the JNLP API file service|http://pscode.org/jws/api.html#fs] with the source files available in [http://pscode.org/jws/filetest.zip]. Maybe you can get a head start by looking that over (and building it, and changing it etc.).

  • TS1967 My external hard drive was stolen that stored all my purchased iTunes music. Is there a way to sign in to my account and redownload previously purchased music?

    My external hard drive was stolen that stored all my purchased iTunes music. Is there a way to sign in to my account and redownload previously purchased music?

    Yes, a search would have found the instructions.
    Downloading past purchased from iTunes

  • Digitally sign a jar file for distribution?

    I recently got a jar of mine hosted for client use though a web page.
    The problem is that the jar needs to access the internet for several functions. JWS prompts the user for security reasons every time it makes a connection to a new url endpoint. Since one operation alone can hit 56 url's i thought this could be a bit of a hassle to the users.
    The solution, as I understand it to be, is to digitally sign the jar file, so the user is prompted once on download.
    I found a site ascertia which offers free certificates, but for the life of me I canb not get this to work.n I have seen keytool generate numerous errors, none of which mean anything to me. (too long >59, cant read chain from reply, invalid cert)
    Does someone know a clear and thorough tutorial on digital code signing and certs? Or a CA that provides certs for free, and has some instructions to go along?
    Thanks so much.
    The step i have trouble on is turning the CSR into a cert, and importing the returned cert back into the keystore.

    Masterkeedu wrote: !! It worked.
    Congratulations. :-)
    Masterkeedu wrote: So it's not certified, but is signed.
    So as I understand this, it means the end-user has no way to know it was me that truly signed it. But relies on their common sense I suppose.
    That is correct. The CA has verified, and is certifying, that you are who you claim to be. If you or I use a 'self signed' certificate, it does not carry the same level of trust. As you might understand already, the dialogs are different between the two certificate types, and some users cannot accept trusted code from an unverified (self-signed) certificate.
    I have been meaning to write a page on the differences between the two certificates. It is well worth looking into getting a cert. from a CA.
    There was a stage when one of the major CAs were offering 'freemail' certificates that came emblazoned not with your name, but 'free mail' itself. I did not like them because of that, and continue to use a self-signed certificate.

  • Using System.getProperty in the app, but still not signing the jar file

    Is there a way to use the System.getProperty call in the app but not sign the jar? I get the security exception when launched using WebStart?
    Any help appreciated.

    Yes. Don't use Web Start, and you'll have no problems.
    Seriously, the security exception is there by design. If you must call System.getProperty, you need to sign your jars -- though personally, I think there are situations where signing your jars to make Web Start work is a needless complication.
    However, if you still need a tool to deploy updates and such, I recommend Deploy Director from Sitraka.

  • Problems Signing a Jar File.

    Hi Everyone
    I'm having problems signing a jar file.
    The applet in the jar file was previously signed by Duke.
    Now I want to re-sign it with my company name.
    So I unzip the jar file. I was careful to remove the manifest and the Duke .sa and .rsa. I re-signed it with the netscape signtool.
    The applet works. It presents the prompt that it is signed by my company. I grant session. Then another prompt appears and it says it is signed by duke.
    but i was careful to remove the duke signature and manifest file when i unzipped it. Is it possible that the fact that it is signed by duke is stored in the bytecode ??
    It is using the <object tag by the way.
    <OBJECT classid="clsid:CAFEEFAC-0013-0001-0002-ABCDEFFEDCBA"
         WIDTH = "100%" HEIGHT = "50" border="0"
         codebase="http://www.homework911.com/java/j2re-1_3_1_02-win.exe#Version=1,3,1,2">
         <PARAM NAME = "CODE" VALUE = "com.s.SApplet"/>
         <PARAM NAME = "CODEBASE" VALUE = "/_phone"/>
         <PARAM NAME = "type" VALUE="application/x-java-applet;version=1.3"/>
    stev

    great suggestion - there are no other signed jar files on the browser for it to access. There is a winzip file but it has no rsa/dsa and signature file in it.
    perhaps it is accessing something else that was signed by duke ?
    Would it be possible for it to connect to a server program that was signed by duke and therefore present the prompt. ?
    I'm trying to get the original unsigned classes and see if i can recompile and sign it just in case then name duke is in byte code.
    any other thoughts as to what this code be ?
    stephen

  • Signing a jar file

    Guys, I've googled the crap out of this one. I need some help signing a jar file.
    Here is what I'm doing:
    1. Generating a key:
    keytool -genkey -keystore myKeyStore -alias myName2. Trying to sign the jar file:
    jarsigner -keystore myKeyStore -storepass myPassword -keypass myNamePassword myJar.jar myNameHere is the error I'm getting:
    jarsigner error: java.lang.RuntimeException: keystore load: Invalid keystore formatI'm using Ubuntu Linux.
    I wrote and built my project with Netbeans.
    Any ideas?

    Here is what the latest process looks like. What am I doing wrong?
    thomasaaron@ubuntu:~/Desktop$ keytool -genkey -alias thomasaaron -keystore myKeyStore
    Enter key store password: password1
    Enter key password for <thomasaaron>: password2
    You are about to enter information that will be incorporated into
    your certificate request. This information is what is called a
    Distinguished Name or DN. There are quite a few fields but you
    can use supplied default values, displayed between brackets, by just
    hitting <Enter>, or blank the field by entering the <.> character
    before hitting <Enter>.
    Common Name (hostname, IP, or your name): Thomas Aaron
    Organization Name (company) [The Sample Company]: Tom's Company
    Organizational Unit Name (department, division): Tom's Department
    Locality Name (city, district) [Sydney]: TommyLand
    State or Province Name (full name) [NSW]: Colorado
    Country Name (2 letter code) [AU]: US
    thomasaaron@ubuntu:~/Desktop$
    thomasaaron@ubuntu:~/Desktop$
    thomasaaron@ubuntu:~/Desktop$ jarsigner -storepass password1 -keystore myKeyStore SupportManager.jar thomasaaron
    jarsigner error: java.lang.RuntimeException: keystore load: Invalid keystore format

  • Any Other ways to implement a .jar file?

    Hi there!!
    I'm a not a java expert, I'm not a beginner as well. I would like to know other ways of executing a .jar file.
    I have jar file which would run a tool called "RRDTOOL" after executing it. That tool users create, update and few other commands to create a database. Here is a snap shot.
    [http://www.fileden.com/files/2009/4/17/2408006//1.jpg|http://www.fileden.com/files/2009/4/17/2408006//1.jpg]
    Is there any way I can implement this .jar file so that I can run the RRDTOOL from the command line itself.
    Like this
    [http://www.fileden.com/files/2009/4/17/2408006//2.jpg|http://www.fileden.com/files/2009/4/17/2408006//2.jpg]
    or this
    [http://www.fileden.com/files/2009/4/17/2408006//3.jpg|http://www.fileden.com/files/2009/4/17/2408006//3.jpg]

    @AndrewThompson64 ,
    Okai now. Let me get into the details still further.
    RRDTool is a tool that creates a Database using its native commands "Create, update and few more). The database that is obtained from RRDTool has .rrd extension. Jrobin is a utility that helps users to create a similar database using Java. Note that the database will have a .jrb extension in this case.
    Now, as mentioned above rrd.jar is something that runs jrobin. The interface that is created using rrd.jar file allows me to create ".jrb" file using RRDTOOL commands. The rrd.jar file acts as an interface in converting RRDTOOL commands to java functions and create .jrb file.
    Now, I want to create and edit .jrb file with out getting into the new environment created by rrd.jar file.

  • Can I progamatically sign a jar file?  i.e. w/o jarsigner tool

    Hi,
    I am new to development and am using Ant to build my packages.
    I need to sign the jar files that I produce, and now the only way I know how is with jarsigner.
    I'd like to find a way to do the signing within Ant, but can't find one.
    Is that possible?
    George

    I'm having trouble with the opposite: I'm trying to verify a signed jar programmatically.
    I've already read this article, and thought that I could do similar things in order to verify.
    However, this code uses classes from sun.security.util, and I couldn't find any documentation of this package.
    Any suggestion will be greatly appreciated!

  • Simply signing a *.jar file make applet able to read Client PC?

    If I simply sign my jar file, which is supposed to open a JFileChooser, and make a default web page that loads the jar as an applet supposed to grant all permisions? I tried this, and the applet pops up the "grant permisions". However the JFileChooser won't pop up?
    what if I put a .policy file online in the same directory, could this help or be modified to?

    Fractalz wrote:
    . . . Now that's the part I have been facing difficulties, cuz I have to include all the classes that the applet is using from other jar
    files. And I can not come up with a way to find out all those classes.See the Class-Path: parameter (of a Manifest file) documentation here:
    http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html#Manifest-Overview

  • Is there a way to play an mp4 file at the beginning of a published project only when the project is accessed from a specific site?

    Is there a way to play an mp4 file at the beginning of a published project only when the project is accessed from a specific site?
    A little background info. I use Captivate 7 and currently have over 100 projects that I maintain on a quarterly basis. I publish using the SWF format and upload the swf/htm files to a server where they are then accessed from a few locations (within our online documentation, in our software product, on two different websites). Many of the projects are linked so some will be viewed as a series and others viewed as a standalone video. Each video uses the same template and includes an intro and end slide. Now my organization wants to implement a new intro to all videos (those I publish and those from several groups across the organization). My current intros provide overview material for the specific video so the new intro, which is an animation with audio in mp4 format, would need to be placed at the start of each project. The issue is, the intro adds 9 seconds to every video and in many cases doesn’t add any value (say, if a user accesses the video from within our product or views the videos as a series). I’ve talked it over with my boss and we want to try to add the intro only to videos accessed from site X, not any other location. So now to my question. Is there a way to play an external mp4 file (intro) only when the published project is accessed from a specific site, therefore eliminating the need to update each project? Maybe there's a way to add a parameter or variable to the URL or the html code?
    Thanks in advance for your suggestions. Please let me know if you need additional information.

    AimeeLove,
    I have a solution for you.  You may have to modify the code a little bit based on how long the timeline animation is for your clock.  I based mine on 3 seconds to complete a minute hand sweep around the clock.
    Milliseconds for each point on the clock:
    12 = 0
    1 = 250
    2 = 500
    3 = 750
    4 = 1000
    5 = 1250
    6 = 1500
    7 = 1750
    8 = 2000
    9 = 2250
    10 = 2500
    11 = 2750
    In the mouseover section for 12 o' clock, put this code...
    myVar = setInterval(function(){
         var pos = sym.getPosition();
         if (pos > 0 && pos < 50){
              sym.stop(0);
              clearInterval(myVar);
    },10);
    When you point to the time, the setInterval method loops every 100th of a second and checks the current position of the timeline.  When the timeline reaches the range between 0 and 50 milliseconds (almost impossible to hit 1 specific point), the timeline will stop at 0.  Also, the clearInterval will be fired to stop the loop.
    In the mouseout section, put this...
    sym.play();
    clearInterval(myVar);
    It start the clock again, and it also clears the loop in case you mouseout before you reach the range.
    Make sure that myVar is a global variable so you can clear it from the mouseout section.
    Repeat this for each point on the clock.  To avoid potential conflicts, you may want to use my12, my1, my2, etc. instead of myVar.  I put the milliseconds at the top that you would use as the beginning of the range.  50 milliseconds should be enough to catch it.  So, for 5 o' clock, you would make your range between 1250 and 1300.
    Let me know if you have any questions.  Thanks!
    Fred

  • Is there a way to create an MMS FILE

    HEY ALL MACHEADS,
    just want to know if there is way to create an MMS file on a mac with quicktime..or convert a quicktime to be sent via MMS ( from a blackberry say...)
    I think its called viral video...??? any help would be great...
    orlando f

    If you wanted to send a video as an mms from a mobile phone, the best option for exporting would be 3G in the quicktime export menu ( File > Export and it's in the drop down list).
    Keep it short and small and you shouldn't have any probs. There are some miserly operators out there who block MMSs bigger than 100K

  • Is there a way to insert/update .js files in an .oam after publishing?

    I'm working on a rather complex Animate project that utilizes Edge Commons and jQuery UI. I'm using Edge Animate CC 2014 because 2014.1 broke some of that functionality and I was already too far into the project to update the code.
    When I'm testing the project via "Preview in Browser" everything works great. But when I publish as either a .oam file or as web, the project is just broken. The interactive elements that depended upon Edge Commons are gone.
    I've narrowed the issue down to the three files "index_edge.js", "index_edgeActions.js", and "index_edgePreload.js". If I copy the working files from the Animate project directory and replace the published versions, the web export works. I'm assuming Edge Animate is compressing the code in these files and that is breaking something. However, I need a .oam file so that it can be utilized by the next person in the chain. Is there a way to replace those three files with the 'working' versions within the .oam file?

    Hi ,
    Open your edgeProject/index_edgeActions.js.Replace the following with single line comment. Open in edge animate 2014 and publish again. Published content will work
             /*================================================================================
             change Q number to match breakers || Q should = breakers +1 to account for 0 value if no BK0 exists
                     |    |
                     |    |
                     |    |                   DOUBLE CHECK BECAUSE OF BK0
                     |    |
                     |    |
                     |    |
                   __|    |__
             ================================================================================*/
    Like this.
             //================================================================================
             //change Q number to match breakers || Q should = breakers +1 to account for 0 value if no BK0 exists
             //        |    |
             //        |    |
             //        |    |                   DOUBLE CHECK BECAUSE OF BK0
             //        |    |
             //        |    |
             //        |    |
             //      __|    |__
             //================================================================================

  • I have files that freeze my programs whenever I try to open ANY file. Is there a way to find the exact files causing the crash?

    I have files that are freezing my programs (adobe; after effect and photoshop, as well as maxon cinema 4d). Whenever I try to import ANY file from within the program it doen't even let me select the file I need before freezing. I have moved all files off my desktop and into my dropbox, and it now allows me to import files/search for files on the desktop but NOT dropbox, once I go to dropbox it freezes again. I am assuming there are files within dropbox now that are crashing my programs. The problem is I have a lot of files in there and would like to remove the corrupt ones so that I can use my programs without freezing. Is there a way to find the exact files causing the crash?
    This has happened a couple of times and each time I have to move all my files off my desktop, so there must be a type of file doing this, I just don't know what files they are.
    Mac Book Pro 15" running OSX 10.9
    Processor  2.3 GHz Intel Core i7
    Memory  16 GB 1600 MHz DDR3
    Graphics  Intel Iris Pro 1024 MB
    ANY help would be greatly appreciated! It is making it really hard to get work done. THANKS!

    This error sounds to me like you have/had BootCamp Windows installed and then removed, posible ?
    If so (and even if not so), try restating your MBA while holding down the alt/option-key until you get to the Boot Selection Screen.
    Choose to boot OSX.
    Once in OSX go to System Preferences then Startup Volume and set your OSX to be the default.
    Hope it helps
    Stefan

  • Is there a way to view windows media files on an iPhone?

    Is there a way to view windows media files on an iPhone?

    There are some apps that provide for viewing the closed/proprietary format such as OPlayer.

Maybe you are looking for

  • Material group wise consumption for a particular period

    Hi, How to find out the consumption for a particular material group in a given period along with details of material number, quantity and price. Thanks, Kiran Bodla

  • Oracle 10g R2 RAC - IP address Change

    We succsessfully installed Oracle 10gR2 single database on two node RAC on Windows 2003. I followed the Oracle RAC installation documentation and assigned a public IP for the machine and another Virtual Public IP and a Private IP. We have also change

  • In material master MM02 change number to be make it as a mandatory

    Hi All, How to make it mandatory above said subject line. Appreciate your help

  • N97, a great phone.

    I got to say this, i have started to like my N97 more and more. This weekend i was on a fishing trip with a few friends and they all used android phones. After just one day i was the only one with a working phone although i used maps (love the latest

  • Repository Configuration Metadata issue for OBIEE11g

    Hi, I am having an issue while using RCU to created BI schema. On database connection details wizard, after giving all details, on checking prerequisites, on Initializing repository configuration metadata, it gives an error: The version 11.2.0.1.0 of