Reputation: 11
I want to use gpg in PHP but it only returns false. Can anyone help me?
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$publicKey = file_get_contents('test.asc');
$gpg=gnupg_init();
$PublicData = $publicKey;
$res=gnupg_import($gpg, $PublicData);
var_dump($res); -- returns false
$er=gnupg_geterror($gpg);
var_dump($er); --returns false
?>
That's my complete code, anyone see something wrong? It would be nice if anyone had a fix. Thank you.
I want that PGP encryption and decryption work and not just return false.
Upvotes: 0
Views: 52