php-gnupg/examples/encryptsign.php
2005-10-25 19:37:32 +00:00

14 lines
414 B
PHP

<?php
require_once (dirname(__FILE__)."/main.php");
$gnupg -> addSignKey ($fingerprint,$passphrase);
$gnupg -> addEncryptKey ($fingerprint);
$text = $gnupg -> encryptsign ($mailtext);
echo $text;
echo "\n-------------------------\n";
$plaintext = false;
$gnupg -> addDecryptKey ($fingerprint,$passphrase);
$retval = $gnupg -> decryptverify ($text,$plaintext);
print_r($retval);
print_r($plaintext);
?>