de.buelowssiege.mail.pgp_mime.gpg
Class GnuPGExecuter

java.lang.Object
  |
  +--de.buelowssiege.mail.pgp_mime.gpg.GnuPGExecuter
Direct Known Subclasses:
GnuPGBodyPartEncrypter, GnuPGBodyPartSigner

public class GnuPGExecuter
extends java.lang.Object

This class executes the GnuPG program.

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

Field Summary
protected  java.lang.String binaryPath
           
protected static org.apache.log4j.Logger logger
           
protected static int RETURN_BAD_SIGNATURE
           
protected static int RETURN_OK
           
 
Constructor Summary
GnuPGExecuter(java.lang.String binaryPath)
           
 
Method Summary
protected  java.io.File createTempFile()
          Creates a temporary files.
protected  int joinProcess()
          Waits for the process to terminate.
protected  javax.mail.BodyPart readBodyPart(java.io.File file)
          Reads a bodypart from a file.
protected  void sendPassPhrase(char[] passphrase)
          Sends the passphrase into an output stream.
protected  void startProcess(java.lang.String command)
          Starts a process executing a command.
protected  void updateHeaders(java.lang.Object part)
          This method is based on code from the MimeBodyPart and the MimeMultiPart implementation from SUN.
protected  java.io.File writeBodyPart(javax.mail.BodyPart bodyPart)
          Writes a bodypart to a temporary file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RETURN_OK

protected static final int RETURN_OK
See Also:
Constant Field Values

RETURN_BAD_SIGNATURE

protected static final int RETURN_BAD_SIGNATURE
See Also:
Constant Field Values

binaryPath

protected java.lang.String binaryPath

logger

protected static org.apache.log4j.Logger logger
Constructor Detail

GnuPGExecuter

public GnuPGExecuter(java.lang.String binaryPath)
Method Detail

joinProcess

protected int joinProcess()
                   throws java.lang.InterruptedException,
                          java.io.IOException
Waits for the process to terminate. Returns the exit value of the process.

java.lang.InterruptedException
java.io.IOException

startProcess

protected void startProcess(java.lang.String command)
                     throws java.io.IOException
Starts a process executing a command.

java.io.IOException

sendPassPhrase

protected void sendPassPhrase(char[] passphrase)
                       throws java.io.IOException
Sends the passphrase into an output stream.

java.io.IOException

createTempFile

protected java.io.File createTempFile()
                               throws java.io.IOException
Creates a temporary files.

java.io.IOException

writeBodyPart

protected java.io.File writeBodyPart(javax.mail.BodyPart bodyPart)
                              throws java.io.IOException,
                                     javax.mail.MessagingException
Writes a bodypart to a temporary file.

java.io.IOException
javax.mail.MessagingException

readBodyPart

protected javax.mail.BodyPart readBodyPart(java.io.File file)
                                    throws java.io.IOException,
                                           javax.mail.MessagingException
Reads a bodypart from a file.

java.io.IOException
javax.mail.MessagingException

updateHeaders

protected void updateHeaders(java.lang.Object part)
                      throws javax.mail.MessagingException
This method is based on code from the MimeBodyPart and the MimeMultiPart implementation from SUN.

javax.mail.MessagingException