Class IMP_PGP

Description

The IMP_PGP:: class contains all functions related to handling PGP messages within IMP.

Copyright 2002-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.fsf.org/copyleft/gpl.html.

Located in /lib/Crypt/PGP.php (line 28)

Horde_Crypt_pgp
   |
   --IMP_PGP
Variable Summary
 array $_sources
Method Summary
 IMP_PGP IMP_PGP ()
 void addPersonalPrivateKey (mixed $private_key)
 void addPersonalPublicKey (mixed $public_key)
 array addPublicKey (string $public_key)
 string decryptMessage (string $text, [boolean $symmetric_hint = null], [boolean $passphrase = true])
 PEAR_Error deletePublicKey (string $email)
 PEAR_Error generatePersonalKeys ( $name, string $email, string $passphrase, [string $comment = ''], [string $keylength = 1024], string $realname)
 string getFromPublicKeyserver (string $fingerprint, [string $address = null])
 string getJSOpenWinCode (string $actionid, [mixed $reload = true], [array $params = array()])
 string getPassphrase ()
 string getPublicKey (string $address, [string $fingerprint = null], [boolean $server = true])
 string getSignedMessage ( &$mime_part, MIME_Part $mime_part)
 MIME_Part IMPencryptMIMEPart (MIME_Part $mime_part, array $addresses, [boolean $symmetric = false])
 MIME_Part IMPsignAndEncryptMIMEPart (MIME_Part $mime_part, array $addresses, [boolean $symmetric = false])
 MIME_Part IMPsignMIMEPart (MIME_Part $mime_part)
 array listPublicKeys ()
 array &parseMessage (string $text)
 string parseMessageOutput (MIME_Part &$part, MIME_Contents &$contents)
 MIME_Part publicKeyMIMEPart ()
 string savePublicKeyURL (MIME_Part &$mime_part, [string $cache = null])
 string sendToPublicKeyserver (string $pubkey)
 boolean storePassphrase (string $passphrase)
 boolean storeSymmetricPassphrase (string $passphrase)
 void unsetPassphrase ()
 string verifySignature (string $text, string $address, [string $signature = ''])
Variables
array $_sources = null (line 35)

The list of available sources to search for keys.

Methods
Constructor IMP_PGP (line 40)

Constructor

IMP_PGP IMP_PGP ()
addPersonalPrivateKey (line 87)

Add the personal private key to the prefs.

void addPersonalPrivateKey (mixed $private_key)
  • mixed $private_key: The private key to add (either string or array).
addPersonalPublicKey (line 76)

Add the personal public key to the prefs.

void addPersonalPublicKey (mixed $public_key)
  • mixed $public_key: The public key to add (either string or array).
addPublicKey (line 131)

Add a public key to an address book.

  • return: See Horde_Crypt_pgp::pgpPacketInformation() Returns PEAR_Error or error.
array addPublicKey (string $public_key)
  • string $public_key: An PGP public key.
decryptMessage (line 547)

Decrypt a message with user's public/private keypair or a passphrase.

  • return: The decrypted message. Returns PEAR_Error object on error.
string decryptMessage (string $text, [boolean $symmetric_hint = null], [boolean $passphrase = true])
  • string $text: The text to decrypt.
  • boolean $symmetric_hint: Whether the text has been encrypted symmetrically. If null, we try to find out.
  • boolean $passphrase: Whether a passphrase has to be used.
deletePersonalKeys (line 115)

Deletes the specified personal keys from the prefs.

void deletePersonalKeys ()
deletePublicKey (line 260)

Deletes a public key from a user's address book(s) by e-mail.

  • return: Returns PEAR_Error object on error.
PEAR_Error deletePublicKey (string $email)
  • string $email: The e-mail address to delete.
generatePersonalKeys (line 57)

Generate the personal Public/Private keypair and store in prefs.

  • return: Returns PEAR_Error object on error.
PEAR_Error generatePersonalKeys ( $name, string $email, string $passphrase, [string $comment = ''], [string $keylength = 1024], string $realname)
  • string $realname: See Horde_Crypt_pgp::
  • string $email: See Horde_Crypt_pgp::
  • string $passphrase: See Horde_Crypt_pgp::
  • string $comment: See Horde_Crypt_pgp::
  • string $keylength: See Horde_Crypt_pgp::
  • $name
getFromPublicKeyserver (line 444)

Get a public key via a public PGP keyserver.

  • return: See Horde_Crypt_pgp::getPublicKeyserver()
string getFromPublicKeyserver (string $fingerprint, [string $address = null])
  • string $fingerprint: The fingerprint of the requested key.
  • string $address: The email address of the requested key.
getJSOpenWinCode (line 667)

Print out the link for the javascript PGP popup.

  • return: The javascript link.
string getJSOpenWinCode (string $actionid, [mixed $reload = true], [array $params = array()])
  • string $actionid: The ActionID to perform.
  • mixed $reload: If true, reload base window on close. If text, run this JS on close. If false, don't do anything on close.
  • array $params: Additional parameters needed for the reload page.
getPassphrase (line 569)

Gets the user's passphrase from the session cache.

  • return: The passphrase, if set.
string getPassphrase ()
getPersonalPrivateKey (line 107)

Get the personal private key from the prefs.

  • return: The personal PGP private key.
string getPersonalPrivateKey ()
getPersonalPublicKey (line 97)

Get the personal public key from the prefs.

  • return: The personal PGP public key.
