Sign jar using PGP

Hi folks,
I do have long used PGP keys (over 7 years). I would like
to sign jar file using those my PGP key. How should I do that?
I mean I can just sign jar in standard PGP way, but I would like
to sign jar file in way jarsigner does. Such that in jar meta
one would see PGP signature and could verify it using jarsigner
or other software of that kind. How it's possible?
Please help. Bunch of dukes are awaiting you! Urgent!
Paul

Sure it knows nothing about PGP. You have to use PGP
tools to export that key to one of the formats those
can be understanded by keytool (such as x509 or
pkcs12). I do know nothing about these PGP tools to export PGP keys
to x509 and/or pkcs12 - please hint me what tools you
are talking about?The universal hint is: Google -> "PGP key export" -> Search
Another possibility is to export RSA key to the DER
encoding and then write a little program to read it
and then add to the keystore. This is looks like an
easy task. I believe you can easily find source to
convert pkcs12 keystore to JKS and use that one as a
starting point.I would be happy if you will point me the source to convert
pkcs12 keystore into JKS. BTW what's JKS?Google -> "convert pkcs12 to JKS" -> Search
JKS == Java Key Store
Sorry for my stupidity... I've last touched PGP/RSA issues
5 or 6 years ago, since that time technology a bit changed :)It is a good idea to read some fundamental first. Take a look at http://java.sun.com/products/jce/index-14.html

