php-gnupg/examples/encryptsign.php

15 lines
414 B
PHP
Raw Normal View History

<?php
require_once (dirname(__FILE__)."/main.php");
2005-10-25 19:37:32 +00:00
$gnupg -> addSignKey ($fingerprint,$passphrase);
$gnupg -> addEncryptKey ($fingerprint);
$text = $gnupg -> encryptsign ($mailtext);
echo $text;
echo "\n-------------------------\n";
$plaintext = false;
2005-10-25 19:37:32 +00:00
$gnupg -> addDecryptKey ($fingerprint,$passphrase);
$retval = $gnupg -> decryptverify ($text,$plaintext);
print_r($retval);
print_r($plaintext);
?>