No secret key under different account

David Shaw dshaw at
Fri Oct 30 15:42:22 CET 2009

On Oct 30, 2009, at 10:24 AM, David Gray wrote:

> Hello all,
> GPG 2.0.12
> Windows Server 2003
> I've written a C# application which scans for input files and  
> decrypts using
> GPG.
> This applications works fine when run under the account  
> (Administrator) that
> GPG was installed
> under but when run from a different account (SQLService) I get this  
> error.
> gpg: encrypted with ELG key, ID 891AB7E7  gpg: decryption failed: No  
> secret
> key
> Error Decrypting C:\Program
> Files\GNU\GnuPG\work\KLIOLB_20091002_11235900.PGP
> I've given full permissions to the SQLService account.
> Are there any permissions I need to set within GPG or do I need to  
> specify
> anything else on the command line when running under a different  
> account?

Most likely your keyring is stored under the Administrator account, so  
when run as SQLService, you can't find the keys.

Look at the .gnupg directory in the Administrator account - it needs  
to be available to the SQLService user.  See also the --homedir option  
to GPG, which allows you to specify where the keyrings and config  
files go.


More information about the Gnupg-users mailing list