Dear all, I would like to write a cgi using perl to encrypt some text files in Windows, the following is my program test.cgi. in the $cmd, Henry is a public key generated by gpg, and 451080.txt is the files I would like to encrypt.
#!c:/Perl/bin/perl.exe print "Content-type: text/html\n\n"; $cmd = "\"C:\\Program Files\\GNU\\GnuPG\\gpg.exe\" -e --no-secmem-warning --always-trust -a -r Henry C:\\apache\\cgi-bin\\451080.txt"; print $cmd."\n\n"; system($cmd); The question is that if I enter the following command in commander: "C:\Program Files\GNU\GnuPG\gpg.exe" -e --no-secmem-warning --always-trust -a -r Henry C:\apache\cgi-bin\451080.txt The file 451080.txt will successfully be encrypted and new file 451080.txt.asc will be generated. But when I deployed first.cgi in apache and run it using: http://localhost/cgi-bin/test.cgi The file cannot be successfully encrypted and also in error.log there has such errors: [Tue Feb 24 15:01:40 2009] [error] [client 127.0.0.1] gpg: Henry: skipped: public key not found\r [Tue Feb 24 15:01:40 2009] [error] [client 127.0.0.1] gpg: C:\\apache\\cgi-bin\\451080.txt: encryption failed: public key not found\r Does anybody know how to fix this problem? Why commander can successfully execute the command but the apache cannot find the public key? Thanks very much. Henry -- View this message in context: http://www.nabble.com/Error-on-gpg-encription-using-perl-cgi-tp22177190p22177190.html Sent from the GnuPG - User mailing list archive at Nabble.com. _______________________________________________ Gnupg-users mailing list Gnupg-users@gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-users