I have a Problem verifying an Email Signature with BC. Both, Thunderbird and Outlook said that this Email is valid, but BC doesn't.
I am using the SignedMailValidator class.
The Error that occours is :
org.bouncycastle.cms.CM****ception: invalid signature format in message: content hash found in signed attributes different
.....
Caused by: java.security.SignatureException: content hash found in signed attributes different
The Email Content :
MIME-Version: 1.0
Content-Type: multipart/signed;
protocol="application/x-pkcs7-signature";
micalg=sha1;
boundary="----F439FEDC23FA084281EC7880F017B061"
X-CheckCompat: OK
Content-class: urn:content-classes:message
Subject: XXXXXX.txt
Date: Wed, 9 Apr 2008 10:24:17 +0200
Message-ID: <XXXXXXX>
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
Thread-Topic: XXXXXX.txt
Thread-Index: AciaG2tUJ9bAYyY8TAeFf/Nmys4P7w==
From: <
[email protected]>
To: <
[email protected]>
This is an S/MIME signed message
------F439FEDC23FA084281EC7880F017B061
Content-Type: multipart/mixed;
boundary="------------=_NextPart_000_000_000"
--------------=_NextPart_000_000_000
Content-Type: multipart/alternative;
boundary="------alternative_boundary"
--------alternative_boundary
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
In Beantwortung Ihrer Datei XXXXXX.txt' lieferte der
AKTIF-EDI-Service folgende Ergebnisse:
--------------------------------------------------------------------------=
--------
Dateiname gepackt verschl. Kommentar/Signaturdat=
ei
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
XXXXXX... not not
--------------------------------------------------------------------------=
--------
In response of your processed file XXXXXX=
XXXXXX.txt' the
AKTIF-EDI-Service sent to you the following results:
--------------------------------------------------------------------------=
--------
filename compressed encrypted comment/sigfile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
CONTRL__9904144000002_9900496... not not
--------------------------------------------------------------------------=
--------
--
autogenerated email by AKTIF EDI Service (aedic.sm).
Please do not respond to this emailaddress.
--------alternative_boundary
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html><head><title>processed file</title></head>
<body bgcolor=3D"#ffffff">
<b>AKTIF EDI-Service:</b> Konvertierte Datei/converted file 'CONTRL__9=
904144000002_9900496000005_20080409_141316.txt'
<br><br><br>
<table cellpadding=3D"3" border=3D"0" align=3D"center">
<tr bgcolor=3D"#330866">
<td valign=3D"top"><b>Datei</b><br>
<b>fil=
e</b></td>
<td valign=3D"top"><b>Komprimierung</b><br>
<b>com=
pression</b></td>
<td valign=3D"top"><b>Verschl=FCsselung</b><br>
<b>enc=
ryption</b></td>
<td valign=3D"top"><b>Signaturdatei/Kommentar</b><br>
<b>sig=
naturefile/comment</b>
</td></tr>
<tr align=3D"center">
<td>CONTRL__9904144000002_9900496000005_20080409_1 41316.txt</td>
<td>keine/none</td>
<td>keine/none</td>
<td> </td>
</tr>
</tr></table>
<br><br><br>
-- <br>autogenerated email by <a href=3D"XXXXX=
om">XXXX</a>-EDIService (aedic.sm).
Please do not respond to this emailaddress.
</body></html>
--------alternative_boundary--
--------------=_NextPart_000_000_000
Content-Type: application/octet-stream;
name="XXXXXXX.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="XXXXXXX.txt"
UNA:+.? 'UNB+UNOC:3+XXXXXX:500+XXXXXX:XXXXXX+XXXXXX:XXXXXX +XXXXXX=
UNH+XXXXXX+XXXXXX:D:3:UN:XXXXXX'UCI+XXXXXX+XXXXXX: XXXXXX+XXXXXX=
XXXXXX:XXXXXX+8'UNT+XXXXXX+XXXXXX+XXXXXX+XXXXXX
--------------=_NextPart_000_000_000--
------F439FEDC23FA084281EC7880F017B061
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
IIHSwYJKoZIhvcNAQcCoIIHPDCCBzgCAQExCzAJBgUrDgMCGgU AMAsGCSqGSIb3
....
(Signature)
....
kMNr5ZWzKce1iM15GhsKUViiuTBhhK2LQolwB9gnKkBMwbF9bL PuMXNvallydtM=
------F439FEDC23FA084281EC7880F017B061--