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