[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-jce] Internal error when verifying a signature



I have a program (servlet) that works fine with
jdk1.1+jdk11x_update.jar+iaik_jce.jar but that reports
an internal error with jdk 1.2.1+iaik_jce.jar
This is the source file
IAIK.addAsProvider(true);

    ASN1 asn1 = new ASN1(firm.getBytes());
    ASN1Object asn1_object = asn1.toASN1Object();
    // calculate the hash over the content received outside the message
    MessageDigest md = java.security.MessageDigest.getInstance("SHA");
    //texto=texto+"a";
    md.update(texto.getBytes());
    byte[] digest = md.digest();
    out.println("<BR> parse the ContentInfo");
    // parse the ContentInfo
    ContentInfo ci = new ContentInfo(asn1_object);  <-- Here comes the
error
    out.println("<BR> get the SignedData from the ContentInfo");
    // get the SignedData from the ContentInfo
    SignedData sd = (SignedData)ci.getContent();
    out.println("<BR> set the hash");

This is the error
parse the ContentInfo iaik.utils.InternalErrorException: Error form
ByteArrayInputStream! at
iaik.pkcs.pkcs7.ContentInfo.(Unknown Source) at
isum.verifySignature.comprueba(Compiled Code) at
isum.verifySignature.comprobar(verifySignature.java:327) at
isum.verifySignature.service(verifySignature.java:98) at
javax.servlet.http.HttpServlet.service(Compiled Code) at
com.livesoftware.jrun.JRun.runServlet(Compiled Code) at
com.livesoftware.jrun.JRunGeneric.handleConnection(Compiled Code) at
com.livesoftware.jrun.JRunGeneric.handleProxyConnection(Compiled Code)
at
com.livesoftware.jrun.service.proxy.JRunProxyServiceHandler.handleRequest(Compiled
Code) at
com.livesoftware.jrun.service.ThreadConfigHandler.run(Compiled Code)

What I should do?

Thanks

--
Mailinglist-archive at http://jcewww.iaik.tu-graz.ac.at/mailarchive/iaik-jce/maillist.html

To unsubscribe send an email to listserv@iaik.tu-graz.ac.at with the folowing content: UNSUBSCRIBE iaik-jce