Actually I figured this out: seems the JavaMail API bundle couldn't access
the classes from the bouncycastle bundle. I added dynamic-import to the mail
bundle and now it almost works. I ran into a different problem now: when I
do writeTo() on the MimeBodyPart I get an error:
java.io.IOException: unknown object in writeTo
org.bouncycastle.mail.smime.SMIMESignedGenerator$ContentSigner@1f12c01
at
org.bouncycastle.mail.smime.handlers.PKCS7ContentHandler.writeTo(Unknown
Source)
at javax.activation.DataHandler.writeTo(DataHandler.java:77)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1383)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:852)
at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:453)
On Tue, May 10, 2011 at 2:26 PM, Sorin Silaghi <[email protected]> wrote:
> Hello,
>
> I am trying to send a signed MimeBodyPart via HTTP and I got stuck when
> trying to convert it: when I try to do writeTo I get the folowing error:
>
> javax.activation.UnsupportedDataTypeException: application/pkcs7-mime;
> name=smime.p7m; smime-type=signed-data
> at javax.activation.DataHandler.writeTo(DataHandler.java:75)
> at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1383)
> at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:852)
>
> I tried to add that data type to the MailcapCommandMap but it didn't help.
> I also tried to add a mailcap file but nothing changed. Any ideas?
>
> Thank you,
> Sorin.