[Gpg4win-users-en] GPG Encryption Fails When Called From Oracle Enterprise Manager

Andre Heinecke aheinecke at intevation.de
Tue Jul 7 18:10:37 CEST 2015


Hi,

On Tuesday, July 07, 2015 03:52:51 PM Kent Hurtig wrote:
> I have created a batch job that encrypts a file using GnuPG software.  When
> I run the batch file from the server where the file resides, it runs
> successfully and encrypts the file.  When I run the batch job through
> Oracle Enterprise Manager(the software that we schedule our batch jobs
> through), the task which encrypts the file using gpg encounters several
> issues.  I have attached the output from this task. 

Not serveral issues, Just one:
gpg: E:\\Test\\ECSI_Perkins_Loan_Test\\TESTbldpromIG.csv: encryption failed: 
No public key

> I should mention that
> I previously had the same issue on our old "Media" windows server 2003.  To
> correct the issue, I changed the gpg command to be more verbose and saw
> that the process was being ran as the default user and not as user
> aunt_bee.    I copied the gpg.conf, pubring.gpg, secring.gpg, trustdb.gpg
> and trust.gpg.lock from C:\Documents and Settings\aunt_bee\Application
> Data\gunpg to C:\Documents and Settings\Default User\Application Data\gnupg
> on Media, reran the Oracle Enterprise Manager job and it finished
> successfully.

For encryption gnupg needs to find the public key of the recipient. This key is 
contained in pubring.gpg.

GnuPG looks for this file by default in %APPDATA%\gnupg

This apperantly expands in your environment to: 
C:/Windows/system32/config/systemprofile/AppData/Roaming/gnupg

To change this you can add --homedir <path_to_gnupg_homedir> and gnupg will 
then look in that directory for the keyring.

For example:
-> Create a directory c:\gnupg
-> Copy the pubring.gpg (and gpg.conf if you have options in there) into that 
directory.
-> extend your command to include --homedir c:\gnupg in the arguments.

Now as long as that Batch user has read access to c:\gnupg this should work.

Regards,
Andre

-- 
Andre Heinecke |  ++49-541-335083-262  |  http://www.intevation.de/
Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.wald.intevation.org/pipermail/gpg4win-users-en/attachments/20150707/74c63f41/attachment.sig>


More information about the Gpg4win-users-en mailing list