I have search all over the web, but unable to find an answer, so I hope I can find one here.
I have a web application run on Windows and IIS written in Perl. One of the scripts perfroms multiple tasks. One of them executes a command to encrypt a file. Here is the command:
my $cmd = "c:\\gnupg\\pub\\gpg -ase --always-trust --batch --passphrase mypassphrase --output $filename.pgp -r stuff $filename";
qx/$cmd/;
Unfortunately, this does not work. The error I get is:
gpg: no default secret key: No secret key gpg: C:\\Dev\\somefile.csv: sign+encrypt failed: No secret key
When I am trying to run same command on same server from cmd it works fine.
From what I understand, when you run a scrip through web, it runs as anonymous user. So it does not see the secrey key generated as a local user. If I run the command locally through cmd it sees the secret key since it runs as a local user.
The question is: how do I solve this problem and make the scrip work?
Thank you,
-Andrey