note 79191 deleted from function.gnupg-verify by betz
| From: | betz@php.net | Date: | Thu, 15 Nov 2007 14:31:18 +0000 |
| Subject: | note 79191 deleted from function.gnupg-verify by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-132303@lists.php.net to get a copy of this message | ||
Note Submitter: jontomxire_AT_yahoo_co_uk
----
I can't get this to work:
$gpg = gnupg_init();
$result = gnupg_import($gpg, $_POST[pubkey]);
if(0 >= ($result[imported] + $result[secretimported]))
{
echo "<p>Failed to import key.</p>\n";
}
else
{
print_r($result);
unset($result);
$result = gnupg_verify($gpg, $_POST[message], FALSE, $output);
echo "<br>"; print_r($result);
echo "<p>Message is:</p><p>".$output."</p>\n";
}
I get:
Array ( [imported] => 1 [unchanged] => 0 [newuserids] => 0 [newsubkeys] => 0
[secretimported] => 0 [secretunchanged] => 0 [newsignatures] => 0 [skippedkeys] => 0
[fingerprint] => EBB9DD00910898A607A269F34743BFFC )
Array ( [0] => Array ( [fingerprint] => EBB9DD00910898A607A269F34743BFFC [validity] => 0
[timestamp] => 1195035446 [status] => 0 [summary] => 0 ) )
Message is:
So it looks like the key is imported ok, the signature is verified ok, but the plaintext message
that was signed is empty.
Does anyone have any ideas? I've searched the internet and found nothing. :(