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, integer $expire = null )
Generate the personal Public/Private keypair and store in prefs.
Generate the personal Public/Private keypair and store in prefs.
Parameters
- $name
- See Horde_Crypt_Pgp::.
- $email
- See Horde_Crypt_Pgp::.
- $passphrase
- See Horde_Crypt_Pgp::.
- $comment
- See Horde_Crypt_Pgp::.
- $keylength
- See Horde_Crypt_Pgp::.
- $expire
- 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
- <p>Additional options:
- keyid: (string) The key ID of the user's key.
DEFAULT: key ID not used
- nocache: (boolean) Don't retrieve from cache?
DEFAULT: false
- noserver: (boolean) Whether to check the public key servers for the
key.
DEFAULT: false</p>
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
|
#
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.
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, array $opts = array() )
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
- Either 'literal', 'personal', or 'symmetric'.
- $opts
- <p>Additional options:
- passphrase: (boolean) If $type is 'personal' or 'symmetrical', the
passphrase to use.
- sender: (string) The sender of the message (used to check signature
if message is both encrypted & signed).</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
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, Horde_Mail_Rfc822_List $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, Horde_Mail_Rfc822_List $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
- <p>The object to sign and
encrypt.</p>
- $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( mixed $key = null )
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
array
|
#
getKeys( string $data )
Extracts public/private keys from armor data.
Extracts public/private keys from armor data.
Parameters
Returns
array Array with these keys:
- public: (array) Array of public keys.
- private: (array) Array of private keys.
|