Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Follow-Up: Unsigned jar runs, signed doesn't!

2 views
Skip to first unread message

Diego Pietralunga

unread,
Mar 27, 2002, 6:00:04 AM3/27/02
to
Well, actually the code that behave differently whether signed or not is
the following.Former code crashed either.
There is an uncaught ERROR while loading the image.
This debug output shows where code gets, actually there is a
ClassCastException in 1.3.At the end of the post, I'm putting the error
from 1.4 (which is a SecurityException causing an
ExceptionInInitializerError while talking about CA certificates)


ClassLoader cl = ImgResourceAnchor.class.getClassLoader();
URL u =

cl.getResource("com/mycompany/myApp/res/img/main_background_2-460-300.jpg");
//
if (u != null)
{
Message.debugMsg("BackgroundJPanel: init(): " + u.toString());
this.theImgURL = u;
}else
{
Message.debugMsg("BackgroundJPanel: init(): img url is null!");

}

if (image==null)
{
Message.debugMsg("BackgroundJPanel: init(): creating image icon");
try{

/****** GETS STUCK HERE *******/
this.theImageIcon =
new ImageIcon(this.theImgURL);
}
catch(Exception ex)
{
Message.debugMsg( ex.getMessage());
}
catch(Throwable t)
{
Message.debugMsg( t.getMessage());
}
/***** NON EXCEPTION CAUGHT ************/
Message.debugMsg("BackgroundJPanel: init(): getting image");
image = this.theImageIcon.getImage();
Message.debugMsg("BackgroundJPanel: init(): got image");

ww = image.getWidth(this);
hh = image.getHeight(this);
}

/*******************/
// 1.3 exception
Debug: BackgroundJPanel: init(): jar:file:/C:/Documents and
Settings/diego/jbproject/SignWiz0_9_1/classes/signwiz.jar!/i
t/ltt/signwiz/res/img/main_background_2-460-300.jpg


Debug: BackgroundJPanel: init(): creating image icon

Uncaught error fetching image:
java.lang.ClassCastException: iaik.asn1.structures.Name
at sun.security.pkcs.PKCS7.getCertificate(PKCS7.java:574)
at sun.security.pkcs.SignerInfo.getCertificate(SignerInfo.java:203)
at sun.security.pkcs.SignerInfo.verify(SignerInfo.java:329)
at sun.security.pkcs.PKCS7.verify(PKCS7.java:468)
at sun.security.pkcs.PKCS7.verify(PKCS7.java:485)
at

sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:148)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:284)
at java.util.jar.JarVerifier.update(JarVerifier.java:197)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:248)
at java.util.jar.JarFile.getInputStream(JarFile.java:310)
at

sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:120)
at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:112)
at

sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:251)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:217)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:185)
/******************/

/********************************/
1.4 exception
Debug: BackgroundJPanel: init(): creating image icon

java.lang.ExceptionInInitializerError
at javax.crypto.Cipher.getInstance(DashoA6275)
at iaik.security.rsa.RSASignature.engineVerify(Unknown Source)
at java.security.Signature.verify(Signature.java:464)
at sun.security.pkcs.SignerInfo.verify(SignerInfo.java:370)
at sun.security.pkcs.PKCS7.verify(PKCS7.java:494)
at sun.security.pkcs.PKCS7.verify(PKCS7.java:511)
at

sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:145)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:281)
at java.util.jar.JarVerifier.update(JarVerifier.java:194)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:250)
at java.util.jar.JarFile.getInputStream(JarFile.java:312)
at

sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:117)
at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:109)
at

sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:251)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:214)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:182)
Caused by: java.lang.SecurityException: Cannot set up certs for trusted
CAs: java.security.cert.CertificateException: Pu
blicKey algorithm not implemented: 1.2.840.10040.4.1
at javax.crypto.SunJCE_b.<clinit>(DashoA6275)
... 16 more


/********************************/


--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

0 new messages