harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Gray (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6202) JarEntry.getCertificates() not working with JarEntryStream
Date Tue, 16 Jun 2009 11:39:07 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12720077#action_12720077
] 

Chris Gray commented on HARMONY-6202:
-------------------------------------

Tim,


Thanks for the reminder.

I've had exposure to Wonka/Mika (BGS licence) and to a lesser extent to 
Classpath (GPL+exception). I suppose that's all right? If so, I just want to 
check where I say to which implementations I have been exposed - does that go 
under "Details"?

Regards

Chris

-- 
/k/ Embedded Java Solutions                         BE-0809.435.306
Embedded & Mobile Java, OSGi    http://www.k-embedded-java.com/
k-support@kiffer.be



> JarEntry.getCertificates() not working with JarEntryStream
> ----------------------------------------------------------
>
>                 Key: HARMONY-6202
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6202
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: x86/Linux, Eclipse Harmony plugin
>            Reporter: Chris Gray
>
> Following code fails on Harmony, i.e. prints "No certificates" even though the jar has
been signed with Sun's jarsigner tool. Code works on RI 1.4, fails on RI 1.5 (subject of Sun
bug report no. 6284489), works on RI 1.6.
> import java.io.BufferedInputStream;
> import java.io.FileInputStream;
> import java.util.Enumeration;
> import java.util.jar.*;
> class SignatureTest2 {
>   static public void main(String[] args) {
>    if (args.length == 0) {
>       System.out.println("Usage: SignatueTest2 path/to/jarfile.jar");
>    }
>     try {
>       String filename = args[0];
>       System.out.println("Opening file: " + filename);
>       System.out.println();
>       FileInputStream fis = new FileInputStream(filename);
>       BufferedInputStream bis = new BufferedInputStream(fis, 8192);
>       JarInputStream jis = new JarInputStream(bis);
>       Manifest m = jis.getManifest();
>       JarEntry je = jis.getNextJarEntry();
>       while (je != null) {
>         System.out.println("JarEntry: " + je);
>         if (!je.isDirectory()) {
>           String name = je.getName();
>           if (!name.startsWith("META-INF/")) {
>             jis.closeEntry();
>             java.security.cert.Certificate[] certs = je.getCertificates();
>             if (certs == null) {
>               System.out.println("No certificates");
>             }
>             else {
>               System.out.println("Certificates:");
>               for (int i = 0; i < certs.length; ++i)
>                 System.out.println(certs[i].toString());
>             }
>             System.out.println();
>           }
>         }
>         je = jis.getNextJarEntry();
>       }
>     }
>     catch (Throwable t) {
>       t.printStackTrace();
>     }
>   }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message