Class GPG
java.lang.Object
org.pentaho.di.job.entries.pgpencryptfiles.GPG
This defines a GnuPG wrapper class.
- Since:
- 25-02-2011
- Author:
- Samatar
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDecrypt a stringvoiddecryptFile(String cryptedFilename, String passPhrase, String decryptedFilename) Decrypt a filevoiddecryptFile(org.apache.commons.vfs2.FileObject cryptedFilename, String passPhrase, org.apache.commons.vfs2.FileObject decryptedFilename) Decrypt a fileEncrypt a stringvoidencryptFile(String filename, String userID, String cryptedFilename, boolean asciiMode) Encrypt a filevoidencryptFile(org.apache.commons.vfs2.FileObject filename, String userID, org.apache.commons.vfs2.FileObject cryptedFilename, boolean asciiMode) Encrypt a fileReturns GPG program locationSignsignAndEncrypt(String plainText, String userID, String passPhrase) Signs and encrypts a stringvoidsignAndEncryptFile(String filename, String userID, String cryptedFilename, boolean asciiMode) Sign and encrypt a filevoidsignAndEncryptFile(org.apache.commons.vfs2.FileObject file, String userID, org.apache.commons.vfs2.FileObject cryptedFile, boolean asciiMode) Sign and encrypt a filevoidSign a filevoidsignFile(org.apache.commons.vfs2.FileObject file, String userID, org.apache.commons.vfs2.FileObject signedFile, boolean asciiMode) Sign a filetoString()voidverifyDetachedSignature(String signatureFilename, String originalFilename) Verify a signature for detached filevoidverifyDetachedSignature(org.apache.commons.vfs2.FileObject signatureFile, org.apache.commons.vfs2.FileObject originalFile) Verify a signature for detached filevoidverifySignature(String filename) Verify a signaturevoidverifySignature(org.apache.commons.vfs2.FileObject filename) Verify a signature
-
Constructor Details
-
GPG
public GPG(String gpgFilename, org.pentaho.di.core.logging.LogChannelInterface logInterface) throws org.pentaho.di.core.exception.KettleException Constructs a new GnuPG- Parameters:
gpgFilename- gpg program locationlogInterface- LogChannelInterface- Throws:
org.pentaho.di.core.exception.KettleException
-
-
Method Details
-
getGpgExeFile
Returns GPG program location- Returns:
- GPG filename
-
decryptFile
public void decryptFile(org.apache.commons.vfs2.FileObject cryptedFilename, String passPhrase, org.apache.commons.vfs2.FileObject decryptedFilename) throws org.pentaho.di.core.exception.KettleException Decrypt a file- Parameters:
cryptedFilename- crypted filenamepassPhrase- passphrase for the personal private key to sign withdecryptedFilename- decrypted filename- Throws:
org.pentaho.di.core.exception.KettleException
-
decryptFile
public void decryptFile(String cryptedFilename, String passPhrase, String decryptedFilename) throws org.pentaho.di.core.exception.KettleException Decrypt a file- Parameters:
cryptedFilename- crypted filenamepassPhrase- passphrase for the personal private key to sign withdecryptedFilename- decrypted filename- Throws:
org.pentaho.di.core.exception.KettleException
-
encryptFile
public void encryptFile(org.apache.commons.vfs2.FileObject filename, String userID, org.apache.commons.vfs2.FileObject cryptedFilename, boolean asciiMode) throws org.pentaho.di.core.exception.KettleException Encrypt a file- Parameters:
filename- file to encryptuserID- specific user id keycryptedFilename- crypted filenameasciiMode- output ASCII file- Throws:
org.pentaho.di.core.exception.KettleException
-
encryptFile
public void encryptFile(String filename, String userID, String cryptedFilename, boolean asciiMode) throws org.pentaho.di.core.exception.KettleException Encrypt a file- Parameters:
filename- file to encryptuserID- specific user id keycryptedFilename- crypted filenameasciiMode- output ASCII file- Throws:
org.pentaho.di.core.exception.KettleException
-
signAndEncryptFile
public void signAndEncryptFile(org.apache.commons.vfs2.FileObject file, String userID, org.apache.commons.vfs2.FileObject cryptedFile, boolean asciiMode) throws org.pentaho.di.core.exception.KettleException Sign and encrypt a file- Parameters:
file- file to encryptuserID- specific user id keycryptedFile- crypted filenameasciiMode- output ASCII file- Throws:
org.pentaho.di.core.exception.KettleException
-
signAndEncryptFile
public void signAndEncryptFile(String filename, String userID, String cryptedFilename, boolean asciiMode) throws org.pentaho.di.core.exception.KettleException Sign and encrypt a file- Parameters:
filename- file to encryptuserID- specific user id keycryptedFilename- crypted filenameasciiMode- output ASCII file- Throws:
org.pentaho.di.core.exception.KettleException
-
signFile
public void signFile(String filename, String userID, String signedFilename, boolean asciiMode) throws org.pentaho.di.core.exception.KettleException Sign a file- Parameters:
filename- file to encryptuserID- specific user id keycryptedFilename- crypted filenameasciiMode- output ASCII file- Throws:
org.pentaho.di.core.exception.KettleException
-
signFile
public void signFile(org.apache.commons.vfs2.FileObject file, String userID, org.apache.commons.vfs2.FileObject signedFile, boolean asciiMode) throws org.pentaho.di.core.exception.KettleException Sign a file- Parameters:
file- file to encryptuserID- specific user id keysignedFile- crypted filenameasciiMode- output ASCII file- Throws:
org.pentaho.di.core.exception.KettleException
-
verifySignature
public void verifySignature(org.apache.commons.vfs2.FileObject filename) throws org.pentaho.di.core.exception.KettleException Verify a signature- Parameters:
filename- filename- Throws:
org.pentaho.di.core.exception.KettleException
-
verifySignature
Verify a signature- Parameters:
filename- filename- Throws:
org.pentaho.di.core.exception.KettleException
-
verifyDetachedSignature
public void verifyDetachedSignature(String signatureFilename, String originalFilename) throws org.pentaho.di.core.exception.KettleException Verify a signature for detached file- Parameters:
signatureFilename- filenameoriginalFilenamefill- this value in case of detached signature- Throws:
org.pentaho.di.core.exception.KettleException
-
verifyDetachedSignature
public void verifyDetachedSignature(org.apache.commons.vfs2.FileObject signatureFile, org.apache.commons.vfs2.FileObject originalFile) throws org.pentaho.di.core.exception.KettleException Verify a signature for detached file- Parameters:
signatureFile- filenameoriginalFile- fill this value in case of detached signature- Throws:
org.pentaho.di.core.exception.KettleException
-
encrypt
public String encrypt(String plainText, String keyID) throws org.pentaho.di.core.exception.KettleException Encrypt a string- Parameters:
plainText- input string to encryptkeyID- key ID of the key in GnuPG's key database to encrypt with- Returns:
- encrypted string
- Throws:
org.pentaho.di.core.exception.KettleException
-
signAndEncrypt
public String signAndEncrypt(String plainText, String userID, String passPhrase) throws org.pentaho.di.core.exception.KettleException Signs and encrypts a string- Parameters:
plainText- input string to encryptuserID- key ID of the key in GnuPG's key database to encrypt withpassPhrase- passphrase for the personal private key to sign with- Returns:
- encrypted string
- Throws:
org.pentaho.di.core.exception.KettleException
-
sign
public String sign(String stringToSign, String passPhrase) throws org.pentaho.di.core.exception.KettleException Sign- Parameters:
stringToSign- input string to signpassPhrase- passphrase for the personal private key to sign with- Throws:
org.pentaho.di.core.exception.KettleException
-
decrypt
public String decrypt(String cryptedText, String passPhrase) throws org.pentaho.di.core.exception.KettleException Decrypt a string- Parameters:
cryptedText- input string to decryptpassPhrase- passphrase for the personal private key to sign with- Returns:
- plain text
- Throws:
org.pentaho.di.core.exception.KettleException
-
toString
-