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

RE: RE: [iaik-jce] verifying digital signature



Although SMimeSigned is part of IAIK-S/MIME it does not use the JavaMail API
(itīs the PKCS#7 part of IAIK-S/MIME).
Using SMimeSigned instead of SignedDataStream has the advantage that it does
the ContentInfo-wrapping by itsself.

However, both when using SMimeSigned or SignedDataStream (with
ContentInfoStream), you must do the Header parsing by yourself.

Dieter Bratko

-----Original Message-----
From: Tim Hart <tim.hart@ilg.com>
Sent: Friday, April 07, 2000 8:00
To: Dieter Bratko <Dieter.Bratko@iaik.at>; iaik-jce@iaik.at
Subject: AW: [iaik-jce] verifying digital signature

All,

I'm currently using the following code:

byte sig64[] = iaik.utils.Util.Base64Decode(sig);
ByteArrayInputStream bytestream = new ByteArrayInputStream(sig64);
MimeBodyPart bodypart = new MimeBodyPart(bytestream);
BASE64DecoderStream signature
 = (BASE64DecoderStream) bodypart.getContent();
BufferedInputStream inputstream
 = new BufferedInputStream(signature);
SMimeSigned signed = new SMimeSigned(inputstream);
X509Certificate[] cert = signed.verify();

I know it is just signed so the lack of S/MIME type isn't an issue...

We don't want a mail service involved - just a web server.

Thanks a lot for your suggestions Dieter!



smime.p7s