JavaMail and PGP

R

Ray Kane

Hello,

I have a question about creating PGP-signed Messages with JavaMail.
According to OpenPGP-RFC a PGP-signed-only (not encrypted) message must
be a multipart/signed message with to Sub-Parts: First the content part
with the usual mime-type (for example text/plain) and the second part
mußt be application/pgp-signature. The RFC states, that of the
to-be-signed-part not only the body has to be included but also all
header lines of that part (i.e Content-type: ...) , to get a valid
signature. My problem is now that the header lines are created by the
JavaMail-Api, when I set the content in a MIMEBodyPart-Object. I wanted
to get back the whole information en bloc to create a signature out of
it (I know, I can get the headerlines and could assemble that with my
content, but would that result in exactly the same bytes as in the
MIMEBodyPart ?), but the only method I could find is
getRawInputStream(). Unfortunately it always throws
"javax.mail.MessagingException: No content", even if I set the
MIMEBodyPart into the MIMEMessage and call saveChanges() before.

Thank you for any hint.

Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top