.
*
*************************************************************/
// check that data has arrived here via HTTPS
if ($_SERVER['HTTPS'] != "on") {
die ("Use a secure HTTPS connection to the server. Aborting ...");
}
// use GET only without data
if (strtoupper($_SERVER['REQUEST_METHOD']) != "POST") {
//check if there is a query string, then abort.
if (count($_GET) != 0){
die ("Always use POST to prevent recording of query strings. Aborting ...");
}
}
if (! is_file("gpgconfig.php")){
die ("Config file does not exist.");
}
require_once('gpgconfig.php');
if (! is_dir($GPGDIR)){
die ("GPG directory $GPGDIR does not exist.");
}
else {
$ERRORFILE = $GPGDIR."/gpgerrors";
}
if (! isset($KEYEXPORT)) {
$KEYEXPORT = "no";
}
if (! isset($SECRETKEYEXPORT)) {
$SECRETKEYEXPORT = "no";
}
// FUNCTIONS
function listkeys ($gpghome, $type, $select, $export, $secretexport) {
unix ("/usr/bin/gpg --homedir ".$gpghome." --update-trustdb");
if ($type == "secret") {
echo "