Class IMP_SMIME

Description

The IMP_SMIME:: class contains all functions related to handling S/MIME messages within IMP.

$Horde: imp/lib/Crypt/SMIME.php,v 1.45.2.26 2011-01-05 18:52:37 slusarz Exp $

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/SMIME.php (line 24)

Horde_Crypt_smime
   |
   --IMP_SMIME
Variable Summary
 array $_sources
Method Summary
 IMP_SMIME IMP_SMIME ()
 void addAdditionalCert (mixed $key)
 boolean addFromPKCS12 (string $pkcs12, string $password, [string $pkpass = null])
 void addPersonalPrivateKey (mixed $key)
 void addPersonalPublicKey (mixed $key)
 boolean addPublicKey (string $cert)
 string decryptMessage (string $text)
 PEAR_Error deletePublicKey (string $email)
 string extractSignedContents (string $data)
 string getAdditionalCert ()
 string getJSOpenWinCode (integer $actionid, [mixed $reload = true], [array $params = array()])
 mixed getPassphrase ()
 string getPublicKey (string $address)
 MIME_Part IMPencryptMIMEPart (MIME_Part $mime_part, mixed $to_address)
 MIME_Part IMPsignAndEncryptMIMEPart (MIME_Part $mime_part, string $to_address)
 MIME_Part IMPsignMIMEPart (MIME_Part $mime_part)
 array listPublicKeys ()
 string savePublicKeyURL (MIME_Part $mime_part)
 boolean storePassphrase (string $passphrase)
 void unsetPassphrase ()
 stdClass verifySignature (string $text)
 array _encryptParameters (string $address)
Variables
array $_sources = null (line 31)

The list of available sources to search for keys.

Methods
Constructor IMP_SMIME (line 36)

Constructor.

IMP_SMIME IMP_SMIME ()
addAdditionalCert (line 66)

Add the list of additional certs to the prefs.

void addAdditionalCert (mixed $key)
  • mixed $key: The private key to add (either string or array).
addFromPKCS12 (line 470)

Store the public/private/additional certificates in the preferences from a given PKCS 12 file.

  • return: True on success, PEAR_Error on error.
boolean addFromPKCS12 (string $pkcs12, string $password, [string $pkpass = null])
  • string $pkcs12: The PKCS 12 data.
  • string $password: The password of the PKCS 12 file.
  • string $pkpass: The password to use to encrypt the private key.
addPersonalPrivateKey (line 56)

Add the personal private key to the prefs.

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

Add the personal public key to the prefs.

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

Add a public key to an address book.

  • return: True on successful add. Returns PEAR_Error or error.
boolean addPublicKey (string $cert)
  • string $cert: A public certificate to add.
decryptMessage (line 298)

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

  • return: See Horde_Crypt_smime::decrypt(). Returns PEAR_Error object on error.
string decryptMessage (string $text)
  • string $text: The text to decrypt.
deletePersonalKeys (line 104)

Deletes the specified personal keys from the prefs.

void deletePersonalKeys ()
deletePublicKey (line 233)

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.
extractSignedContents (line 502)

Extract the contents from signed S/MIME data.

  • return: The contents embedded in the signed data. Returns PEAR_Error on error.
string extractSignedContents (string $data)
  • string $data: The signed S/MIME data.
getAdditionalCert (line 96)

Get any additional certificates from the prefs.

  • return: Additional signing certs for inclusion.
string getAdditionalCert ()
getJSOpenWinCode (line 392)

Print out the link for the javascript S/MIME popup.

  • return: The javascript link.
string getJSOpenWinCode (integer $actionid, [mixed $reload = true], [array $params = array()])
  • integer $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 311)

Gets the user's passphrase from the session cache.

  • return: The passphrase, if set. Returns false if the passphrase has not been loaded yet. Returns null if no passphrase is needed.
mixed getPassphrase ()
getPersonalPrivateKey (line 86)

Get the personal private key from the prefs.

  • return: The personal S/MIME private key.
string getPersonalPrivateKey ()
getPersonalPublicKey (line 76)

Get the personal public key from the prefs.

  • return: The personal S/MIME public key.
string getPersonalPublicKey ()
getPublicKey (line 184)

Retrieves a public key by e-mail.

The key will be retrieved through a hook or from the user's address book(s).

  • return: The requested public S/MIME key or PEAR_Error on failure.
string getPublicKey (string $address)
  • string $address: The e-mail address to search for.
IMPencryptMIMEPart (line 419)

Encrypt a MIME_Part using S/MIME using IMP defaults.

  • return: See Horde_Crypt_smime::encryptMIMEPart(). Returns PEAR_Error on error.
MIME_Part IMPencryptMIMEPart (MIME_Part $mime_part, mixed $to_address)
  • MIME_Part $mime_part: The MIME_Part object to encrypt.
  • mixed $to_address: The e-mail address of the key to use for encryption.
IMPsignAndEncryptMIMEPart (line 451)

Sign and encrypt a MIME_Part using S/MIME using IMP defaults.

  • return: See Horde_Crypt_smime::signAndencryptMIMEPart(). Returns PEAR_Error on error.
MIME_Part IMPsignAndEncryptMIMEPart (MIME_Part $mime_part, string $to_address)
  • MIME_Part $mime_part: The MIME_Part object to sign and encrypt.
  • string $to_address: The e-mail address of the key to use for encryption.
IMPsignMIMEPart (line 436)

Sign a MIME_Part using S/MIME using IMP defaults.

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

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 ()
savePublicKeyURL (line 369)

Generates the javascript code for saving public keys.

  • return: The URL for saving public keys.
string savePublicKeyURL (MIME_Part $mime_part)
  • MIME_Part $mime_part: The MIME_Part containing the public key.
storePassphrase (line 339)

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.
unsetPassphrase (line 356)

Clear the passphrase from the session cache.

void unsetPassphrase ()
verifySignature (line 284)

Verifies a signed message with a given public key.

  • return: See Horde_Crypt_smime::verify().
stdClass verifySignature (string $text)
  • string $text: The text to verify.
_encryptParameters (line 160)

Returns the params needed to encrypt a message being sent to the specified email address.

  • return: The list of parameters needed by encrypt(). Returns PEAR_Error object on error.
array _encryptParameters (string $address)
  • string $address: The e-mail address of the recipient.

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