I developed SSIS Package with Execute Process Task which encrypt the text file into PGP encrypted file.
For PGP encryption with Public Key I processed following steps:
Installed gnupg software for gpg encryption.
Import the public key using command :
C:\Program Files (x86)\GNU\GnuPG\gpg --import test.asc(public key file).
Giving trust to ultimate
Setup following properties in Execute Process Task's Process Properties :
--Executable : C:\Program Files (x86)\GNU\GnuPG\gpg.exe
--Arguments : "--recipient KeyRing --armor --output "+ @[User::FileOutDir] + @[User::EncryptedFileName] +" --encrypt "+ @[User::FullFilePath]
Where -- KeyRing is user id of the Public Key
This works fine when I run the package from Bids and created encrypted file as desired.
But when I tried to run this SSIS package from SQL Server Job, It gave the following error:
Source: Execute Process Task Execute Process Task Description: In Executing "C:\Program Files (x86)\GNU\GnuPG\gpg.exe" "--recipient KeyRing --armor --output D:\SSIS_EXPORT_IMPORT_FILES\\Test_Export_SSIS\File_Out\Test_File_130221094201.gpg --encrypt D:\SSIS_EXPORT_IMPORT_FILES\Test_Export_SSIS\File_Out_BackUp\Test_File_130221094201.txt" at "D:\SSIS_EXPORT_IMPORT_FILES\Test_Export_SSIS\File_Out", The process exit code was "2" while the expected was "0". End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 9:41:59 PM Finished: 9:42:02 PM Elapsed: 3.167 seconds. The package execution failed. The step failed.
Can anyone give me suggestion how can I perform the task successfully in SQL Server Job??