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

AW: [iaik-jce] Parse PKCS7



Hello,

most likely you are trying to read a SignedData that is wrapped in a
ContentInfo without as an unwrapped SignedData. You first have to "remove"
the ContentInfo wrapping (see demo.pkcs.TestContentInfo).

Regards,
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
christoph_moser@gmx.de
Gesendet: Montag, 12. März 2001 17:12
An: iaik-jce@iaik.at
Betreff: [iaik-jce] Parse PKCS7


Hello,

I've written the following peace of code:

FileInputStream pkcs7File = new FileInputStream (fileName);
DataInputStream pkcs7DataStream = new DataInputStream (pkcs7File);

SignedDataStream signedData = new SignedDataStream (pkcs7DataStream);

Using a valid pkcs7-File I always receive the following exception:

java.io.IOException: Next ASN.1 object is no INTEGER!
	at iaik.asn1.DerInputStream.readInteger(Unknown Source)
	at iaik.pkcs.pkcs7.SignedDataStream.decode(Unknown Source)
	at iaik.pkcs.pkcs7.SignedDataStream.<init>(Unknown Source)
	at test.SigTest.readSignedDataFromFile(SigTest.java:32)
	at test.SigTest.main(SigTest.java:52)

But I can read the pkcs7-message and the included certificates using the
Microsoft Managment Console. It was the smime.pkcs7-File from your book !

Any suggestions ?

I only want to get the Signature and the Certificates from a pkcs7
message. Where can I find a sample-code ?

Many thanks in advance.

  Christoph


--
Sent through GMX FreeMail - http://www.gmx.net

--
Mailinglist-archive at
http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html

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




smime.p7s