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
|
#
generatePersonalKeys( string $name, string $email, string $passphrase, string $comment = '', string $keylength = 1024 )
Generate the personal Public/Private keypair and store in prefs.
Generate the personal Public/Private keypair and store in prefs.
Parameters
- $name
- $realname See Horde_Crypt_Pgp::
- $email
- See Horde_Crypt_Pgp::
- $passphrase
- See Horde_Crypt_Pgp::
- $comment
- See Horde_Crypt_Pgp::
- $keylength
- See Horde_Crypt_Pgp::
Throws
Horde_Crypt_Exception
|
public
|
#
addPersonalPublicKey( mixed $public_key )
Add the personal public key to the prefs.
Add the personal public key to the prefs.
Parameters
- $public_key
- <p>The public key to add (either string or
array).</p>
|
public
|
#
addPersonalPrivateKey( mixed $private_key )
Add the personal private key to the prefs.
Add the personal private key to the prefs.
Parameters
- $private_key
- <p>The private key to add (either string or
array).</p>
|
public
string
|
#
getPersonalPublicKey( )
Get the personal public key from the prefs.
Get the personal public key from the prefs.
Returns
string The personal PGP 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 PGP private key.
|
public
|
#
deletePersonalKeys( )
Deletes the specified personal keys from the prefs.
Deletes the specified personal keys from the prefs.
|
public
array
|
#
addPublicKey( string $public_key )
Add a public key to an address book.
Add a public key to an address book.
Parameters
- $public_key
- An PGP public key.
Returns
array See Horde_Crypt_Pgp::pgpPacketInformation()
Throws
Horde_Crypt_Exception
Horde_Exception
|
public
string
|
#
getPublicKey( string $address, array $options = array() )
Retrieves a public key by e-mail.
Retrieves a public key by e-mail.
First, the key will be attempted to be retrieved from a user's address
book(s).
Second, if unsuccessful, the key is attempted to be retrieved via a
public PGP keyserver.
Parameters
- $address
- The e-mail address to search by.
- $options
- Additional options:
<pre><span class="php-quote">'keyid'</span> - (string) The <span class="php-keyword2">key</span> ID of the user<span class="php-quote">'s key.
DEFAULT: key ID not used
'</span>nocache<span class="php-quote">' - (boolean) Don'</span>t retrieve from cache?
<span class="php-keyword1">DEFAULT</span>: <span class="php-keyword1">false</span>
<span class="php-quote">'noserver'</span> - (boolean) Whether to check the <span class="php-keyword1">public</span> <span class="php-keyword2">key</span> servers <span class="php-keyword1">for</span> the
<span class="php-keyword2">key</span>.
<span class="php-keyword1">DEFAULT</span>: <span class="php-keyword1">false</span></pre>
Returns
string The PGP public key requested.
Throws
Horde_Crypt_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 PGP 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
string
|
#
getFromPublicKeyserver( string $keyid, string $address = null )
Get a public key via a public PGP keyserver.
Get a public key via a public PGP keyserver.
Parameters
- $keyid
- The key ID of the requested key.
- $address
- The email address of the requested key.
Returns
string See Horde_Crypt_Pgp::getPublicKeyserver()
Throws
Horde_Crypt_Exception
|
public
string
|
#
sendToPublicKeyserver( string $pubkey )
Send a public key to a public PGP keyserver.
Send a public key to a public PGP keyserver.
Parameters
- $pubkey
- The PGP public key.
Returns
string See Horde_Crypt_Pgp::putPublicKeyserver()
Throws
Horde_Crypt_Exception
|
public
stdClass
|
#
verifySignature( string $text, string $address, string $signature = '', string $charset = null )
Verifies a signed message with a given public key.
Verifies a signed message with a given public key.
Parameters
- $text
- The text to verify.
- $address
- E-mail address of public key.
- $signature
- A PGP signature block.
- $charset
- Charset to use.
Returns
stdClass See Horde_Crypt_Pgp::decrypt().
Throws
Horde_Crypt_Exception
|
public
stdClass
|
#
decryptMessage( string $text, string $type, boolean $passphrase = null )
Decrypt a message with user's public/private keypair or a passphrase.
Decrypt a message with user's public/private keypair or a passphrase.
Parameters
- $text
- The text to decrypt.
- $type
- <p>Either 'literal', 'personal', or
'symmetric'.</p>
- $passphrase
- <p>If $type is 'personal' or 'symmetrical',
the passphrase to use.</p>
Returns
stdClass See Horde_Crypt_Pgp::decrypt().
Throws
Horde_Crypt_Exception
|
public
mixed
|
#
getPassphrase( integer $type, string $id = null )
Gets a passphrase from the session cache.
Gets a passphrase from the session cache.
Parameters
- $type
- <p>The type of passphrase. Either 'personal' or
'symmetric'.</p>
- $id
- <p>If $type is 'symmetric', the ID of the stored
passphrase.</p>
Returns
mixed The passphrase, if set, or null.
|
public
boolean
|
#
storePassphrase( integer $type, string $passphrase, string $id = null )
Store's the user's passphrase in the session cache.
Store's the user's passphrase in the session cache.
Parameters
- $type
- <p>The type of passphrase. Either 'personal' or
'symmetric'.</p>
- $passphrase
- The user's passphrase.
- $id
- <p>If $type is 'symmetric', the ID of the
stored passphrase.</p>
Returns
boolean Returns true if correct passphrase, false if incorrect.
|
public
|
#
unsetPassphrase( integer $type, string $id = null )
Clear the passphrase from the session cache.
Clear the passphrase from the session cache.
Parameters
- $type
- <p>The type of passphrase. Either 'personal' or
'symmetric'.</p>
- $id
- <p>If $type is 'symmetric', the ID of the
stored passphrase. Else, all passphrases
are deleted.</p>
|
public
string
|
#
getSymmetricId( string $mailbox, integer $uid, string $id )
Generates a cache ID for symmetric message data.
Generates a cache ID for symmetric message data.
Parameters
- $mailbox
- The mailbox of the message.
- $uid
- The UID of the message.
- $id
- The MIME ID of the message.
Returns
string A unique symmetric cache ID.
|
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
Horde_Mime_Part
|
#
impSignMimePart( Horde_Mime_Part $mime_part )
Sign a Horde_Mime_Part using PGP using IMP default parameters.
Sign a Horde_Mime_Part using PGP using IMP default parameters.
Parameters
- $mime_part
- The object to sign.
Returns
Horde_Mime_Part See Horde_Crypt_Pgp::signMIMEPart().
Throws
Horde_Crypt_Exception
|
public
Horde_Mime_Part
|
#
impEncryptMimePart( Horde_Mime_Part $mime_part, array $addresses, string $symmetric = null )
Encrypt a Horde_Mime_Part using PGP using IMP default parameters.
Encrypt a Horde_Mime_Part using PGP using IMP default parameters.
Parameters
- $mime_part
- The object to encrypt.
- $addresses
- <p>The e-mail address of the keys to
use for encryption.</p>
- $symmetric
- <p>If true, the symmetric password to
use for encrypting. If null, uses
the personal key.</p>
Returns
Horde_Mime_Part See Horde_Crypt_Pgp::encryptMimePart().
Throws
Horde_Crypt_Exception
|
public
Horde_Mime_Part
|
#
impSignAndEncryptMimePart( Horde_Mime_Part $mime_part, array $addresses, string $symmetric = null )
Sign and Encrypt a Horde_Mime_Part using PGP using IMP default
parameters.
Sign and Encrypt a Horde_Mime_Part using PGP using IMP default
parameters.
Parameters
- $mime_part
- The object to sign and encrypt.
- $addresses
- <p>The e-mail address of the keys to
use for encryption.</p>
- $symmetric
- <p>If true, the symmetric password to
use for encrypting. If null, uses
the personal key.</p>
Returns
Horde_Mime_Part See Horde_Crypt_Pgp::signAndencryptMimePart().
Throws
Horde_Crypt_Exception
|
public
Horde_Mime_Part
|
#
publicKeyMimePart( )
Generate a Horde_Mime_Part object, in accordance with RFC 2015/3156,
that contains the user's public key.
Generate a Horde_Mime_Part object, in accordance with RFC 2015/3156,
that contains the user's public key.
Returns
Horde_Mime_Part See Horde_Crypt_Pgp::publicKeyMimePart().
|
public
|
#
printKeyInfo( string $key = '' )
Print PGP Key information.
Print PGP Key information.
Parameters
|
public
|
#
textWindowOutput( string $name, string $msg )
Output text in a window.
Parameters
- $name
- The window name.
- $msg
- The text contents.
|
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.
|