de.buelowssiege.mail.pgp_mime.gpg
Class GnuPGBodyPartEncrypter

java.lang.Object
  |
  +--de.buelowssiege.mail.pgp_mime.gpg.GnuPGExecuter
        |
        +--de.buelowssiege.mail.pgp_mime.gpg.GnuPGBodyPartEncrypter
All Implemented Interfaces:
BodyPartDecrypter, BodyPartEncrypter

public class GnuPGBodyPartEncrypter
extends GnuPGExecuter
implements BodyPartEncrypter, BodyPartDecrypter

This implementation of the BodyPartEncrypter and BodyPartDecrypter uses the GnuPG program to encrypt and decrypt bodyparts.

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

Field Summary
 
Fields inherited from class de.buelowssiege.mail.pgp_mime.gpg.GnuPGExecuter
binaryPath, logger, RETURN_BAD_SIGNATURE, RETURN_OK
 
Constructor Summary
GnuPGBodyPartEncrypter(java.lang.String binaryPath, de.buelowssiege.mail.pgp_mime.PGPAuthenticator authenticator)
           
GnuPGBodyPartEncrypter(java.lang.String binaryPath, de.buelowssiege.mail.pgp_mime.PGPAuthenticator authenticator, java.lang.String[] recipientIDs)
           
GnuPGBodyPartEncrypter(java.lang.String binaryPath, java.lang.String[] recipientIDs)
           
 
Method Summary
 void decrypt()
          This method does the actual verifying.
 void encrypt()
          This method does the actual encrypting.
 javax.mail.BodyPart getContentPart()
          Returns the content part that was set earlier.
 javax.mail.BodyPart getControlPart()
          Returns the body part, that contains the encrypted data.
 javax.mail.BodyPart getEncryptedPart()
          Returns the body part, that contains the encrypted data.
 void setContentPart(javax.mail.BodyPart contentPart)
          Sets the content part that is to be signed.
 void setControlPart(javax.mail.BodyPart controlPart)
          Sets the body part, that contains the encrypted data.
 void setEncryptedPart(javax.mail.BodyPart encryptedPart)
          Sets the body part, that contains the encrypted data.
 
Methods inherited from class de.buelowssiege.mail.pgp_mime.gpg.GnuPGExecuter
createTempFile, joinProcess, readBodyPart, sendPassPhrase, startProcess, updateHeaders, writeBodyPart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GnuPGBodyPartEncrypter

public GnuPGBodyPartEncrypter(java.lang.String binaryPath,
                              de.buelowssiege.mail.pgp_mime.PGPAuthenticator authenticator)

GnuPGBodyPartEncrypter

public GnuPGBodyPartEncrypter(java.lang.String binaryPath,
                              java.lang.String[] recipientIDs)

GnuPGBodyPartEncrypter

public GnuPGBodyPartEncrypter(java.lang.String binaryPath,
                              de.buelowssiege.mail.pgp_mime.PGPAuthenticator authenticator,
                              java.lang.String[] recipientIDs)
Method Detail

encrypt

public void encrypt()
             throws javax.mail.MessagingException
This method does the actual encrypting. The content part must have been set before executing this method.

Specified by:
encrypt in interface BodyPartEncrypter
javax.mail.MessagingException

decrypt

public void decrypt()
             throws javax.mail.MessagingException
This method does the actual verifying. Both the content part and the signature part must have been set.

Specified by:
decrypt in interface BodyPartDecrypter
javax.mail.MessagingException

setContentPart

public void setContentPart(javax.mail.BodyPart contentPart)
Sets the content part that is to be signed.

Specified by:
setContentPart in interface BodyPartEncrypter

getContentPart

public javax.mail.BodyPart getContentPart()
Returns the content part that was set earlier.

Specified by:
getContentPart in interface BodyPartEncrypter

setEncryptedPart

public void setEncryptedPart(javax.mail.BodyPart encryptedPart)
Sets the body part, that contains the encrypted data.

Specified by:
setEncryptedPart in interface BodyPartDecrypter

getEncryptedPart

public javax.mail.BodyPart getEncryptedPart()
Returns the body part, that contains the encrypted data.

Specified by:
getEncryptedPart in interface BodyPartEncrypter

setControlPart

public void setControlPart(javax.mail.BodyPart controlPart)
Sets the body part, that contains the encrypted data.

Specified by:
setControlPart in interface BodyPartDecrypter

getControlPart

public javax.mail.BodyPart getControlPart()
Returns the body part, that contains the encrypted data.

Specified by:
getControlPart in interface BodyPartEncrypter