The IMP_Crypt_Smime:: class contains all functions related to handling
S/MIME messages within IMP.
Copyright 2002-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (GPL). If you
did not receive this file, see http://www.horde.org/licenses/gpl.
Methods summary
public
array
|
#
encryptList( )
Return the list of available encryption options for composing.
Return the list of available encryption options for composing.
Returns
array Keys are encryption type constants, values are gettext
strings describing the encryption type.
|
public
|
#
addPersonalPublicKey( mixed $key )
Add the personal public key to the prefs.
Add the personal public key to the prefs.
Parameters
- $key
- The public key to add (either string or array).
|
public
|
#
addPersonalPrivateKey( mixed $key )
Add the personal private key to the prefs.
Add the personal private key to the prefs.
Parameters
- $key
- The private key to add (either string or array).
|
public
|
#
addAdditionalCert( mixed $key )
Add the list of additional certs to the prefs.
Add the list of additional certs to the prefs.
Parameters
- $key
- The private key to add (either string or array).
|
public
string
|
#
getPersonalPublicKey( )
Get the personal public key from the prefs.
Get the personal public key from the prefs.
Returns
string The personal S/MIME public key.
|
public
string
|
#
getPersonalPrivateKey( )
Get the personal private key from the prefs.
Get the personal private key from the prefs.
Returns
string The personal S/MIME private key.
|
public
string
|
#
getAdditionalCert( )
Get any additional certificates from the prefs.
Get any additional certificates from the prefs.
Returns
string Additional signing certs for inclusion.
|
public
|
#
deletePersonalKeys( )
Deletes the specified personal keys from the prefs.
Deletes the specified personal keys from the prefs.
|
public
|
#
addPublicKey( string $cert )
Add a public key to an address book.
Add a public key to an address book.
Parameters
- $cert
- A public certificate to add.
Throws
Horde_Exception
|
public
array
|
#
publicKeyInfo( string $cert )
Get information about a public certificate.
Get information about a public certificate.
Parameters
- $cert
- The public certificate.
Returns
array Two element array: the name and e-mail for the cert.
Throws
Horde_Crypt_Exception
|
public
string
|
#
getPublicKey( string $address )
Retrieves a public key by e-mail.
The key will be retrieved from a user's address book(s).
Retrieves a public key by e-mail.
The key will be retrieved from a user's address book(s).
Parameters
- $address
- The e-mail address to search for.
Returns
string The S/MIME public key requested.
Throws
Horde_Exception
|
public
array
|
#
listPublicKeys( )
Retrieves all public keys from a user's address book(s).
Retrieves all public keys from a user's address book(s).
Returns
array All S/MIME public keys available.
Throws
Horde_Crypt_Exception
|
public
|
#
deletePublicKey( string $email )
Deletes a public key from a user's address book(s) by e-mail.
Deletes a public key from a user's address book(s) by e-mail.
Parameters
- $email
- The e-mail address to delete.
Throws
Horde_Crypt_Exception
|
public
stdClass
|
#
verifySignature( string $text )
Verifies a signed message with a given public key.
Verifies a signed message with a given public key.
Parameters
- $text
- The text to verify.
Returns
stdClass See Horde_Crypt_Smime::verify().
Throws
Horde_Crypt_Exception
|
public
string
|
#
decryptMessage( string $text )
Decrypt a message with user's public/private keypair.
Decrypt a message with user's public/private keypair.
Parameters
- $text
- The text to decrypt.
Returns
string See Horde_Crypt_Smime::decrypt().
Throws
Horde_Crypt_Exception
|
public
mixed
|
#
getPassphrase( )
Gets the user's passphrase from the session cache.
Gets the user's passphrase from the session cache.
Returns
mixed The passphrase, if set. Returns false if the passphrase
has not been loaded yet. Returns null if no passphrase
is needed.
|
public
boolean
|
#
storePassphrase( string $passphrase )
Store's the user's passphrase in the session cache.
Store's the user's passphrase in the session cache.
Parameters
- $passphrase
- The user's passphrase.
Returns
boolean Returns true if correct passphrase, false if incorrect.
|
public
|
#
unsetPassphrase( )
Clear the passphrase from the session cache.
Clear the passphrase from the session cache.
|
public
string
|
#
savePublicKeyURL( string $mailbox, integer $uid, string $id )
Generates the javascript code for saving public keys.
Generates the javascript code for saving public keys.
Parameters
- $mailbox
- The mailbox of the message.
- $uid
- The UID of the message.
- $id
- The MIME ID of the message.
Returns
string The URL for saving public keys.
|
public
MIME_Part
|
#
IMPencryptMIMEPart( MIME_Part $mime_part, mixed $to_address )
Encrypt a MIME_Part using S/MIME using IMP defaults.
Encrypt a MIME_Part using S/MIME using IMP defaults.
Parameters
- $mime_part
- The MIME_Part object to encrypt.
- $to_address
- <p>The e-mail address of the key to use for
encryption.</p>
Returns
MIME_Part See Horde_Crypt_Smime::encryptMIMEPart().
Throws
Horde_Crypt_Exception
|
public
MIME_Part
|
#
IMPsignMIMEPart( MIME_Part $mime_part )
Sign a MIME_Part using S/MIME using IMP defaults.
Sign a MIME_Part using S/MIME using IMP defaults.
Parameters
- $mime_part
- The MIME_Part object to sign.
Returns
MIME_Part See Horde_Crypt_Smime::signMIMEPart().
Throws
Horde_Crypt_Exception
|
public
MIME_Part
|
#
IMPsignAndEncryptMIMEPart( MIME_Part $mime_part, string $to_address )
Sign and encrypt a MIME_Part using S/MIME using IMP defaults.
Sign and encrypt a MIME_Part using S/MIME using IMP defaults.
Parameters
- $mime_part
- The MIME_Part object to sign and encrypt.
- $to_address
- <p>The e-mail address of the key to use for
encryption.</p>
Returns
MIME_Part See Horde_Crypt_Smime::signAndencryptMIMEPart().
Throws
Horde_Crypt_Exception
|
public
|
#
addFromPKCS12( string $pkcs12, string $password, string $pkpass = null )
Store the public/private/additional certificates in the preferences
from a given PKCS 12 file.
Store the public/private/additional certificates in the preferences
from a given PKCS 12 file.
Parameters
- $pkcs12
- The PKCS 12 data.
- $password
- The password of the PKCS 12 file.
- $pkpass
- The password to use to encrypt the private key.
Throws
Horde_Crypt_Exception
|
public
|
#
printCertInfo( string $key = '' )
Print certificate information.
Print certificate information.
Parameters
- $key
- $cert The S/MIME certificate.
|
public
|
#
textWindowOutput( string $name, string $msg, string $html = false )
Output text in a window.
Parameters
- $name
- The window name.
- $msg
- The text contents.
- $html
- $msg is HTML format?
|
public
|
#
importKeyDialog( string $target, string $reload )
Generate import key dialog.
Generate import key dialog.
Parameters
- $target
- Action ID for the UI screen.
- $reload
- The reload cache value.
|
public
string
|
#
getImportKey( string $key )
Attempt to import a key from form/uploaded data.
Attempt to import a key from form/uploaded data.
Parameters
Returns
string The key contents.
Throws
Horde_Browser_Exception
|
public
|
#
reloadWindow( string $reload )
Reload the window.
Parameters
- $reload
- The reload cache value.
|