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

AW: [iaik-jce] creating multipart/mixed messages with smime body parts



Hello,

Since both MimeMessage and MimeBodyPart implemtent MimePart you may
construct a MimeBodyPart holding a "SignedContent" in a similar way than
creating a MimeMessage and subsequently add the body part to a multi part of
your message, e.g.:

...
// the signed content:
SignedContent = ...;
...
// the multipart for the final message:
MimeMultipart mp = new MimeMultipart();
// the first body part only gives a text message
MimeBodyPart mbp1 = new MimeBodyPart();
mbpx1.setText("...");
// the second body part holds a signed content:
MimeBodyPart mbp2 = new MimeBodyPart();
mbp2.setContent(sign, sign.getContentType());
// add the two body parts to the multi part:
mp.addBodyPart(mbp1);
mp.addBodyPart(mbp2);
// the multipart gives the content of the message:
mimeMessage.setContent(mp);


should give a multipart/mixed message where the second part is a "S/MIME
part".

Regards,
Dieter Bratko

-----Ursprüngliche Nachricht-----
Von: iaik-jce-owner@iaik.tu-graz.ac.at
[mailto:iaik-jce-owner@iaik.tu-graz.ac.at]Im Auftrag von Bharath
Vutukuru
Gesendet: Freitag, 6. Oktober 2000 23:47
An: iaik-jce@iaik.at
Betreff: [iaik-jce] creating multipart/mixed messages with smime body
parts


HI,
Has anyone considered the problem of inserting s/mime encrypted or signed
content as bodyparts in a larger multipart/mixed message.

I have a method which creates s/mime encrypted mimeparts and I want to
place this as a body part inside a bigger multipart/mixed message. To do
this, I'm calling the getheaders() and getContent() methods on the
encrypted mimepart to retrieve the content and headers; and plan to use
setHeaders() and setContent() to set the bodypart. BUt
getContent() doesn't return the base64 encoded content and instead
the encryptedContent datacontenthandler tries to retrieve the actual
content which was encrypted.

Does anyone have any ideas abt. how to approach this issue. How can you
get the base64 encoded encrypted content out of the message.or even better
How do you insert smime mimepart as bodyparts inside a bigger mime
message?

thanks in advance
-bharath



--
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




***************************************************************************
*                                                                         *
* IAIK S/MIME Mapper Security Info                                        *
* ===================================                                     *
*                                                                         *
* for message:                                                            *
*   From: "dbratko" <Dieter.Bratko@iaik.at>                               *
*   Date: Mon, 16 Oct 2000 12:29:26 +0200                                 *
*   Subject: AW: [iaik-jce] creating multipart/mixed messages with smime body parts*
*                                                                         *
* Message S/MIME properties:                                              *
*                                                                         *
*   Encrypted using:    not encrypted                                     *
*                                                                         *
*   Digitally signed:   yes                                               *
*   Signature valid:    yes                                               *
*   Signature trusted:  yes                                               *
*                                                                         *
*                                                                         *
* Compliance with policy for email addresses *@iaik.at:                   *
*                                                                         *
*   Encryption:         OK (None or better required)                      *
*                                                                         *
*   Digital Signature:  OK (digital signature required)                   *
*                                                                         *
***************************************************************************