PLEASE HELP! how to get certificat form a JarFile (NOT JarInputStream) ?

Hi,
I have a signed JAR-file.
If I try to verify this file with "jarsigner -verify", I get OK.
But if I want to get the certificat-chain from this JAR-file with
"JarFile" and then "JarEntry", I receive only "null".
For example I try it with this code:
JarEntry entry;
java.security.cert.Certificate[] dmCertChain;
for (Enumeration enumJar2 = zipFile.entries();enumJar2.hasMoreElements() ;) {
entry = zipFile.getJarEntry((enumJar2.nextElement()).toString());
dmCertChain = ((JarEntry)entry).getCertificates();
if(dmCertChain == null) {
          System.out.println("The entry has no certificate.");
else {
          System.out.println(dmCertChain.length);
          for (int i = 0; i < dmCertChain.length; i++)
          System.out.println(dmCertChain<i>.toString());
But my JAR-file is ok, because when I try it with "JarInputStream" and
then "JarFile", I receive the correct certificate-chain.
(I try it with getNextJarEntry())
How can I read the certfication-chain from the JarFile?
I searched the web for a solution, but i don't find an answer!
So please HELP!

I found the solution :-)
I found in Java-api-doc the following sentence:
"This method can only be called once the JarEntry has been completely verified by reading from the entry input stream until the end of the stream has been reached. Otherwise, this method will return null."
So I added this lines to my code:
// JarEntry must be completely verified by reading from the entry
// input stream until the end of the stream has been reached.
InputStream is = zipFile.getInputStream(entry);
int c;
while ((c = is.read()) != -1) {
//do nothing here, just to make sure the whole stream is read
bye

Similar Messages

  • After updating my Macbook Pro retina display to os x yosemite 10.10.2, the mause and track pad locks, and do not respond especially when using the Mac for a long period, please help, how can I solve this, I do not like feel like in windows, so I paid

    after updating my Macbook Pro retina display to os x yosemite 10.10.2, the mause and track pad locks, and do not respond especially when using the Mac for a long period, please help, how can I solve this, I do not like feel like in windows, so I paid good money for this mack, I feel calm

    Hi Buterem,
    I'm sorry to hear you are having issues with your MacBook Pro since your recent Yosemite update. I also apologize, I'm a bit unclear on the exact nature of the issue you are describing. If you are having intermittent but persistent responsiveness issues with your mouse or trackpad, you may want to try using Activity Monitor to see if these incidents correspond to occupied system resources, especially system memory or CPU. You may find the following article helpful:
    How to use Activity Monitor - Apple Support
    If the entire system hangs or locks up (for example, if the system clock freezes and stops counting up), you may also be experiencing some variety of Kernel Panic. If that is the case, you may also find this article useful:
    OS X: When your computer spontaneously restarts or displays "Your computer restarted because of a problem." - Apple Support
    Regards,
    - Brenden

  • Please help: How to undo accidental paste-over in NOTES?

    Please help: just pasted over an entire (very important) note in an epic fat-finger touch. Please let me know if there is a "command Z" type action I might be able to take to undo, go back, etc. I have not connected phone to sync just yet to see what might be backed up- until I know if there is any way to retrieve the most recent info I just lost. Desperately hoping for an answer out there.

    You cannot view the contents of your backup file.  Your backup does contain notes, but if you can't remember when you last backed up relative to when you created or revised the note, then you can try checking the date stamp of the backup file to see when it was last done (or, if you backup to iCloud then your Settings will tell you).

  • Please Help(How to get RadioButtons in tree View)

    Hi.
    Sub/Requirement: How to implement RadioButtons in tree view with/without using xml file.
    I have a requirement like this i want to display RadioButton in tree view.
    I implemented tree same as which is given in sampleApplications.
    In this sampleApplications they implemted tree by using xml file.
    I also implemented tree by Generating xml file. In this xml file i get the values from the database. I am using <netui:tree > tag.
    Is it possible to implement tree without using xml file. I need to generate tree Dynamically.
    Please any one help me to come out with this solution.

    The issue here is while you are retrieving all the details, you are consistently overwriting them in the request.setAttribute() call before you get to the JSP to display them.
    Do you actually have a class/object called Student?
    That object should have attributes for classes, subjects, teachers (all of which are lists apparently)
    public class Student{
      String name;
      List classes;
      List subjects;
      List teachers;
      // appropriate getter/setter methods
    }Then you load each student, and populate its individual lists.
    That lets you pass the list of students, each student having its own lists for display.
    Hope this helps,
    evnafets

  • I keep getting asked to agreed to the new terms and conditions and can not accept them please help, how to get rid of it?

    I need help please I have my i phone, im setting the icloud and it keeps telling me to accept the new terms and conditions but the page wont populate for me to accept it, im getting annoying with it the pop up us making me crazy plase help.

    Try these...
    1)  Press the Accept Button Twice...
    2)  Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... ( But can take Longer...)
    Release the Buttons...

  • Please help how to get return array from rpg program on java code?

    Hi
    I have created a rpg program that returns 2 parameter 1 is the id and another one is list of array, when I called this program I passed two programparameter from my java code (see the code below) but when i checked what value would be return it is returned only first value of array. how will i get all array values ?
    please suggest me regarding this issues I amn't so much aware on java & AS400.
    try
    ProgramParameter[] parmList = new ProgramParameter[2];
    AS400Text p1 = new AS400Text(10);
    AS400Text p2 = new AS400Text(30);
    try
    parmList[0] = new ProgramParameter(10);
    parmList[1] = new ProgramParameter(30);
    parmList[0].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[1].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[0].setInputData(p1.toBytes("Pune"));
    parmList[1].setInputData(p2.toBytes(" "));
    catch(Exception ex)
    ProgramCall pgm = new ProgramCall(o);
    pgm.setProgram("/QSYS.LIB/XXX/XXX.PGM",parmList);
    if (pgm.run())
    byte s[] = parmList[1].getOutputData(); // HERE I got only first value of returning array.
    parmList[1].getOutputDataLength();
    //String sts = ((String) (new AS400Text(10,o).toBytes(s[0])));
    else
    AS400Message[] messageList = pgm.getMessageList();
    for (int msg = 0; msg < messageList.length; msg++) {
    catch(Exception ex)
    AS400Message[] messageList = null;
    finally
    o.disconnectAllServices();
    Reply With Quote

    Try this :
    try
    ProgramParameter[] parmList = new ProgramParameter[2];
    AS400Text p1 = new AS400Text(10);
    AS400Text p2 = new AS400Text(30);
    AS400Array arrP2 = new AS400Array(p2, 4);
    try
    parmList[0] = new ProgramParameter(10);
    parmList[1] = new ProgramParameter(30);
    parmList[0].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[1].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[0].setInputData(p1.toBytes("Pune"));
    parmList[1].setInputData(arrP2.toBytes({"","","",""}));
    catch(Exception ex)
    ProgramCall pgm = new ProgramCall(o);
    pgm.setProgram("/QSYS.LIB/XXX/XXX.PGM",parmList);
    if (pgm.run())
         Object[] objArr =  (Object [])arrP2.toObject( parmList[1].getOutputData() );
         for(int i =0; i<objArr.length;i++){
                System.out.println( " SKU " + i +" : " + objArr.toString());
    else
    AS400Message[] messageList = pgm.getMessageList();
    for (int msg = 0; msg < messageList.length; msg++) {
    catch(Exception ex)
    AS400Message[] messageList = null;
    finally
    o.disconnectAllServices();

  • Please Help: How to get Image under JDK 1.1

    Hi all out there!
    The following is my problem:
    I need to get an image under JDK1.1.
    What I want to do is get a graphics-object from
    it and draw some stuff onto it. Afterwards I want
    to save it to some file (gif, png). The latter part is
    no problem. But I couldn't find a concrete subclass
    under JDK1.1. I know of BufferedImage in JDK1.2
    but that doesn't help too much since I'm restricted
    to JDK1.1.
    Anyone who can help me with this?
    Greetinx
    Valentin

    hi,
    what about Toolkit.getDefaultToolkit().getImage(String)regards

  • [PLEASE HELP] How to get Microsoft Outlook Rules to work on my Z10

    Hi, 
    My organization recently started deploying Z10 for work. We use Mircosoft Outlook 2010 and I receive many e-mails throughout the day that I filter by setting up rules. 
    These Outlook rules do not seem to transferr over to my Z10 e-mail account as I am being constantly flooded with these "junk" e-mails. 
    I've tried to change the folder sync settings, but that doesn't seemt to rectify the problem. 
    I have Software Release 10.2.0.429 and OS Version 10.2.0.1803
    Does anyone in this community know about this problem and if there's a solution? 
    Thanks so much. 
    - Kyle 

    DoubleK wrote:
    Hi, 
    My organization recently started deploying Z10 for work. We use Mircosoft Outlook 2010 and I receive many e-mails throughout the day that I filter by setting up rules. 
    These Outlook rules do not seem to transferr over to my Z10 e-mail account as I am being constantly flooded with these "junk" e-mails. 
    I've tried to change the folder sync settings, but that doesn't seemt to rectify the problem. 
    I have Software Release 10.2.0.429 and OS Version 10.2.0.1803
    Does anyone in this community know about this problem and if there's a solution? 
    Thanks so much. 
    - Kyle 
    Unfortunately Outllok rules only work within Outlook itself.
    One way that I have found to partially work is to use the IMAP server (if available in your organisation) from both the computer and the device(s), and to keep Outlook running while you are gone, and then the rules works for most of them
    Using the Playbook and the Z10 and the Z30 and loving them
    Martin

  • Please Help,how do i get my iphone 4 to play all my songs from icloud, it is currently only playing just a smal number of songs from my library which is stored in icloud.

    Please Help,how do i get my iphone 4 to play all my songs from icloud, it is currently only playing just a smal number of songs from my library which is stored in icloud.

    There are a number of OS X apps, many free, that will save your messages, allowing to view and print them. 
    http://www.softwarebbs.com/wiki/How_to_transfer_SMS_from_iPhone_to_Mac,_backup_i Phone_SMS_message_on_Mac
    Google, for other options
    Your "other" of 6 GB may include corrupted data or file sytem errors. If after removing the messages there is still >2GB, you will need to restore the phone in iTunes, first using a backup (made after deleting the messages) and if needed as a new iPhone.
    iTunes: Restoring iOS software

  • For updation of IOS 7.1.1 passcode required,I forget my passcode please help how can I get my passcode

    Hello,
    I forget my passcode please help how can I get my it

    You will need to try to restore your iPad from the same computer that you most recently synced to.
    Read this: http://support.apple.com/kb/ht1212
    If you can't do the restore then you will need to try Recovery Mode.
    Read this: http://support.apple.com/kb/ht1808
    Follow the instructions very carefully.

  • I have iOS 6 on my iPhone. i have linked my contacts with facebook and yahoo, which has doubled or triplicated some of the contacts. how can i integrate them into one? please help. it is getting on my nerves. thanks :)

    I have iOS 6 on my iPhone. i have linked my contacts with facebook and yahoo, which has doubled or triplicated some of the contacts. how can i integrate them into one? please help. it is getting on my nerves. thanks

    click on the contact which you want to integrate, click the edit button scroll down u will find a option called link contacts use it to link it to the duplicate contact

  • Please help! I have photoshop and iphoto does not show it in my preferences edit window. How do I get it as an option in my preferences.

    Please help! I have photoshop and iphoto does not show it in my preferences edit window. How do I get it as an option in my preferences.

    I tried it and nothing changed. Even when I right click on an indiviual image all it does is duplicate it. Iphoto seems to be recognizing my external hard drive as an editor......cannot get photoshop except to drag a picture into photoshop from iphoto, and once I have worked on it and saved it to iphoto I cant find it anywhere.

  • Hi, would you please help me to get red of hips of emails that I am receiving from this site? I want to delete my profile. How can I do it?

    Hi, would you please help me to get red of hips of emails that I am receiving from this site? I want to delete my profile. How can I do it?

    Read Frank Caggiano's User Tip here: Stopping emails from ASC

  • HT3630 How to creat an app-enabled accessories for iPhone? Please help me to get an answer..

    How to creat an app-enabled accessories for iPhone? Please help me to get an answer..

    To get hardware interfaces and API's via hardware you
    need to join the MFi program.  That info is here:
    https://developer.apple.com/programs/mfi/
    To get the additional software to be able to download
    and test code on any iDevice, you must join the
    iOS Developer Program.  That info is here:
    https://developer.apple.com/programs/ios/
    Both programs require fees and NDA agreements,
    especially hardware as most vendors that supply
    components development tools will not sell you any
    of their tools unless you are a member of the MFi
    program.

  • My ipad2 is asking old id password, when i go to forget password link for that id then I am not getting any mail to reset the same. Please help how can i remove or change the old id.

    my ipad2 is asking old id password, when i go to forget password link for that id then I am not getting any mail to reset the same. Please help how can i remove or change the old id.

    You cannot remove or change the old ID. This is Find My iPhone Activation Lock. You need to recover the credentials for the Apple ID originally used to activate the iPad.
    Check your spam and junk folders.

Maybe you are looking for

  • FI- AP Open Items - historic postings.

    Hi , I need a Bex report which can be reconcilled with FBL1N (Open items) for any 'Key date". The report has to calculate open items for any past historic key date. (eg: 31.12.2009). I am currently calculating FI - AP , open items as part of aging re

  • ORA 03114 error

    ORA 03114 error  weblogic Forms 11g db 11g winserver 2008 64 bit

  • Portal Upgrade scripts???

    Where have the portal upgrade scripts gone??? Do I need them to transfer from 9iAS Version 1.0.2.2 to Version 1.0.2.2.1??? Please can these IMPORTANT scripts be placed somewhere so that we can find them.

  • Color Laser Printers

    I'm looking to learn from my peers concerning color laser printers for Photoshop.  Photoshop is a hobby not a profession so I can't go crazy monedy-wise; but I am willing to put some skin in the game as I move on from the inkjet world.  This would be

  • Attach a movie and scale

    I've been struggling to get this solved. What I want is a copy of the movie clip (a house; one of six) to be attached and then scaled as if you're heading to the front door. The movie will then move to another frame where it will have the door (anoth