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

Re: [iaik-jce] addSignerInfo problem...



Hello,

In SignedDataStream implemenation, for each signer using a different hash
algorithm a message digest is initialized for piping the data to a
corresponding digest stream. The error message you describe occurs during
the encoding procedure if a message digest shall be calculated on a
particular hash algorithm and no corresponding MessageDigest object has been
initialized. However, for being able to look into the problem you described,
it would be necessary to see whole the sample source.

Regards
Dieter Bratko
----- Original Message -----
From: Conturbia Riccardo <s75918@dilbert.polito.it>
To: <iaik-jce@iaik.tu-graz.ac.at>
Sent: Tuesday, August 24, 1999 11:55 AM
Subject: [iaik-jce] addSignerInfo problem...


> Hi, I've noticed a strange behaviour in addSignerInfo...
>
> I created a SignerInfo with the line:
>
> SignerInfo signer_info = new SignerInfo(issuer_and_serialNr,
> AlgorithmID.sha, privateKey);
>
> Where the parameters come from a PKCS12 file...
>
> I added the SignerInfo to a SignedAndEnvelopedDataStream and to a
> SignedDataStream too with the addSignerInfo method... at runtime I get
> the this message:
>
> iaik.utils.InternalErrorException: MessageDigest not initialized yet!
>         at java.lang.Throwable.<init>(Compiled Code)
>         at java.lang.Exception.<init>(Compiled Code)
>         at java.lang.RuntimeException.<init>(Compiled Code)
>         at iaik.utils.InternalErrorException.<init>(Compiled Code)
>         at iaik.pkcs.pkcs7.c.a(Compiled Code)
>         at iaik.pkcs.pkcs7.b.a(Compiled Code)
>         at iaik.pkcs.pkcs7.SignedDataStream.getMessageDigest(Compiled
> Code)
>         at iaik.pkcs.pkcs7.SignerInfo.encodeCalled(Compiled Code)
>         at iaik.asn1.ASN1Object.encodeObject(Compiled Code)
>         at iaik.asn1.DerCoder.bs(Compiled Code)
>         at iaik.asn1.DerCoder.cs(Compiled Code)
>         at iaik.asn1.ConstructedType.encode(Compiled Code)
>         at iaik.asn1.ASN1Object.encodeObject(Compiled Code)
>         at iaik.asn1.DerCoder.bs(Compiled Code)
>         at iaik.asn1.DerCoder.cs(Compiled Code)
>         at iaik.asn1.ConstructedType.encode(Compiled Code)
>         at iaik.asn1.ASN1Object.encodeObject(Compiled Code)
>         at iaik.asn1.DerCoder.bs(Compiled Code)
>         at iaik.asn1.DerCoder.cs(Compiled Code)
>         at iaik.asn1.DerCoder.encode(Compiled Code)
>         at iaik.asn1.DerCoder.encodeTo(Compiled Code)
>         at iaik.asn1.ConstructedType.encode(Compiled Code)
>         at iaik.asn1.ASN1Object.encodeObject(Compiled Code)
>         at iaik.asn1.DerCoder.encodeTo(Compiled Code)
>         at iaik.asn1.DerCoder.encodeTo(Compiled Code)
>         at iaik.pkcs.pkcs7.SignedDataStream.writeTo(Compiled Code)
>         at PKCS7File2.writeTo(Compiled Code)
>         at PKCS7File2.main(Compiled Code)
>
> I've solved the problem creating another SignerInfo from the same
> parameters and adding this second object to the SignedDataStream. I
> can't understand if this behaviour is a feature or a bug...
>
> Thanks
>
> Riccardo Conturbia
> --
> 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
>
>
>


smime.p7s