string getPersonalPublicKey ()
getPublicKey (line 179)

Retrieves a public key by e-mail.

First, the key is attempted to be retrieved through a hook. Second, the key is attempted to be retrieved from the user's address book(s). Third, the key is attempted to be retrieved via a public PGP keyserver.

  • return: The PGP public key requested. Returns PEAR_Error object on error.
string getPublicKey (string $address, [string $fingerprint = null], [boolean $server = true])
  • string $address: The e-mail address to search by.
  • string $fingerprint: The fingerprint of the user's key.
  • boolean $server: Whether to check the publick key servers for the key.
getSignedMessage (line 398)

Returns the signed data only for a plaintext signed MIME_Part.

  • return: The contents of the signed message.
string getSignedMessage ( &$mime_part, MIME_Part $mime_part)
  • MIME_Part $mime_part: The MIME_Part object with a plaintext PGP signed message in the contents.
  • &$mime_part
getSymmetricPassphrase (line 582)

Gets the user's passphrase for symmetric encryption from the session cache.

  • return: The passphrase, if set.
string getSymmetricPassphrase ()
IMPencryptMIMEPart (line 760)

Encrypt a MIME_Part using PGP using IMP default parameters.

  • return: See Horde_Crypt_pgp::encryptMIMEPart(). Returns PEAR_Error object on error.
MIME_Part IMPencryptMIMEPart (MIME_Part $mime_part, array $addresses, [boolean $symmetric = false])
  • MIME_Part $mime_part: The MIME_Part object to encrypt.
  • array $addresses: The e-mail address of the keys to use for encryption.
  • boolean $symmetric: Whether to encrypt symmetrically.
IMPsignAndEncryptMIMEPart (line 780)

Sign and Encrypt a MIME_Part using PGP using IMP default parameters.

  • return: See Horde_Crypt_pgp::signAndencryptMIMEPart(). Returns PEAR_Error object on error.
MIME_Part IMPsignAndEncryptMIMEPart (MIME_Part $mime_part, array $addresses, [boolean $symmetric = false])
  • MIME_Part $mime_part: The MIME_Part object to sign and encrypt.
  • array $addresses: The e-mail address of the keys to use for encryption.
  • boolean $symmetric: Whether to encrypt symmetrically.
IMPsignMIMEPart (line 744)

Sign a MIME_Part using PGP using IMP default parameters.

  • return: See Horde_Crypt_pgp::signMIMEPart(). Returns PEAR_Error object on error.
MIME_Part IMPsignMIMEPart (MIME_Part $mime_part)
  • MIME_Part $mime_part: The MIME_Part object to sign.
listPublicKeys (line 247)

Retrieves all public keys from a user's address book(s).

  • return: All PGP public keys available. Returns PEAR_Error object on error.
array listPublicKeys ()
parseMessage (line 293)

Parse a message into its PGP components.

  • return: Returns an array of MIME_Part objects. If there was no PGP data, returns false.
array &parseMessage (string $text)
  • string $text: See Horde_Crypt_pgp::parsePGPData()
parseMessageOutput (line 350)

Renders a text message with PGP components.

  • return: Returns the rendered text. If there was no PGP data, returns false.
string parseMessageOutput (MIME_Part &$part, MIME_Contents &$contents)
  • MIME_Part &$part: The MIME_Part containing the data to render.
  • MIME_Contents &$contents: The MIME_Contents:: module to use to output the text.
publicKeyMIMEPart (line 796)

Generate a MIME_Part object, in accordance with RFC 2015/3156, that contains the user's public key.

  • return: See Horde_Crypt_pgp::publicKeyMIMEPart().
MIME_Part publicKeyMIMEPart ()
savePublicKeyURL (line 644)

Generates the javascript code for saving public keys.

  • return: The URL for saving public keys.
string savePublicKeyURL (MIME_Part &$mime_part, [string $cache = null])
  • MIME_Part &$mime_part: The MIME_Part containing the public key.
  • string $cache: The MIME_Part identifier.
sendToPublicKeyserver (line 456)

Send a public key to a public PGP keyserver.

  • return: See Horde_Crypt_pgp::putPublicKeyserver()
string sendToPublicKeyserver (string $pubkey)
  • string $pubkey: The PGP public key.
storePassphrase (line 596)

Store's the user's passphrase in the session cache.

  • return: Returns true if correct passphrase, false if incorrect.
boolean storePassphrase (string $passphrase)
  • string $passphrase: The user's passphrase.
storeSymmetricPassphrase (line 614)

Store's the user's passphrase for symmetric encryption in the session cache.

  • return: True
boolean storeSymmetricPassphrase (string $passphrase)
  • string $passphrase: The user's passphrase.
unsetPassphrase (line 623)

Clear the passphrase from the session cache.

void unsetPassphrase ()
unsetSymmetricPassphrase (line 631)

Clear the passphrase for symmetric encryption from the session cache.

void unsetSymmetricPassphrase ()
verifySignature (line 505)

Verifies a signed message with a given public key.

  • return: See Horde_Crypt_pgp::decryptSignature() -or- Horde_Crypt_pgp::decryptDetachedSignature().
string verifySignature (string $text, string $address, [string $signature = ''])
  • string $text: The text to verify.
  • string $address: E-mail address of public key.
  • string $signature: A PGP signature block.

Documentation generated on Sun, 30 Jan 2011 05:28:15 +0000 by phpDocumentor 1.4.3