Reputation: 1
gpg --output C:\ecshome\mboxes\store\20150410_030846_1_0001_6pik.msg.
asc --passphrase abcd. --no-default-keyring --decrypt C:\ecshome\mboxes\store\20150410_030846_1_0001_6pik.msg
When I try to decrypt an email message by using gpg from the command prompt, it works. But when I try to decrypt the same with a Perl script by using external command, it shows the "Secret key not available" error (On Windows).
Upvotes: 0
Views: 450
Reputation: 1
The problem was with pubkey ring. Apparently its stored for each user under their application data directory if you don't mention any home directory specifically at time of installation. If you execute from Command prompt it will directly take from the present user's applicatin data but from perl it wont check there.U have to specifically Configure GNUPGHOME to that folder (application data) then run the perl script.
Upvotes: 0
Reputation: 4104
You haven't shown us the way you quote that command in perl, but allow me guess that you haven't taken into account the fact that the backslash is both the Windows directory seperator and the Perl string escape. You should be aware that "\e"
, the 3rd character in your --output & --decrypt paths, is the character (ESC). The sequences "\m"
and "\s"
interpolate to 'm'
and 's'
respectively.
Possible solutions include either delimiting the string with q()
/single quotes or doubling up the backslashes in qq()
/qx()
/double quotes/back quotes.
Upvotes: 1