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

[iaik-jce] Exception during output of signedAndEnvelopedDataStream


I get an exception during otuput of my signedAndEnvelopedDataStream stream.
I am forced to construct the signerInfo implicitly, because the certificate
resides on a smartCard, hence I cannot access the private key. I have
created a signerInfo object, and instantiated it like this:

    SignerInfo signer_info = new SignerInfo( );
    signer_info.setEncryptedDigest( sigCert[0].getFingerprint() );//??digest
of certificate or message

Output of the object:

DataOutputStream dos = new DataOutputStream( new FileOutputStream(new File(
"D:\\test.dta" )) );
    signed_and_enveloped_data.writeTo( dos );

The Exception looks like this:

java.io.IOException: iaik.pkcs.PKCSException: iaik.asn1.CodingException:
        at iaik.pkcs.pkcs7.SignedDataStream.writeTo(Unknown Source)
        at scSDS.signedAndEnveloped(scSDS.java:621)
        at scSDS.main(scSDS.java:690)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.borland.jbuilder.util.BootStrap.invokeMain(Unknown Source)
        at com.borland.jbuilder.util.BootStrap.main(Unknown Source)

If I try to instantiate the SignerInfo with "new SignerInfo(
sigCert[0].toASN1Object() )" I get a class cast exception. If anyone knows
how to create a SignerInfo object implicitly (I guess this is where the
problem occurs), where I can create the objects on the fly, using encrypted
digest from the SmartCard, and the Certificate from the SmartCart(without
private key!), it would be a lot of help!

Henrik Hartz

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