RE: [PHP] PHP & PGP
| From: | Chris Mason | Date: | Fri, 29 Jun 2001 11:40:48 +0000 |
| Subject: | RE: [PHP] PHP & PGP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-55567@lists.php.net to get a copy of this message | ||
class eZGPG
{
/*!
\static
Encrypt function
*/
function eZGPG( $plaintxt, $keyname, $wwwuser)
{
$this->keyname=$keyname;
if ( sizeof( $this->keyname ) == 0 )
$this->body = "WARNING: No Keys Specified";
$this->pcmd = "echo '$plaintxt' | ";
$this->pcmd .= $this->pathtogpg.$this->encryptcommand;
$this->pcmd.= " -a -q --no-tty -e -u ". $wwwuser . " --homedir '"
.
$this->home ."' -r '". $this->keyname . "' ";
//clear return array and execute encrypt command
unset( $ret );
exec($this->pcmd, $ret);
//loop return array for encrypted text
foreach( $ret as $key=>$value )
{
$this->body .= $value;
$this->body .="\n";
}
}
// return $this->body
function getbody()
{
return $this->body;
}
var $body;
var $keyname = array();
var $ret = array();
var $pathtogpg = "/usr/bin/";
var $pcmd;
var $encryptcommand = "gpg --encrypt --batch --no-secmem-warning";
var $home = "/var/www/.gnupg";
}
-----Original Message-----
From: Pepe Lopez [mailto:lopez@pepe-lopez.com]
Sent: Thursday, June 28, 2001 10:06 AM
To: php-general@lists.php.net
Subject: [PHP] PHP & PGP
Hi there,
I want to encrypt mails coming from my webform with pgp. Is it possible?
regards,
Lopez
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net