Dear sir,
I want to encrypt the files using pgp.
I tried it with simple code in php with shell exec command
It gives Errror
"Cannot find the public key matching userid ,user will not be able to decrypt this message,"
when I tried
Shell.exec("pgp -kc");
It is reffering to some other keyring file with following message
"'C:\WINDOWS\Profiles\Default User\Application Data\PGP\pubring.pkr' Type bits keyID Date User ID 0 matching keys found"
"
the commands works properly with windows command prompt and with standalone java application
I have tryied it with java it works well with java excuting standalone
But it gives error when I try to call java from php
code sample php code that I am trying is
$str="path to the key ring files";
putenv("PGPPATH=$str");
$ip=getenv("PGPPATH");
echo "env variable: ". $ip."<br>";
$cmd="pgp -ea path to the files to encrypt userid";
$mstrng = shell_exec($cmd);
echo "php res:".$mstrng."<br>";
$cmd="pgp -kc";
$mstrng = shell_exec($cmd);
echo "Key ring Path:".$mstrng."<br>";
We have also set enviromental variable PGPPATH as windows System variable but no luck
is there any extra setting require from apache side??
thanks in advance,
Regards,
man26