org.pentaho.di.job.entries.pgpencryptfiles
Class GPG

java.lang.Object
  extended by org.pentaho.di.job.entries.pgpencryptfiles.GPG

public class GPG
extends Object

This defines a GnuPG wrapper class.

Since:
25-02-2011
Author:
Samatar

Constructor Summary
GPG(String gpgFilename, LogChannelInterface logInterface)
          Constructs a new GnuPG
 
Method Summary
 String decrypt(String cryptedText, String passPhrase)
          Decrypt a string
 void decryptFile(org.apache.commons.vfs.FileObject cryptedFilename, String passPhrase, org.apache.commons.vfs.FileObject decryptedFilename)
          Decrypt a file
 void decryptFile(String cryptedFilename, String passPhrase, String decryptedFilename)
          Decrypt a file
 String encrypt(String plainText, String keyID)
          Encrypt a string
 void encryptFile(org.apache.commons.vfs.FileObject filename, String userID, org.apache.commons.vfs.FileObject cryptedFilename, boolean asciiMode)
          Encrypt a file
 void encryptFile(String filename, String userID, String cryptedFilename, boolean asciiMode)
          Encrypt a file
 String getGpgExeFile()
          Returns GPG program location
 String sign(String stringToSign, String passPhrase)
          Sign
 String signAndEncrypt(String plainText, String userID, String passPhrase)
          Signs and encrypts a string
 void signAndEncryptFile(org.apache.commons.vfs.FileObject file, String userID, org.apache.commons.vfs.FileObject cryptedFile, boolean asciiMode)
          Sign and encrypt a file
 void signAndEncryptFile(String filename, String userID, String cryptedFilename, boolean asciiMode)
          Sign and encrypt a file
 void signFile(org.apache.commons.vfs.FileObject file, String userID, org.apache.commons.vfs.FileObject signedFile, boolean asciiMode)
          Sign a file
 void signFile(String filename, String userID, String signedFilename, boolean asciiMode)
          Sign a file
 String toString()
           
 void verifyDetachedSignature(org.apache.commons.vfs.FileObject signatureFile, org.apache.commons.vfs.FileObject originalFile)
          Verify a signature for detached file
 void verifyDetachedSignature(String signatureFilename, String originalFilename)
          Verify a signature for detached file
 void verifySignature(org.apache.commons.vfs.FileObject filename)
          Verify a signature
 void verifySignature(String filename)
          Verify a signature
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GPG

public GPG(String gpgFilename,
           LogChannelInterface logInterface)
    throws KettleException
Constructs a new GnuPG

Parameters:
gpgFilename - gpg program location
logInterface - LogChannelInterface
Throws:
KettleException
Method Detail

getGpgExeFile

public String getGpgExeFile()
Returns GPG program location

Returns:
GPG filename

decryptFile

public void decryptFile(org.apache.commons.vfs.FileObject cryptedFilename,
                        String passPhrase,
                        org.apache.commons.vfs.FileObject decryptedFilename)
                 throws KettleException
Decrypt a file

Parameters:
cryptedFilename - crypted filename
passPhrase - passphrase for the personal private key to sign with
decryptedFilename - decrypted filename
Throws:
KettleException

decryptFile

public void decryptFile(String cryptedFilename,
                        String passPhrase,
                        String decryptedFilename)
                 throws KettleException
Decrypt a file

Parameters:
cryptedFilename - crypted filename
passPhrase - passphrase for the personal private key to sign with
decryptedFilename - decrypted filename
Throws:
KettleException

encryptFile

public void encryptFile(org.apache.commons.vfs.FileObject filename,
                        String userID,
                        org.apache.commons.vfs.FileObject cryptedFilename,
                        boolean asciiMode)
                 throws KettleException
Encrypt a file

Parameters:
filename - file to encrypt
userID - specific user id key
cryptedFilename - crypted filename
asciiMode - output ASCII file
Throws:
KettleException

