Constructor
IMP_PGP
IMP_PGP
()
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).
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).
Add a public key to an address book.
array
addPublicKey
(string $public_key)
-
string
$public_key: An PGP public key.
Decrypt a message with user's public/private keypair or a passphrase.
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.
Deletes the specified personal keys from the prefs.
void
deletePersonalKeys
()
Deletes a public key from a user's address book(s) by e-mail.
PEAR_Error
deletePublicKey
(string $email)
-
string
$email: The e-mail address to delete.
Generate the personal Public/Private keypair and store in prefs.
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
Get a public key via a public PGP keyserver.
string
getFromPublicKeyserver
(string $fingerprint, [string $address = null])
-
string
$fingerprint: The fingerprint of the requested key.
-
string
$address: The email address of the requested key.
Print out the link for the javascript PGP popup.
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.
Gets the user's passphrase from the session cache.
string
getPassphrase
()
Get the personal private key from the prefs.
string
getPersonalPrivateKey
()
Get the personal public key from the prefs.
string
getPersonalPublicKey
()
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.
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.
Returns the signed data only for a plaintext signed MIME_Part.
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
Gets the user's passphrase for symmetric encryption from the session cache.
string
getSymmetricPassphrase
()
Encrypt a MIME_Part using PGP using IMP default parameters.
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.
Sign and Encrypt a MIME_Part using PGP using IMP default parameters.
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.
Sign a MIME_Part using PGP using IMP default parameters.
MIME_Part
IMPsignMIMEPart
(MIME_Part $mime_part)
-
MIME_Part
$mime_part: The MIME_Part object to sign.
Retrieves all public keys from a user's address book(s).
array
listPublicKeys
()
Parse a message into its PGP components.
array
&parseMessage
(string $text)
-
string
$text: See Horde_Crypt_pgp::parsePGPData()
Renders a text message with PGP components.
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.
Generate a MIME_Part object, in accordance with RFC 2015/3156, that contains the user's public key.
MIME_Part
publicKeyMIMEPart
()
Generates the javascript code 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.
Send a public key to a public PGP keyserver.
string
sendToPublicKeyserver
(string $pubkey)
-
string
$pubkey: The PGP public key.
Store's the user's passphrase in the session cache.
boolean
storePassphrase
(string $passphrase)
-
string
$passphrase: The user's passphrase.
Store's the user's passphrase for symmetric encryption in the session cache.
boolean
storeSymmetricPassphrase
(string $passphrase)
-
string
$passphrase: The user's passphrase.
Clear the passphrase from the session cache.
void
unsetPassphrase
()
Clear the passphrase for symmetric encryption from the session cache.
void
unsetSymmetricPassphrase
()
Verifies a signed message with a given public key.
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.