How to verify jar entity certificate?

If I ask for Certificates[] method JarEntity.getCertificates() returns null.

How to get JarEntity certificates?

JarInputStream jar =null;

try{

jar =new JarInputStream(new FileInputStream("e:/out/p1.jar"));

JarEntry je =null;

while ((je = jar.getNextJarEntry()) !=null){

System.out.println("--");

System.out.println(je);

byte[] b =newbyte[3000];

int l = jar.read(b);

System.out.println("len: " + l);

Certificate[] certs = je.getCertificates();

System.out.println("certs: " + certs);

}

}catch (Exception e){

e.printStackTrace();

}finally{

if (jar !=null){

try{

jar.close();

}catch (Exception e){

// ignore

}

}

}

result

--

META-INF/GMNA.SF

len: 203

certs: null

--

META-INF/GMNA.DSA

len: 664

certs: null

--

org/x4444/p1/Superp1.class

len: 471

certs: null

Why certs for org/x4444/p1/Superp1.class == null?

the jar was signed :

E:\out>c:\j2sdk1.4.2_13\bin\jarsigner.exe p1.jar gmna

and verified

E:\out>c:\j2sdk1.4.2_13\bin\jarsigner.exe -verify -verbose p1.jar

104 Tue Jul 17 15:41:32 MSD 2007 META-INF/MANIFEST.MF

203 Tue Jul 17 15:41:32 MSD 2007 META-INF/GMNA.SF

1033 Tue Jul 17 15:41:32 MSD 2007 META-INF/GMNA.DSA

smk471 Tue Jul 17 15:14:56 MSD 2007 org/x4444/p1/Superp1.class

s = signature was verified

m = entry is listed in manifest

k = at least one certificate was found in keystore

i = at least one certificate was found in identity scope

jar verified.

[2754 byte] By [x4444a] at [2007-11-27 10:49:31]
# 1

From the Javadoc:

'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.'

ejpa at 2007-7-29 11:19:47 > top of Java-index,Security,Other Security APIs, Tools, and Issues...