de.buelowssiege.mail.pgp_mime
Class MimeMultipartEncrypted

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

public class MimeMultipartEncrypted
extends javax.mail.internet.MimeMultipart

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

Version:
$Id: MimeMultipartEncrypted.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
  MimeMultipartEncrypted(javax.activation.DataSource ds)
          Constructs a MimeMultipartEncrypted object and its bodyparts from the given DataSource.
protected MimeMultipartEncrypted(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.MimeMultipartEncrypted createInstance(javax.mail.BodyPart bodyPart, de.buelowssiege.mail.pgp_mime.BodyPartEncrypter encrypter)
          Creates a new instance of this class using bodyPart as the part to be encrypted and encrypter to do the encrypting.
static de.buelowssiege.mail.pgp_mime.MimeMultipartEncrypted createInstance(de.buelowssiege.mail.pgp_mime.BodyPartEncrypter encrypter)
          Creates a new instance of this class using encrypter to do the encrypting.
static de.buelowssiege.mail.pgp_mime.MimeMultipartEncrypted createInstance(javax.mail.internet.MimeMultipart multiPart, de.buelowssiege.mail.pgp_mime.BodyPartEncrypter encrypter)
          Creates a new instance of this class using multiPart as the part to be encrypted and encrypter to do the encrypting.
 javax.mail.BodyPart decrypt(de.buelowssiege.mail.pgp_mime.BodyPartDecrypter decrypter)
          Decrypts the encrypted bodypart and returns a bodypart containing the decrypted data.
 void setSubType()
          This method does nothing, as the subtype of this multipart must always be encrypted.
 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

MimeMultipartEncrypted

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


MimeMultipartEncrypted

protected MimeMultipartEncrypted(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.MimeMultipartEncrypted createInstance(javax.mail.BodyPart bodyPart,
                                                                                  de.buelowssiege.mail.pgp_mime.BodyPartEncrypter encrypter)
                                                                           throws javax.mail.MessagingException
Creates a new instance of this class using bodyPart as the part to be encrypted and encrypter to do the encrypting.

javax.mail.MessagingException

createInstance

public static de.buelowssiege.mail.pgp_mime.MimeMultipartEncrypted createInstance(javax.mail.internet.MimeMultipart multiPart,
                                                                                  de.buelowssiege.mail.pgp_mime.BodyPartEncrypter encrypter)
                                                                           throws javax.mail.MessagingException
Creates a new instance of this class using multiPart as the part to be encrypted and encrypter to do the encrypting.

javax.mail.MessagingException

createInstance

public static de.buelowssiege.mail.pgp_mime.MimeMultipartEncrypted createInstance(de.buelowssiege.mail.pgp_mime.BodyPartEncrypter encrypter)
                                                                           throws javax.mail.MessagingException
Creates a new instance of this class using encrypter to do the encrypting. The part to be encrypted must have been set in the encrypter before calling this method.

javax.mail.MessagingException

decrypt

public javax.mail.BodyPart decrypt(de.buelowssiege.mail.pgp_mime.BodyPartDecrypter decrypter)
                            throws javax.mail.MessagingException
Decrypts the encrypted bodypart and returns a bodypart containing the decrypted data.

javax.mail.MessagingException

setSubType

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


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