When I run my Java application as a Windows service utilizing a wrapper, everything works fine except when the application tries to decrypt a file. It produces the following error:
GPG error >> code: 2 >> gpg: encrypted with RSA key, ID ########
gpg decryption failed: secret key not available.
The application encrypts and decrypts files without any problem when not running as a service. The wrapper also works fine.
Environment variables were set and confirmed in the Windows registry, but for some reason the system doesn't look in the Users\AppData\...
directory where the key is located.
This is an automated application, so there is no passphrase to encrypt or decrypt files.
What is wrong? Where might the system be looking for a secret key?