JavaMail and PGP

Discussion in 'Java' started by Ray Kane, Jan 12, 2005.

  1. Ray Kane

    Ray Kane Guest

    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
    Ray Kane, Jan 12, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Zapp

    Perl PGP question

    Zapp, Sep 9, 2003, in forum: Perl
    Replies:
    0
    Views:
    1,324
  2. Apollo
    Replies:
    0
    Views:
    5,919
    Apollo
    Nov 29, 2003
  3. Luc The Perverse

    PGP (Or GnuGP) under Java

    Luc The Perverse, Nov 28, 2005, in forum: Java
    Replies:
    5
    Views:
    18,948
    joehobson
    Jun 10, 2011
  4. Michael Schuerig

    TMail and GPG/PGP encryption?

    Michael Schuerig, Oct 27, 2005, in forum: Ruby
    Replies:
    0
    Views:
    132
    Michael Schuerig
    Oct 27, 2005
  5. Dave Rose
    Replies:
    1
    Views:
    89
Loading...

Share This Page