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

AW: [iaik-jce] Problem parsing PKCS #7 SignedData from Netscape


your SignedData is wrapped into a ContentInfo (as usual when transmitting a
PKCS#7 object). You first will need class ContentInfo(Stream) for unwrapping
it (see demo.pkcs.TestContentInfo for a sample).

Dieter Bratko

-----Ursprüngliche Nachricht-----
Von: iaik-jce-owner@iaik.tu-graz.ac.at
[mailto:iaik-jce-owner@iaik.tu-graz.ac.at]Im Auftrag von Philippe
Gesendet: Dienstag, 13. Februar 2001 14:56
An: iaik-jce@iaik.at
Betreff: [iaik-jce] Problem parsing PKCS #7 SignedData from Netscape


I have a problem parsing a PKCS #7 signedData object.
It looks like the object is a valid ASN.1 object (I can parse it as ASN.1
object), but fails to be parsed as a PKCS #7 object.

This PKCS #7 object was actually created using Netscape javascript signText
function (see http://docs.iplanet.com/docs/manuals/security/sgntxt/index.htm
for an exact description of what's in there)

I use IAIK-JCE2.61, and JDK 1.3 .

In attachment is the object, as a DER-encoded file (signeddata.der) and as
ASN.1 formatted text (signeddata.asn1), and the java test class that fails
parse it. That class does the following :

    String filename = "signeddata.der";
    FileInputStream in = new FileInputStream(filename);
    SignedData signedData = new SignedData(in);

and yields this stack trace :

>java.io.IOException: Next ASN.1 object is no INTEGER!
>        at iaik.asn1.DerInputStream.readInteger(Unknown Source)
>        at iaik.pkcs.pkcs7.SignedData.decode(Unknown Source)
>        at iaik.pkcs.pkcs7.SignedDataStream.<init>(Unknown Source)
>        at iaik.pkcs.pkcs7.SignedData.<init>(Unknown Source)
>        at Test.main(Test.java:12)

I also tried to parse it assuming it was in explicit mode (i.e. first
initializing the SignedData with the original rawData, and then decoding),
i got the exact same exception.

Any help welcome.