encryptFile

public void encryptFile(String filename,
                        String userID,
                        String cryptedFilename,
                        boolean asciiMode)
                 throws KettleException
Encrypt a file

Parameters:
filename - file to encrypt
userID - specific user id key
cryptedFilename - crypted filename
asciiMode - output ASCII file
Throws:
KettleException

signAndEncryptFile

public void signAndEncryptFile(org.apache.commons.vfs.FileObject file,
                               String userID,
                               org.apache.commons.vfs.FileObject cryptedFile,
                               boolean asciiMode)
                        throws KettleException
Sign and encrypt a file

Parameters:
file - file to encrypt
userID - specific user id key
cryptedFile - crypted filename
asciiMode - output ASCII file
Throws:
KettleException

signAndEncryptFile

public void signAndEncryptFile(String filename,
                               String userID,
                               String cryptedFilename,
                               boolean asciiMode)
                        throws KettleException
Sign and encrypt a file

Parameters:
filename - file to encrypt
userID - specific user id key
cryptedFilename - crypted filename
asciiMode - output ASCII file
Throws:
KettleException

signFile

public void signFile(String filename,
                     String userID,
                     String signedFilename,
                     boolean asciiMode)
              throws KettleException
Sign a file

Parameters:
filename - file to encrypt
userID - specific user id key
cryptedFilename - crypted filename
asciiMode - output ASCII file
Throws:
KettleException

signFile

public void signFile(org.apache.commons.vfs.FileObject file,
                     String userID,
                     org.apache.commons.vfs.FileObject signedFile,
                     boolean asciiMode)
              throws KettleException
Sign a file

Parameters:
file - file to encrypt
userID - specific user id key
signedFile - crypted filename
asciiMode - output ASCII file
Throws:
KettleException

verifySignature

public void verifySignature(org.apache.commons.vfs.FileObject filename)
                     throws KettleException
Verify a signature

Parameters:
filename - filename
Throws:
KettleException

verifySignature

public void verifySignature(String filename)
                     throws KettleException
Verify a signature

Parameters:
filename - filename
Throws:
KettleException

verifyDetachedSignature

public void verifyDetachedSignature(String signatureFilename,
                                    String originalFilename)
                             throws KettleException
Verify a signature for detached file

Parameters:
signatureFilename - filename
originalFilenamefill - this value in case of detached signature
Throws:
KettleException

verifyDetachedSignature

public void verifyDetachedSignature(org.apache.commons.vfs.FileObject signatureFile,
                                    org.apache.commons.vfs.FileObject originalFile)
                             throws KettleException
Verify a signature for detached file

Parameters:
signatureFile - filename
originalFile - fill this value in case of detached signature
Throws:
KettleException

encrypt

public String encrypt(String plainText,
                      String keyID)
               throws KettleException
Encrypt a string

Parameters:
plainText - input string to encrypt
keyID - key ID of the key in GnuPG's key database to encrypt with
Returns:
encrypted string
Throws:
KettleException

signAndEncrypt

public String signAndEncrypt(String plainText,
                             String userID,
                             String passPhrase)
                      throws KettleException
Signs and encrypts a string

Parameters:
plainText - input string to encrypt
userID - key ID of the key in GnuPG's key database to encrypt with
passPhrase - passphrase for the personal private key to sign with
Returns:
encrypted string
Throws:
KettleException

sign

public String sign(String stringToSign,
                   String passPhrase)
            throws KettleException
Sign

Parameters:
stringToSign - input string to sign
passPhrase - passphrase for the personal private key to sign with
Throws:
KettleException

decrypt

public String decrypt(String cryptedText,
                      String passPhrase)
               throws KettleException
Decrypt a string

Parameters:
cryptedText - input string to decrypt
passPhrase - passphrase for the personal private key to sign with
Returns:
plain text
Throws:
KettleException

toString

public String toString()
Overrides:
toString in class Object