Page 1 of 1

how to delete a GnuPG Secret key using php

Posted: Sat Dec 14, 2002 7:16 am
by graziano
Hello,

I written a simple php script (see below) to delete GnupG secret keys , however I receive this error ;


gpg: cannot open /dev/tty


If I add --no-tty I receive this error ,
gpg: Sorry, no terminal at all requested - can't get input


Any idea ?

Thank you

Code: Select all

<?
function getDELETEPRIVATE()
&#123;
    ob_start();
$command = "/usr/bin/gpg --no-secmem-warning --home /home/test/.gnupg --yes --delete-secret-key 'B209E218'";
    
        passthru($command);
        
         echo"<pre>";
        $lookup = ob_get_contents();
    ob_end_clean();
    return $lookup;
&#125;


$delete = getDELETEPRIVATE();
echo  "=========================================</BR>";
echo  "<pre>$delete</pre>";
?>

Posted: Sat Dec 14, 2002 8:12 am
by volka
I don't know gpg but doesn't it ask for any password before you can delete something? If it tries it has no chance since there is no terminal ;)