Similar Messages

  • Signing jars using ant 1.7

    Hello,
    I want to sign jars using the ant 1.7. I am using the
    <signjar alias="E:\buildforcertify\filefolderupload.jar" keystore="myKeyStore.keystore" storepass="day" verbose="true"/>
    but it it doesnot work.
    Please help me in signing jars using ant. If u can provide an link, it would be of great help.
    TIA,
    Sarwa

    Yes It has to do with swing.
    I used the following command in ant.
    <target name="signjar" depends="cpappletjars">      
         <signjar jar="${dir.webapp}/fileupload/*.jar" alias="me" storepass="applet" keystore="${dir.webapp}/fileupload/myKeyStore"/>
         <delete file="${dir.webapp}/fileupload/myKeyStore"/>
    </target>
    It worked fine for windows but for linux it gives error as "unble to open file *.jar "
    Can u please let me know where I am gone wrong ?
    similar sort of problem seen at http://forum.java.sun.com/thread.jspa?threadID=5301675&messageID=10278840 But no solution.

  • Verifying signed Jar using Java code

    Hi,
    I have been looking for a way to verify signed or unsigned jar from java code.
    I have to use the jar name and from here, I have to verify the digital signature. For this goal I have found some Java classes which can be useful for me. These classes would be JarEntry class, from which I could get the certificates. Signature class, whose methods let me verify the digital signatures, and Certificate class. I also found a class called SignedObject from I could get the signature data which the method getSignature (), but the problem here it is that I need a private key in the SignedObject constructor, which is not possible since I want to verify a signed jar which I am not able to know the private key, just public key. So, could anybody tell me how I could solve this problem?
    My code would be some as shown below:
    jar = new JarEntry (location);
              jarcertificates = jar.getCertificates();
              /* We should check all the certificates
              if (jarcertificates != null){
                   for (int i=0;i<jarcertificates.length;i++){
                        sig.initVerify(jarcertificates);
                        sig.update(jar.getExtra());
                        sig.verify( DIGITAL SIGNATURE FROM JAR SHOULD BE HERE);
    I guess that I have to use jar.getExtra () in order to get the data to put in Signature.update() method but I am not sure, am I wrong?
    Thanks in advance

    Here is some sample code to verify a jar file:
            JarFile jf = new JarFile(args[0], true);
            byte[] buffer = new byte[8192];
            Enumeration e = jf.entries();
            ArrayList entries = new ArrayList();
            while (e.hasMoreElements()) {
                JarEntry je = (JarEntry) e.nextElement();
                entries.add(je);
                InputStream is = jf.getInputStream(je);
                while (is.read(buffer, 0, buffer.length) != -1) {
                    // we just read. this will throw a SecurityException
                    // if  a signature/digest check fails.
                is.close();
            }To validate the certificate chain, you can call JarEntry.getCertificates(), create a CertPath from the array of Certificates (using a CertificateFactory), and then use the CertPathValidator APIs. For more information, see the PKI Programmer's guide: http://java.sun.com/javase/6/docs/technotes/guides/security/certpath/CertPathProgGuide.html

  • Signing jars using -tsa

    Hi,
    During my build process, I was using the tsa as https://timestamp.geotrust.com/tsa to sign my application jars.. But currently I see this TSA is down. Hence I'm not able to sing my jars.
    Could you suggest me, are there any free TSAs available that I can use to sign my jars.

    Yes It has to do with swing.
    I used the following command in ant.
    <target name="signjar" depends="cpappletjars">      
         <signjar jar="${dir.webapp}/fileupload/*.jar" alias="me" storepass="applet" keystore="${dir.webapp}/fileupload/myKeyStore"/>
         <delete file="${dir.webapp}/fileupload/myKeyStore"/>
    </target>
    It worked fine for windows but for linux it gives error as "unble to open file *.jar "
    Can u please let me know where I am gone wrong ?
    similar sort of problem seen at http://forum.java.sun.com/thread.jspa?threadID=5301675&messageID=10278840 But no solution.

  • SSL Cert used to sign Jars for distribution via WebStart

    Hi,
    I have an SSL cert (Comodo InstallSSL) for my website and wondered if I can use it to sign jars so, when distributed via webstart, the old "untrusted source" message doesn't get displayed. I've been doing a lot of reading but, to be honest, I can't really find my bearings! I have imported the cert into my keystore but get the message when I try to sign a jar:
    Certificate chain not found for: myalias  myalias must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.I have the following files in relation to my cert:
    xxx.cabundle (this can be imported into keytool easily)
    cert/xxx.crt (looks like a PGP file, cannot be imported (-import) into keytool)
    private/xxx.key
    My questions I suppose are:
    1. Can I use a cert issued for SSL to sign jars for webstart distribution?
    2. If yes to 1; what steps other than importing the cert alone (which generates the message above) do I need to do to achieve this?
    Any help would be appreciated!
    Rich

    Hi,
    yes, the pkcs12 certificate includes the private key, as opposed to pb7 which does not.
    Sent from Cisco Technical Support Android App

  • Issue while signing a jar using RSA certificate

    Hi,
    I am trying to sign a java applet using trusted certificate with the help of Java keytool and jarsigner of JRE1.6. For this I have followed the following steps:
    1.Generated key pair in a keystore - keytool -genkeypair -keyalg RSA -alias eaikey -keystore eaikeystore  -validity 3650 -keysize 2048
    2.Generated CSR using command keytool -certreq -alias eaikey -file eaicert.csr -keystore eaikeystore and send the .csr file to the CA
    3.CA has returned the certificate reply (.cer file)that contained a root certificate
    4.When I tried to import the certificate using command keytool -import -file eaicert.cer -alias eaicertkey  -keystore eaikeystore to keystore, initially it gave me error as Input not an X.509 certificate.So I opened the .cer file in my text editor and removed the texts before the Begin And End Certificate.Then it got imported correctly by running the
    5.When I tried to sign the jar using command  jarsigner application.jar eaicertkey  -keystore eaikeystore
    it gave the exception as jarsigner: Certificate chain not found for: eaicertkey.  eaicertkey must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.
    Please help me with the step I am missing here.I doubt I am doing something wrong in the import step.
    Thanks in advance.

    you can mail me directly to [email protected], and I'll try to help.
    no guarenty :-)
    Tal
    [email protected]

  • How to use SSLSocket on a signed jar applet?

    Hello:
    OK, I finally could make work my client-server project, not the way I 'd like, but it works.
    Now the problem is this:
    Currently I have my applet in a jar file; saiCte.jar, which is signed in this way:
    keytool -genkey -keystore TECSSDStore.keystore -alias Key1 -keyalg RSA -storepass tttttt -keypass tttttt
    jarsigner  -keystore TECSSDStore.keystore -signedjar  saiCte.jar  temp.jar  Key1  -storepass tttttt -keypass tttttt
    But signature is not useful for appletviewer, in my browser, I supposed that a signed applet would work, but it doesn't. There is a handshake problem. In the server it is:
    javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
    I have to run the applet this way:
    java -Djavax.net.ssl.trustStore=TECSSDStore.keystore -Djavax.net.ssl.keyStorePassword=tttttt -Djava.security.policy=SecPolicy sun.applet.Main Cte.html
    Cte.html is this:
    <applet    code = 'saiCte.class'  archive='saiCte.jar' width='750' height='480'>  </applet>So how could I make my signed jar work in the browser? I considered setting properties, but it worked, I would reveal my password. Currently the only way I know for distributing my applet is including the keystore and password, which is inadmissible, since I signed the jar (or why am I supposed to sign jars if anyway I have to send keystore and passwords?)
    Thanks!

    Questions:
    1. Are you using client authentication in this SSL setup?
    In the server I have this:
    Socket.setWantClientAuth(false);
    I guess if this option is false and the client chooses not to provide authentication information about itself, the negotiations will continue.
    I read in SSLSocket API docs for setUseClientMode that "Servers normally authenticate themselves, and clients are not required to do so. "
    2. What is in this keystore that you want to distribute?
    In my keystore there is only what can be produced with this:
    keytool -genkey -keystore TECSSDStore.keystore -alias Key1 -keyalg RSA -storepass tttttt -keypass tttttt
    Now, I would have to distribute it if I want to run the applet from appletviewer:
    java -Djavax.net.ssl.trustStore=TECSSDStore.keystore -Djavax.net.ssl.keyStorePassword=tttttt -Djava.security.policy=SecPolicy sun.applet.Main Cte.html
    Which is the key of my problem: I do have a certificate, so I should not need to send the keystore and I should be able to run the applet from the browser. Actually it does run, the problem is in the connection:
    In the client: (from firefox's Java console:)
    javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
         at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
         at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown Source)
         at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
         at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
         at java.io.DataInputStream.readInt(Unknown Source)
         at r.a(Unknown Source)
         at X.actionPerformed(Unknown Source)
         at java.awt.Button.processActionEvent(Unknown Source)
         at java.awt.Button.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
         at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
         at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
         at sun.security.validator.Validator.validate(Unknown Source)
         at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(Unknown Source)
         at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
         at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
         ... 23 more
    Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
         at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
         at java.security.cert.CertPathBuilder.build(Unknown Source)
         ... 29 more
    In the server:
    javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
    at java.io.FilterInputStream.read(Unknown Source)
    at Tipos.TString.Read(TString.java:62)
    at saiSrv$ConsultaServidor.run(saiSrv.java:1045)
    Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
    at java.io.DataOutputStream.writeInt(Unknown Source)
    at saiSrv$ConsultaServidor.<init>(saiSrv.java:1030)
    at saiSrv.<init>(saiSrv.java:970)
    at saiSrv.main(saiSrv.java:993)
    OK, thanks for the help, it's midnight in America, (you are in australia aren't you) so I'm going to the bed, can we continue chatting tomorrow?

  • How use PGP encription with Java

    Hello,
    Someone knows or have worked using in Java PGP
    encription ?
    I need to work with this, but, i need to know if exits
    *.jar for PGP in order to use in my Java code.
    Any help is greatly appreciated.
    -Angel

    here by is my code
    import java.sql.*;
    import java.io.*;
    import java.lang.Object;
    import java.util.*;
    import javax.naming.*;
    ////////Encyption Process
    ///////Track Pgp Message
    /////return the status  val to main
    class e4p_PgpEncryption
         private String userid="";//"[email protected]"
         private String fileName;// file to be encrypted
         private String filePath; // file path for the file to be encrypted
         private Runtime rt;
         private Process processCmd;
         private String batchId;//id from bachfile_details table
         private String processFile; // file name after taking care of space
         private String successString; // the string to be checked for success
         private int fileNotFoundErr; // if file not exit for encryption
         private int fileExistErr;
         private int ioExceptionErr;
         private String pgpReturnMsg; // net message from encryption process
         private int fileEncrytionFlag; // decide the encryption
         private int unableToAdduserid; // if key file can not be added in public key ring
         private int keyNotSigned; // if public key is not signed key
         private int pgpDbConnectionError;
         private int databaseUpdationErr;
         private int directoryErr;
         private String errMsg;
         private int encryptedFile=0;
         private String keyErrString;// string for matching error message
         private int keyErrFlag; // if no matching key found
         private int userIdNotmention; // if user id is not mentained or null user id
         private String rec_id=""; // rec id from edi_misc
         e4p_PgpEncryption()
         public void setInitialValues(String ffName,String ffPath,String batidd,String publickeyy,String recid )
              int i=0;
              pgpReturnMsg="";
              encryptedFile=0;
              errMsg="";
              fileName=ffName;
              filePath=ffPath;
              batchId=batidd;
              userid=publickeyy;
              rec_id=recid;
              processFile="";
              successString="";
              keyErrString="";
         public void setFlagValues()
              fileNotFoundErr=0;
              fileExistErr=0;
              ioExceptionErr=0;
              fileEncrytionFlag=0;
              pgpDbConnectionError=0;
              databaseUpdationErr=0;
              directoryErr=0;
              keyErrFlag=0;
              userIdNotmention=0;
              unableToAdduserid=0;
              keyNotSigned=0;
          * update the file status after encryption in batchfiles_detail table
         public void updateDataBase()
              int dbstat=0;
                   //checkConnection();
                   int filestat=2;
                   int row =1;//tmp set
                   try
                        if(e4p_ConfigurationLoader.conn.isClosed()==true)
                             Exception ee=new Exception();
                             dbstat=e4p_DatabaseConnectionChecker.invokeDBChecker(this,0,ee);
                        if(dbstat==1 && e4p_ConfigurationLoader.mainlSentFlag==0)
                        else
                        Statement stmt = e4p_ConfigurationLoader.conn.createStatement();                      
                   //     row=stmt.executeUpdate("update batchfile_details SET batch_filename='"+newName+"' where  batch_id='"+batchIdd+"'");//Mod cl_id='"+cl_idd+"' and srv_id='"+service_idd+"' and
                        row=stmt.executeUpdate("update batchfile_details SET file_status='"+filestat+"' where  batch_id='"+batchId+"'");//Mod cl_id='"+cl_idd+"' and srv_id='"+service_idd+"' and
                        if(row==0)
                        databaseUpdationErr=1;
                        else
                        databaseUpdationErr=0;
                        stmt.close();
                   catch (Exception E)
                     databaseUpdationErr=1;
                     //     String mailSubject="Error:e4p_Database connection error";
                        //     String mailContent="error in connection to e4p_Database after reestablishing connection Message: "+E.getMessage();
                        //     e4p_MailSender.send(mailSubject,mailContent);
                        //     E.printStackTrace();
                        dbstat=e4p_DatabaseConnectionChecker.invokeDBChecker(this,0,E);
          * method used to compose the response from pgp encryption process
         public void pgpMessaging(String message)
              if(ioExceptionErr==1)
                  pgpReturnMsg="-13"+"Encryption  Error: IO Exception occured";
             else
             if(fileNotFoundErr==1)
                  pgpReturnMsg="-14"+fileName+" Encryption Error: File/path does not exist";
                  String mailSubject="Error:File not found for decryption";
                   String mailContent=processFile+"does not exits for Encryption process";
                   e4p_MailSender.send(mailSubject,mailContent);
             ///file or path is incorrect
             else
             if(pgpDbConnectionError==1)
                  pgpReturnMsg="-15"+"Pgp e4p_Database connection error";
             else
             if(databaseUpdationErr==1)
                  pgpReturnMsg="-16"+"Error while updating dataBase in Pgp";
              else
             if(fileEncrytionFlag==1)
                  pgpReturnMsg="1"+fileName+" Encrypted SuccessFully;";
             else
             if(directoryErr==1)
                  pgpReturnMsg="-17 "+filePath+" Directory is not valid";
                  String mailSubject="Error:Directory does not exist";
                   String mailContent="Directory: "+filePath+ " is not a valid Directory";
                   e4p_MailSender.send(mailSubject,mailContent);
             else
             if(keyErrFlag==1)
                  pgpReturnMsg="-18 "+keyErrString;
                  String mailSubject="Error:Public key not Matching";
                   String mailContent=keyErrString +" for encrypting file "+processFile;
                   e4p_MailSender.send(mailSubject,mailContent);
             else
             if(userIdNotmention==1)
                  pgpReturnMsg="-19"+" user id not mentioned or null userid";
             else
             if(unableToAdduserid==1)
                  pgpReturnMsg="-20"+message;
             else
             if(keyNotSigned==1)
                  pgpReturnMsg="-21"+userid+ " is not signed key id";
                  String mailSubject="Error: "+userid+ " is not signed id";;
                   String mailContent=userid+ " is not signed id unable to encrypt file "+processFile;
                   e4p_MailSender.send(mailSubject,mailContent);
          * success string for checking the response from pgp
         public void makeSuccessString()
              successString="Transport armor file:"+" "+processFile+".asc";//this is the string used to indicate
              System.out.println("Print success string:"+successString);
                                                                                         //successfull completion     
          * message for checking the error
         public void makePublicErrorString()
              keyErrString="Cannot find the public key matching userid '"+userid+"'";     
          * used for composing filename used for encryption process with caring space problem
         public void setNamePath()
              processFile=filePath+ "/" + fileName;
              makeSuccessString();
              System.out.println("Path:"+processFile);
              char cc='"';
              StringBuffer ss=new StringBuffer("");
              ss.append(cc);
              ss.append(processFile);
              ss.append(cc);
              processFile=ss.toString();
          * ///actually encypting the file and track success message from Pgp
          * execute the pgp from  command line
         public void doEncryption()
              //System.out.println("inside doEncryption");
              rt=Runtime.getRuntime();
              String makePgpString="";
              //batch mode avoid the process hanging
              // command="pgp +pubring=public key ring path +batchmode -ea file to be encrypt user id for encrption"
              makePgpString="pgp +pubring="+e4p_ConfigurationLoader.pubringPath+" +batchmode -ea "+processFile+" "+userid;//imposed error
         //     makePgpString="cd";
              String ls_str="";
              BufferedReader buffer;
              try
                   processCmd=rt.exec(makePgpString);
                   buffer=new BufferedReader(new InputStreamReader(processCmd.getInputStream()));
                ls_str = buffer.readLine();
                int countLine=0;
                        System.out.println("Start printl=ing;");
                     while (ls_str!= null)
                              System.out.println(ls_str);
                          countLine++;
                           //System.out.println(ls_str);
                           if(ls_str.equals(successString)) //check the success string is found
                                ///successtring is encyption completed message
                                //System.out.println("The total count lines are:"+countLine);
                                fileEncrytionFlag=1; // sucess flag
                                //System.out.println("File encrypted successfully: Flag is"+fileEncrytionFlag);
                           if(ls_str.equals(keyErrString))
                                keyErrFlag=1;     
                            ls_str = buffer.readLine();
                    if(countLine==4) // count line for file not found message
                         ///pgp subprocess string contains 4 lines
                         //System.out.println("File path not found");
                         fileNotFoundErr=1;
                    if(countLine>=15) // count line for key not signed message
                         keyNotSigned=1;
                    buffer.close();
                    processCmd.destroy();
                         System.out.println("********The total count lines are:"+countLine);
              catch(Exception e)
                   e.printStackTrace();
                   ioExceptionErr=1;
          * check the file is already in encrypted format if there then delete
         public void checkFileExist()
                        int len=0;
                        //System.out.println("checking files:"+fileName[no]);
                       String checkFilename=fileName+".asc";// check the encryption format file
                       int i=0;
                        File checkfile[];
                        //System.out.println("file Path"+filePath[no]);
                       File dir=new File(filePath);
                       if(dir.isDirectory()==true)
                            checkfile=dir.listFiles();
                            len=checkfile.length;
                            String tmpname="";
                            for(i=0;i<len;i++)
                                 tmpname=checkfile.getName().toString();
                             if(checkFilename.equals(tmpname))
                                  fileExistErr=1;     
                                  if(checkfile[i].delete()){ System.out.println(tmpname +" deleted");}
                                  //delete the file
                                  break;
                   else
                        directoryErr=1;
         * update the new user id added in the keyring to edi_misc table
         public void updateUserid()
              int dbstat=0;
              //checkConnection();
              try
                   if(e4p_ConfigurationLoader.conn.isClosed()==true)
                        Exception ee=new Exception();
                        dbstat=e4p_DatabaseConnectionChecker.invokeDBChecker(this,0,ee);
                   if(dbstat==1 && e4p_ConfigurationLoader.mainlSentFlag==0)
                   else
                        String keepnull="";
                        Statement stmt = e4p_ConfigurationLoader.conn.createStatement();
                        stmt.executeUpdate("update edi_misc SET enc_id='"+userid+"',enc_publickeypath='"+keepnull+"' where rec_id='"+rec_id+"' ");
                        stmt.close();
              catch(Exception ee)
                        //     String mailSubject="Error:e4p_Database connection error";
                        //     String mailContent="error in connection to e4p_Database after reestablishing connection Message: "+ee.getMessage();
                        //     e4p_MailSender.send(mailSubject,mailContent);
                   dbstat=e4p_DatabaseConnectionChecker.invokeDBChecker(this,0,ee);
         public void checkConnection()
              try
                   if(e4p_ConfigurationLoader.conn.isClosed()==true)
                        e4p_ConfigurationLoader.setDataBaseConnection();
              }catch(Exception ee){ e4p_ConfigurationLoader.setDataBaseConnection();}
         * pgp encryption process entry point
         * call encryption process
         * synchronize the message
         public String pgpEncryptionStarter(String fName,String fPath,String batid,String publickey,String importPath,String reccid)
                   setInitialValues(fName,fPath,batid,publickey,reccid);
                   //import key calling facility
                   e4p_PgpkeyImport pgpImport=new e4p_PgpkeyImport();
                   String response=pgpImport.keyImportStarter(importPath);
                   //check the response and get the public key
                   if(response.charAt(0)!='1')
                        String colectRes=response.substring(2,response.length());
                        unableToAdduserid=1;
                        pgpMessaging(colectRes);
                   else
                        response=response.substring(1,response.length());
                        int indexval=response.indexOf("$"); // read the user id pass from pgp import
                        if(indexval==-1)
                        else
                             String extractid=response.substring(indexval+2,response.length()-1);
                             userid=extractid;
                             updateUserid();
                        setFlagValues();
                        if(filePath.startsWith("/")==false)
                             filePath=e4p_ConfigurationLoader.relative_path+"/"+filePath;
                        //filePath="/"+filePath;
                        else
                             filePath=e4p_ConfigurationLoader.relative_path+filePath;
                        checkFileExist(); // check the file exist for encryption
                        if(directoryErr==0)
                             setNamePath();//no error reporting
                        //     makeSuccessString();//no error reporting
                             makePublicErrorString();
                             if(userid.equals("") || userid==null)
                                  userIdNotmention=1;
                                  pgpMessaging("");
                             else
                                  char cc='"';
                                  StringBuffer ss=new StringBuffer("");
                                  ss.append(cc);
                                  ss.append(userid);
                                  ss.append(cc);
                                  userid=ss.toString();
                                  doEncryption();// error reporting file not found/ioexception/encryption flag
                        else
                             pgpMessaging("");
                        if(fileNotFoundErr==1)
                             pgpMessaging("");
                        if(ioExceptionErr==1)
                             pgpMessaging("");
                        if(keyErrFlag==1)
                             pgpMessaging("");
                        if(keyNotSigned==1)
                             pgpMessaging("");
                        if(fileEncrytionFlag==1)
                             pgpMessaging("");
                             updateDataBase();//update file name from txt to .asc file
                                            //error reporting updation error
                             if(databaseUpdationErr==1)
                                  pgpMessaging("");
                   System.out.println("Pgp message :"+pgpReturnMsg);
                   return pgpReturnMsg;

  • Loading images in a signed jar

    Hi,
    I am trying to run an application using signed jars.
    One of the jars contains gif and jpeg files (icons).
    When I sign icons.jar and try to run the code (from
    the command line), I get the error listed below.
    Any help would be greayly appreciated.
    Thanks
    Charles
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x76136B9
    Function=JNI_OnLoad+0x24D
    Library=C:\j2sdk1.4.2_02\jre\bin\jpeg.dll
    Current Java thread:
         at sun.awt.image.JPEGImageDecoder.readImage(Native Method)
         at sun.awt.image.JPEGImageDecoder.produceImage(JPEGImageDecoder.java:144)
         at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:254)
         at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
         at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
    Dynamic libraries:
    0x00400000 - 0x00407000      C:\j2sdk1.4.2_02\bin\javaw.exe
    0x77F50000 - 0x77FF6000      C:\WINDOWS\System32\ntdll.dll
    0x77E60000 - 0x77F45000      C:\WINDOWS\system32\kernel32.dll
    0x77DD0000 - 0x77E5B000      C:\WINDOWS\system32\ADVAPI32.dll
    0x78000000 - 0x7806E000      C:\WINDOWS\system32\RPCRT4.dll
    0x77D40000 - 0x77DC6000      C:\WINDOWS\system32\USER32.dll
    0x77C70000 - 0x77CB0000      C:\WINDOWS\system32\GDI32.dll
    0x77C10000 - 0x77C63000      C:\WINDOWS\system32\MSVCRT.dll
    0x08000000 - 0x08138000      C:\j2sdk1.4.2_02\jre\bin\client\jvm.dll
    0x76B40000 - 0x76B6C000      C:\WINDOWS\System32\WINMM.dll
    0x10000000 - 0x10007000      C:\j2sdk1.4.2_02\jre\bin\hpi.dll
    0x00820000 - 0x0082E000      C:\j2sdk1.4.2_02\jre\bin\verify.dll
    0x00830000 - 0x00849000      C:\j2sdk1.4.2_02\jre\bin\java.dll
    0x00850000 - 0x0085D000      C:\j2sdk1.4.2_02\jre\bin\zip.dll
    0x03240000 - 0x0334F000      C:\j2sdk1.4.2_02\jre\bin\awt.dll
    0x73000000 - 0x73023000      C:\WINDOWS\System32\WINSPOOL.DRV
    0x76390000 - 0x763AA000      C:\WINDOWS\System32\IMM32.dll
    0x771B0000 - 0x772C0000      C:\WINDOWS\system32\ole32.dll
    0x5AD70000 - 0x5ADA4000      C:\WINDOWS\system32\uxtheme.dll
    0x033C0000 - 0x03410000      C:\j2sdk1.4.2_02\jre\bin\fontmanager.dll
    0x73760000 - 0x737A5000      C:\WINDOWS\System32\ddraw.dll
    0x73BC0000 - 0x73BC6000      C:\WINDOWS\System32\DCIMAN32.dll
    0x73940000 - 0x73A07000      C:\WINDOWS\System32\D3DIM700.DLL
    0x07610000 - 0x0762E000      C:\j2sdk1.4.2_02\jre\bin\jpeg.dll
    0x76C90000 - 0x76CB2000      C:\WINDOWS\system32\imagehlp.dll
    0x6D510000 - 0x6D58C000      C:\WINDOWS\system32\DBGHELP.dll
    0x77C00000 - 0x77C07000      C:\WINDOWS\system32\VERSION.dll
    0x76BF0000 - 0x76BFB000      C:\WINDOWS\System32\PSAPI.DLL
    Heap at VM Abort:
    Heap
    def new generation total 576K, used 571K [0x10010000, 0x100b0000, 0x104f0000)
    eden space 512K, 99% used [0x10010000, 0x1008ecb8, 0x10090000)
    from space 64K, 99% used [0x100a0000, 0x100afff8, 0x100b0000)
    to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000)
    tenured generation total 1784K, used 1163K [0x104f0000, 0x106ae000, 0x14010000)
    the space 1784K, 65% used [0x104f0000, 0x10612c28, 0x10612e00, 0x106ae000)
    compacting perm gen total 6912K, used 6759K [0x14010000, 0x146d0000, 0x18010000)
    the space 6912K, 97% used [0x14010000, 0x146a9c48, 0x146a9e00, 0x146d0000)
    Local Time = Sun Oct 26 16:26:58 2003
    Elapsed Time = 10
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_02-b03 mixed mode)
    # An error report file has been saved as hs_err_pid3068.log.
    # Please refer to the file for further information.
    Corrupt JPEG data: bad Huffman code

    http://developer.java.sun.com/developer/bugParade/bugs/4675817.html
    You must try using WinZip & not compressing the jpeg's.

  • URLClassLoader + dynamically loading signed jar files

    I have an applet that does not know all of the jar files it will need to load at startup.
    I would like to dynamically load these signed jar files using the URLClassLoader, however it does not recognize these jar files as being signed and I get java.security.AccessControlException: access denied errors.
    Any suggestions?
    Thanks!

    Try this classloader for loading the jars, it should to the trick:
    import java.net.URL;
    import java.net.URLClassLoader;
    import java.net.URLStreamHandlerFactory;
    import java.security.AllPermission;
    import java.security.CodeSource;
    import java.security.PermissionCollection;
    import java.security.Permissions;
    public class AllPermissionsClassLoader extends URLClassLoader {
        public AllPermissionsClassLoader (URL[] urls) {
            super(urls);
        public AllPermissionsClassLoader (URL[] urls, ClassLoader parent) {
            super(urls, parent);
            System.out.println(parent);
        public AllPermissionsClassLoader (URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory) {
            super(urls, parent, factory);
        protected PermissionCollection getPermissions (CodeSource codesource) {
            Permissions permissions = new Permissions();
            permissions.add(new AllPermission());
            return permissions;
    }

  • Different signed jars need to be passed to the client.

    Hi,
    My requirement is that I have a list of my jar files that are signed by me and a set of another jar files that are not signed by me, but a third party. I require that these be signed by the third party only. I need to pass this files on to the client.
    I cannot put the jars with different signatures under the same jnlp.
    I am trying to embed one jnlp (the one that has third party signed jars) inside the main jnlp (the jnlp that will be called from my html). But I am not able to do so,
    Please provide any help. Also is there any other approach that can be used.
    Thaks in advance.

    tcstcs,
    One thing you could do is manually go in and delete the 3rd party's signature from the second JAR file, and re-sign that jar with your own signature. I'm not 100% sure this is what you should be doing, but you could give it a shot. Open up the 3rd party JAR in WinZip and delete the meta-inf path. This contains the signature. Now you can re-sign that jar with your own signature, and they will all match up so you can use them in the same JNLP file. Hope this helps,
    Mark

  • Problem Packing Signed JARs of more than 10 MB

    Hi friends of Java,
    there seems to be a size issue when packing signed JARs.
    When I try to pack a signed JAR of about 5 MEGs (such as the jbossall_client.jar file) it works (i.e. jarsigner can verify the result),
    but if i try doing it with a JAR of about 11 MEGs the jarsigner can't verify the packed (and unpacked again) file.
    Example:
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>dir temp\webstart\BasisWebClient.jar
    06.03.2009 17:32 10.943.963 BasisWebClient.jar
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>pack200 --repack temp\webstart\BasisWebClient.jar
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>jarsigner -storepass xxxxxx -keystore resources\build\key\BasisWebKeystore temp\webstart\BasisWebClient.jar BasisWeb
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>jarsigner -verify temp\webstart\BasisWebClient.jar
    jar verified.
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>pack200 temp\webstart\BasisWebClient.jar.pack.gz temp\webstart\BasisWebClient.jar
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>unpack200 temp\webstart\BasisWebClient.jar.pack.gz test.jar
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>jarsigner -verify test.jar
    jarsigner: java.lang.SecurityException: SHA1 digest error for basisweb/vg/presenter/SchluesselBezeichnungDialogPresenter.class
    The same with a smaller file:
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>dir temp\webstart\jbossall-client.jar
    31.08.2007 07:31 4.895.807 jbossall-client.jar
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>pack200 --repack temp\webstart\jbossall-client.jar
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>jarsigner -storepass xxxxx -keystore resources\build\key\BasisWebKeystore temp\webstart\jbossall-client.jar BasisWeb
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>jarsigner -verify temp\webstart\jbossall-client.jar
    jar verified.
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>pack200 temp\webstart\jbossall-client.jar.pack.gz temp\webstart\jbossall-client.jar
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>unpack200 temp\webstart\jbossall-client.jar.pack.gz test.jar
    C:\p\u\ccm_wa\basis_web\santafu~tnagel\santafu>jarsigner -verify test.jar
    jar verified.
    It also works when I split the original JAR in multiple parts. Any ideas?
    Used Java Version:
    java version "1.6.0_12"
    Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
    Java HotSpot(TM) Client VM (build 11.2-b01, mixed mode, sharing)
    OS: Windows XP Pro Version 2002 SP2
    PC: Intel Pentium 4 3.2GHz, 2GB RAM, 160 GB HD
    Regards from Germany,
    Thomas Nagel

    Hello Bryan,
    I dont have a solution yet. Currently we use the jars uncompressed. Sad, but that works.
    For the future, we are not really sure wether we can stick with JWS, as the signed JNLP-file-issue might make us even more trouble.
    I've done some error search. Look at the following.
    Try for your own with some different sized jar's, and maybe post the results (definitely if they all pass):
    --- snip ----
    package ctest;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.Enumeration;
    import java.util.Map;
    import java.util.jar.*;
    import java.util.jar.Pack200.*;
    * @author tnagel
    public class PackTest implements Runnable {
         String test1 = "junit";
         String test2a = "xalan";
         String test2 = "jbossall-client";
    String test3 = "BasisWebClient2";
    String dir = "/tmp/";
    String ext1 = ".jar";
    String ext2 = ".jar.pack.gz";
    //String infile = "/tmp/BasisWebClient.jar";
    //String outfile = "/tmp/BasisWebClient.jar.pack.gz";
    //String testfile = "/tmp/testaus.jar";
    * @param args the command line arguments
    public static void main(String[] args) {
         PackTest me = new PackTest(args);
    public PackTest(String[] args) {
    this.run();
    public void setProperties(Packer packer) {
    // Initialize the state by setting the desired properties
    Map p = packer.properties();
    // take more time choosing codings for better compression
    p.put(Packer.EFFORT, "9"); // default is "5"
    //// use largest-possible archive segments (>10% better compression).
    // p.put(Packer.SEGMENT_LIMIT, "-1");
    //// reorder files for better compression.
    //p.put(Packer.KEEP_FILE_ORDER, Packer.FALSE);
    //// smear modification times to a single value.
    //p.put(Packer.MODIFICATION_TIME, Packer.LATEST);
    //// ignore all JAR deflation requests,
    //// transmitting a single request to use "store" mode.
    //p.put(Packer.DEFLATE_HINT, Packer.FALSE);
    //// discard debug attributes
    //p.put(Packer.CODE_ATTRIBUTE_PFX+"LineNumberTable", Packer.STRIP);
    // throw an error if an attribute is unrecognized
    p.put(Packer.UNKNOWN_ATTRIBUTE, Packer.ERROR);
    //// pass one class file uncompressed:
    //p.put(Packer.PASS_FILE_PFX+0, "mutants/Rogue.class");
    @Override
    public void run() {
         doTest(test1, true);
         doTest(test2, true);
         doTest(test3, true);
         doTest(test3, true);
         doTest(test3, true);
    private void doTest(String test, boolean compare) {
    String infile = dir + test + ext1;      // "/tmp/BasisWebClient.jar";
    String outfile = dir + test + ext2; // "/tmp/BasisWebClient.jar.pack.gz";
    String testfile = dir + test+ "-aus" + ext1;
    try {
         countJar(infile, false);
         JarFile jarFile = new JarFile(infile);
    FileOutputStream fos = new FileOutputStream(outfile);
    // Create the Packer object
    Packer packer = Pack200.newPacker();
    setProperties(packer);
    // call the packer
    long startTimeMethode =System.currentTimeMillis();
    packer.pack(jarFile, fos);
    System.out.println("Time for Pack: " + (System.currentTimeMillis() - startTimeMethode));
    jarFile.close();
    fos.close();
    File f = new File(outfile);
    FileOutputStream fostream = new FileOutputStream(testfile);
    JarOutputStream jostream = new JarOutputStream(fostream);
    Unpacker unpacker = Pack200.newUnpacker();
    // Call the unpacker
    startTimeMethode =System.currentTimeMillis();
    unpacker.unpack(f, jostream);
    System.out.println("Time for Unpack: " + (System.currentTimeMillis() - startTimeMethode));
    // Must explicitly close the output.
    jostream.close();
         countJar(testfile, false);
         if(compare) compareJars(infile,testfile);
    } catch (IOException ioe) {
         System.err.println(ioe);
    ioe.printStackTrace();
    private void countJar(String filename, boolean showDetails) {
         JarFile jarFile1 = null;
         try {
              int entries = 0;
              long sizeTotal = 0L;
              long compressedSum = 0L;
              jarFile1 = new JarFile(filename);
              Enumeration e = jarFile1.entries();
              while(e.hasMoreElements()) {
                   JarEntry jarE = (JarEntry) e.nextElement();
                   entries ++;
                   sizeTotal += jarE.getSize();
                   compressedSum += jarE.getCompressedSize();
                   if(showDetails) {
                        System.out.println( jarE.getName() + " s= " + jarE.getSize() + " c= " + jarE.getCompressedSize() );
              System.out.println( filename + ": " + entries + " entries, " + sizeTotal + " Byte, compressed " + compressedSum + " Byte" );
    } catch (IOException ioe) {
         System.err.println(ioe);
    ioe.printStackTrace();
    } finally {
         try { if(jarFile1 != null) jarFile1.close(); } catch (Exception e) { }
    private void compareJars(String erstes, String zweites) {
         JarFile jarFile1 = null;
         JarFile jarFile2 = null;
         try {
              int fehler = 0;
              int entries = 0;
              jarFile1 = new JarFile(erstes);
              jarFile2 = new JarFile(zweites);
              Enumeration e1 = jarFile1.entries();
              Enumeration e2 = jarFile2.entries();
              while(e1.hasMoreElements()) {
                   JarEntry jarE1 = (JarEntry) e1.nextElement();
                   if(e2.hasMoreElements()) {
                        JarEntry jarE2 = (JarEntry) e2.nextElement();
                        entries++;                    
                        if(!jarE1.getName().equals(jarE2.getName())) {
                             System.out.println( "Name different at Index= " + entries+ " n1=" + jarE1.getName() + " n2=" + jarE2.getName() );
                             fehler ++;
                             break;
                        if(jarE1.getSize() != jarE2.getSize()) {
                             System.out.println( "Size different at bei " + jarE1.getName() + " Index= " + entries + " s1=" + jarE1.getSize() + " s2=" + jarE2.getSize());                         
                             fehler ++;
                        if(jarE1.getCrc() != jarE2.getCrc()) {
                             System.out.println( "CRC different at " + jarE1.getName() + " Index= " + entries + " s1=" + jarE1.getCrc() + " s2=" + jarE2.getCrc());                         
                             fehler ++;
                        if(jarE1.getMethod() != jarE2.getMethod()) {
                             System.out.println( "Method different at " + jarE1.getName() + " Index= " + entries + " m1=" + jarE1.getMethod() + " m2=" + jarE2.getMethod());                         
                             fehler ++;
              System.out.println( "Errors= " + fehler + " entries=" + entries );
    } catch (IOException ioe) {
         System.err.println(ioe);
    ioe.printStackTrace();
    } finally {
         try { if(jarFile1 != null) jarFile1.close(); } catch (Exception e) { }
         try { if(jarFile2 != null) jarFile2.close(); } catch (Exception e) { }
    --- snip ----
    Cheers,
    Thomas

  • IE - signed cab vs. signed jar problems

    In IE on Windows when I sign an applet that is part of a package in a cab file it works like this; The first time the user hits the applet tag, IE downloads the cab and asks if you trust the applet. When the user clicks yes, it is installed to the downloaded program files system folder. The next time the user hits the applet tag the version in useslibraryversion param is compared to the installed cab and the applet is run without asking the user or attempting to download the cab, even if IE is restarted or the system rebooted.
    When I use my signed jar I get two undesired results, when IE is restarted the jar is downloaded again and the user is asked if they trust it again. Any way to make this work like the cab as far as not downloading the second time and not asking the user again?

    as far as not downloading the second time How about checking the server settings, (last-modified and expires??)
    and not asking the user again?Allways trust?

  • JNLP: Signed jars but still not trusted

    I have an applet that has signed jars that were signed by the same key, the applet shows the correct warnings on startup and works fine (allows access to the local file system, etc), however there still exists the 'yellow triangle warning' on one of two popups frames that the applet produces (but not the other one).
    The applet does use native code (packaged in a signed jar and referenced in the JNLP). The jars are all signed by the same certificate from a CA. I originally didn't have the JNLP signed (by placing it in the main jar in JNLP-INF/APPLICATION.JNLP) but this didn't help. Also I didn't have the JNLP codebase set to a real URL (and really cant in production because its a solution we deploy to customers servers - its packaged software not hosted) but even after I tested with a codebase to a test server, it still didnt remove the famed yellow triangle. I have all-permissions set in the JNLP.
    So two related questions:
    1) Other than having not having signed jars (or not signed correctly), what other reasons cause the 'yellow triangle'?
    2) The warning only appears on one of the popup Frames. What could be the possible reasons for that? Are there some privileges that show the icon whether the applet is signed or not?
    Note: While changing the client policy setting (showWindowWithoutWarningBanner) works, this cant be a solution.
    From the Java Console:
    ...It goes through all the jars (I only included one for brevity - there are 23 of them). Note it says 'have 1 common certificates'.. which I think indicates everything is signed by the same cert.
    Is there any indication in the console logs I can use to determine why it is not trusted? It looks (to me) that everything is OK, until it says 'istrusted=false'.
    security: Validating cached jar url=http://10.192.252.26/QMDesktop/native.jar ffile=C:\Documents and Settings\bunkowm\Application Data\Sun\Java\Deployment\cache\6.0\34\1df0b62-2c3ce377 com.sun.deploy.cache.CachedJarFile@d964af
    cache: Reading Signers from 995 http://10.192.252.26/QMDesktop/native.jar | C:\Documents and Settings\bunkowm\Application Data\Sun\Java\Deployment\cache\6.0\34\1df0b62-2c3ce377.idx
    security: Have 1 common certificates after processing http://10.192.252.26/QMDesktop/native.jar
    security: Istrusted: null false
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA hasnt been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    security: Mark trusted: null

    Andrew - of course you were correct about the signed cert - I misspoke when the CA signed applet didn't show a warning. (You were also right that I must have checked 'always accept' the certificate on the server I had the CA signed cert on).
    I think you guys are on to something about the privileged actions. It would explain where one popup has the icon and the other doesn't. We have Javascript making calls into the applet and we do use JNI (although I don't think there are any calls back). We do wrap these calls in privileged actions but maybe we missed something. What I've seen before is a security exception is thrown if we don't wrap them - but maybe there are areas where we don't and it doesn't throw an exception or it does and we eat it somehow (and for whatever reason doesn't cause anything noticeable).
    Now that I know it could likely be the applet code and not necessarily a build issue with signing the jars, I have another place to look...
    I'll check it out and let you know what I find.

  • Read binary files that are wraped in the downloaded executable signed jar

    Hello, there:
    I have created a Swing application and created a signed jar file and uploaded it to my site. The signed jar includes class packages, and a folder of binary files which are the datasource for my application.
    jws downloads this signed executable jar, it'll automatically run it, but it has problems reading the binary folders wrapped in itself (the app is supposed to read the folder's structure and use the info to create a JTree object, and read the file's content as well). Is it the file path conversion problem? Do we need to use URL instead? I tried it after reading some threads on this forum but didn't make it.
    As an alternatives, I want JWS to unjar the jar file and expand it to exploded files. I manually unjar it and run the app from command line, it works fine.
    Plus, the app is supposed to manipulate the binary files when it's in process, like saving new content back to the files, zip the files and upload them to the remote sql server. therefore, I think it's easy to have it run when it's expanded.
    So here is the question: JWS by default is running the executable jar, is there a way to tell JWS to unzip the jar and find the main class in the exploded files and run it?
    Thanks a lot for your suggestions,
    Sway

    You can get to any resource in a jar file in your classpath. The code below will return InputStream for resource.bin nested two packages down.
    InputStream in = YourClass.class.getResourceAsStream("/com/mypackage/resouce.bin");  //use '/' instead of '.'You can open a FileOutputStream to write that file.
    OutputStream out = new FileOutputStream("myTempResource.bin");
    IOUtil.streamAndClose(in,out);If the resouce is a nested zip or nested jar then you can use the Java Zip utilities to unwrap the stream.

Maybe you are looking for

  • Dunning report driver program

    Hi,    I see a dunning sap script z_asia_dunning assigned in Dunning procedure.  I am interested in knowing the driver program for this dunning script.    I searched in SDN and failed to get this information.  Please let me know how to get a driver p

  • Photoshop CS6 - Very Slow Brush Speeds...

    Hi: I thought CS5 was bad, but brushing with CS6 all brush strokes are very, very slow. If I make a brush stoke I have literally have to put my hand on my chin and wait for the brush to catch up. I cannot work like this. Any suggestions on what to do

  • Adobe CC 2015 issues

    Anyone else facing issues with Adobe?We have about 25 users that work on graphics in our company, they use: - Illustrator - Photoshop - InDesign, etc...Since Adobe (auto)-updated their software from 2014 to 2015 edition, all of our users are complain

  • S20-30 Touch - no usb, touchscreen and camera problems

    Hi all, i have a s20-30 touch with windows 8.1 running, recently ive noticed that my usb has stopped working. when go to device manager it says universal serial bus controller are not installed code 28 - i can not find any drivers for windows 8.1 64

  • BUILDING DIMENSION FROM ORACLE SORCE

    Hi, I am building dimensions from Oracle source using Hyperion SQL Interface. The Rule file is successfully created. However when I tried Update outline, it fails. In the log file I observe the message, Failed in initialization of log file. If anyone