I have an SSIS package with a task that I need to perform PGP encryption. I am running the package both from BIDS and from the package store of a SQL Server. The (GNU) encryption is being performed by a server on our network. I am wondering if someone can help me solve the problem of doing encryption on that "PGP server."
I have a batch file on the PGP server. If I login to this box using my network credentials and double-click the batch file (from Windows Explorer), it works fine.
However, the package won't be doing this. When I attempt to call the batch file from either BIDS or the SQL Server I get an error that there is "no public key." This is because the current directory is not set within the PGP server, and the encryption is being attempted where the package is being run.
I have tried two things to remedy this. First, prior to executing the batch file I attempt to set the current directory to the PGP server. I'm using this VB.NET command:
It seems to work. However, when I insert a pause statement in my batch file I see that my current directory is not the PGP server. By the way, the batch file to perform encryption more or less resembles:
gpg --recipient firstname.lastname@example.org --always-trust --encrypt "my_big_zipped_file.zip"
The "dir/p" and "pause" statements are just for debugging.
The other way I've tried to set the current directory to the PGP server is by using the DOS "pushd" command; e.g.,
gpg --recipient ...
When I do this, the directory listing ("dir/p") shows the files in the PGP server's working directory, but the encryption still fails based on "no public key."
I'm sure that there are SSIS developers who have performed PGP encryption on a server other than where the package resides. How did you accomplish it?