de.buelowssiege.mail.pgp_mime
Class MimeMultipartSigned

java.lang.Object
  |
  +--javax.mail.Multipart
        |
        +--javax.mail.internet.MimeMultipart
              |
              +--de.buelowssiege.mail.pgp_mime.MimeMultipartSigned

public class MimeMultipartSigned
extends javax.mail.internet.MimeMultipart

This class extends the MimeMultipart to conform to the multipart/signed described in RFC 1847.

Version:
$Id: MimeMultipartSigned.html,v 1.1 2004/02/11 12:51:34 mschwerin Exp $
Author:
Maximilian Schwerin

Field Summary
 
Fields inherited from class javax.mail.internet.MimeMultipart
ds, parsed
 
Fields inherited from class javax.mail.Multipart
contentType, parent, parts
 
Constructor Summary
  MimeMultipartSigned(javax.activation.DataSource ds)
          Constructs a MimeMultipartSigned object and its bodyparts from the given DataSource.
protected MimeMultipartSigned(java.lang.String contentType)
          This constructor is used by the createInstance method to create a new instance.
 
Method Summary
static de.buelowssiege.mail.pgp_mime.MimeMultipartSigned createInstance(javax.mail.BodyPart bodyPart, de.buelowssiege.mail.pgp_mime.BodyPartSigner signer)
          Creates a new instance of this class using bodyPart as the part to be signed and signer to do the signing.
static de.buelowssiege.mail.pgp_mime.MimeMultipartSigned createInstance(de.buelowssiege.mail.pgp_mime.BodyPartSigner signer)
          Creates a new instance of this class using signer to do the signing.
static de.buelowssiege.mail.pgp_mime.MimeMultipartSigned createInstance(javax.mail.Multipart multiPart, de.buelowssiege.mail.pgp_mime.BodyPartSigner signer)
          Creates a new instance of this class using multiPart as the part to be signed and signer to do the signing.
 javax.mail.BodyPart getContentPart()
          Returns the bodypart which contains the actual content of this signed multipart.
 void setSubType()
          This method does nothing, as the subtype of this multipart must always be signed.
 void verify(de.buelowssiege.mail.pgp_mime.BodyPartVerifier verifier)
          Verifies the signature.
 void writeTo(java.io.OutputStream out)
          Iterates through all the parts and outputs each mime part separated by a boundary.
 
Methods inherited from class javax.mail.internet.MimeMultipart
createInternetHeaders, createMimeBodyPart, createMimeBodyPart, getBodyPart, getBodyPart, getCount, parse, setSubType, updateHeaders
 
Methods inherited from class javax.mail.Multipart
addBodyPart, addBodyPart, getContentType, getParent, removeBodyPart, removeBodyPart, setMultipartDataSource, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeMultipartSigned

public MimeMultipartSigned(javax.activation.DataSource ds)
                    throws javax.mail.MessagingException
Constructs a MimeMultipartSigned object and its bodyparts from the given DataSource.


MimeMultipartSigned

protected MimeMultipartSigned(java.lang.String contentType)
                       throws javax.mail.MessagingException
This constructor is used by the createInstance method to create a new instance.

Method Detail

createInstance

public static de.buelowssiege.mail.pgp_mime.MimeMultipartSigned createInstance(javax.mail.BodyPart bodyPart,
                                                                               de.buelowssiege.mail.pgp_mime.BodyPartSigner signer)
                                                                        throws javax.mail.MessagingException
Creates a new instance of this class using bodyPart as the part to be signed and signer to do the signing.

javax.mail.MessagingException

createInstance

public static de.buelowssiege.mail.pgp_mime.MimeMultipartSigned createInstance(javax.mail.Multipart multiPart,
                                                                               de.buelowssiege.mail.pgp_mime.BodyPartSigner signer)
                                                                        throws javax.mail.MessagingException
Creates a new instance of this class using multiPart as the part to be signed and signer to do the signing.

javax.mail.MessagingException

createInstance

public static de.buelowssiege.mail.pgp_mime.MimeMultipartSigned createInstance(de.buelowssiege.mail.pgp_mime.BodyPartSigner signer)
                                                                        throws javax.mail.MessagingException
Creates a new instance of this class using signer to do the signing. The part to be signed must have been set in the signer before calling this method.

javax.mail.MessagingException

verify

public void verify(de.buelowssiege.mail.pgp_mime.BodyPartVerifier verifier)
            throws javax.mail.MessagingException
Verifies the signature. An Exception is thrown if the signature is not correct.

javax.mail.MessagingException

getContentPart

public javax.mail.BodyPart getContentPart()
                                   throws javax.mail.MessagingException
Returns the bodypart which contains the actual content of this signed multipart.

javax.mail.MessagingException

setSubType

public void setSubType()
This method does nothing, as the subtype of this multipart must always be signed.


writeTo

public void writeTo(java.io.OutputStream out)
             throws javax.mail.MessagingException,
                    java.io.IOException
Iterates through all the parts and outputs each mime part separated by a boundary. Before writing to the output stream the updateHeaders method is called.

Overrides:
writeTo in class javax.mail.internet.MimeMultipart
javax.mail.MessagingException
java.io.IOException