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

[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