Property | Type | Description | |
---|---|---|---|
$_pgp | Horde_Crypt_Pgp | Pgp object. |
Method | Description | |
---|---|---|
__construct ( Horde_Crypt_Pgp $pgp ) | Constructor. | |
addPersonalPrivateKey ( mixed $private_key ) | Add the personal private key to the prefs. | |
addPersonalPublicKey ( mixed $public_key ) | Add the personal public key to the prefs. | |
addPublicKey ( string $public_key ) : array | Add a public key to an address book. | |
decryptMessage ( string $text, string $type, array $opts = [] ) : stdClass | Decrypt a message with user's public/private keypair or a passphrase. | |
deletePersonalKeys ( ) | Deletes the specified personal keys from the prefs. | |
deletePublicKey ( string $email ) | Deletes a public key from a user's address book(s) by e-mail. | |
enabled ( ) : boolean | Return whether PGP support is current enabled in IMP. | |
encryptList ( ) : array | Return the list of available encryption options for composing. | |
encryptMimePart ( Horde_Mime_Part $mime_part, Horde_Mail_Rfc822_List $addresses, string $symmetric = null ) : Horde_Mime_Part | Encrypt a Horde_Mime_Part using PGP using IMP default parameters. | |
encryptedSymmetrically ( string $text ) : boolean | Returns whether a text has been encrypted symmetrically. | |
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. | |
getKeyIdString ( $keyid ) | ||
getKeys ( string $data ) : array | Extracts public/private keys from armor data. | |
getPassphrase ( integer $type, string $id = null ) : mixed | Gets a passphrase from the session cache. | |
getPersonalPrivateKey ( ) : string | Get the personal private key from the prefs. | |
getPersonalPublicKey ( ) : string | Get the personal public key from the prefs. | |
getPublicKey ( string $address, array $options = [] ) : string | Retrieves a public key by e-mail. | |
getSymmetricId ( string $mailbox, integer $uid, string $id ) : string | Generates a cache ID for symmetric message data. | |
listPublicKeys ( ) : array | Retrieves all public keys from a user's address book(s). | |
pgpPacketInformation ( string $pgpdata ) : array | Returns information on a PGP data block. | |
pgpPacketSignature ( string $pgpdata, string $email ) : array | Returns only information on the first ID that matches the email address input. | |
prettyKey ( string $pgpdata ) : string | Returns human readable information on a PGP key. | |
publicKeyMimePart ( ) : Horde_Mime_Part | Generate a Horde_Mime_Part object, in accordance with RFC 2015/3156, that contains the user's public key. | |
sendToPublicKeyserver ( string $pubkey ) | Send a public key to a public PGP keyserver. | |
signAndEncryptMimePart ( Horde_Mime_Part $mime_part, Horde_Mail_Rfc822_List $addresses, string $symmetric = null ) : Horde_Mime_Part | Sign and Encrypt a Horde_Mime_Part using PGP using IMP default parameters. | |
signMimePart ( Horde_Mime_Part $mime_part ) : Horde_Mime_Part | Sign a Horde_Mime_Part using PGP using IMP default parameters. | |
storePassphrase ( integer $type, string $passphrase, string $id = null ) : boolean | Store's the user's passphrase in the session cache. | |
unsetPassphrase ( integer $type, string $id = null ) | Clear the passphrase from the session cache. | |
verifySignature ( string $text, string $address, string $signature = '', string $charset = null ) : stdClass | Verifies a signed message with a given public key. |
Method | Description | |
---|---|---|
_encryptParameters ( Horde_Mail_Rfc822_List $addresses, string $symmetric ) : array | Provide the list of parameters needed for encrypting a message. | |
_keyserverList ( ) : array | Return list of keyserver objects. | |
_signParameters ( ) : array | Provide the list of parameters needed for signing a message. |
public __construct ( Horde_Crypt_Pgp $pgp ) | ||
$pgp | Horde_Crypt_Pgp | PGP object. |
protected _encryptParameters ( Horde_Mail_Rfc822_List $addresses, string $symmetric ) : array | ||
$addresses | Horde_Mail_Rfc822_List | The e-mail address of the keys to use for encryption. |
$symmetric | string | If true, the symmetric password to use for encrypting. If null, uses the personal key. |
return | array | The list of parameters needed by encrypt(). |
protected _keyserverList ( ) : array | ||
return | array | List of Horde_Crypt_Pgp_Keyserver objects. |
protected _signParameters ( ) : array | ||
return | array | The list of parameters needed by encrypt(). |
public addPersonalPrivateKey ( mixed $private_key ) | ||
$private_key | mixed | The private key to add (either string or array). |
public addPersonalPublicKey ( mixed $public_key ) | ||
$public_key | mixed | The public key to add (either string or array). |
public addPublicKey ( string $public_key ) : array | ||
$public_key | string | An PGP public key. |
return | array | See Horde_Crypt_Pgp::pgpPacketInformationMultiple() |
public decryptMessage ( string $text, string $type, array $opts = [] ) : stdClass | ||
$text | string | The text to decrypt. |
$type | string | Either 'literal', 'personal', or 'symmetric'. |
$opts | array | 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). |
return | stdClass | See Horde_Crypt_Pgp::decrypt(). |
public deletePersonalKeys ( ) |
public deletePublicKey ( string $email ) | ||
string | The e-mail address to delete. |
public encryptList ( ) : array | ||
return | array | Keys are encryption type constants, values are gettext strings describing the encryption type. |
public encryptMimePart ( Horde_Mime_Part $mime_part, Horde_Mail_Rfc822_List $addresses, string $symmetric = null ) : Horde_Mime_Part | ||
$mime_part | Horde_Mime_Part | The object to encrypt. |
$addresses | Horde_Mail_Rfc822_List | The e-mail address of the keys to use for encryption. |
$symmetric | string | If true, the symmetric password to use for encrypting. If null, uses the personal key. |
return | Horde_Mime_Part | See Horde_Crypt_Pgp::encryptMimePart(). |
public encryptedSymmetrically ( string $text ) : boolean | ||
$text | string | The PGP encrypted text. |
return | boolean | True if the text is symmetrically encrypted. |
public generatePersonalKeys ( string $name, string $email, string $passphrase, string $comment = '', string $keylength = 1024, integer $expire = null ) | ||
$name | string | See Horde_Crypt_Pgp::. |
string | See Horde_Crypt_Pgp::. | |
$passphrase | string | See Horde_Crypt_Pgp::. |
$comment | string | See Horde_Crypt_Pgp::. |
$keylength | string | See Horde_Crypt_Pgp::. |
$expire | integer | See Horde_Crypt_Pgp::. |
public getPersonalPrivateKey ( ) : string | ||
return | string | The personal PGP private key. |
public getPersonalPublicKey ( ) : string | ||
return | string | The personal PGP public key. |
public getPublicKey ( string $address, array $options = [] ) : string | ||
$address | string | The e-mail address to search by. |
$options | array | 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 - nohooks: (boolean) Don't trigger hook when retrieving public key? DEFAULT: false - noserver: (boolean) Whether to check the public key servers for the key. DEFAULT: false |
return | string | The PGP public key requested. |
public listPublicKeys ( ) : array | ||
return | array | All PGP public keys available. |
public pgpPacketInformation ( string $pgpdata ) : array | ||
$pgpdata | string | The PGP data block. |
return | array | An array with information on the PGP data block. If an
element is not present in the data block, it will
likewise not be set in the array.
Array Format: ------------- [public_key]/[secret_key] => Array ( [created] => Key creation - UNIX timestamp [expires] => Key expiration - UNIX timestamp (0 = never expires) [size] => Size of the key in bits ) [keyid] => Key ID of the PGP data (if available) 16-bit hex value [signature] => Array ( [id{n}/'_SIGNATURE'] => Array ( [name] => Full Name [comment] => Comment [email] => E-mail Address [keyid] => 16-bit hex value [created] => Signature creation - UNIX timestamp [expires] => Signature expiration - UNIX timestamp [micalg] => The hash used to create the signature [sig_{hex}] => Array [details of a sig verifying the ID] ( [created] => Signature creation - UNIX timestamp [expires] => Signature expiration - UNIX timestamp [keyid] => 16-bit hex value [micalg] => The hash used to create the signature ) ) )Each user ID will be stored in the array 'signature' and have data associated with it, including an array for information on each signature that has signed that UID. Signatures not associated with a UID (e.g. revocation signatures and sub keys) will be stored under the special keyword '_SIGNATURE'. |
public pgpPacketSignature ( string $pgpdata, string $email ) : array | ||
$pgpdata | string | The PGP data block. |
string | An e-mail address. | |
return | array | An array with information on the PGP data block. If an element is not present in the data block, it will likewise not be set in the array. Array elements: - comment: Comment - created: Signature creation (UNIX timestamp) - email: E-mail Address - key_created: Key creation (UNIX timestamp) - key_expires: Key expiration (UNIX timestamp; 0 = never expires) - key_size: Size of the key in bits - key_type: The key type (public_key or secret_key) - keyid: 16-bit hex value - micalg: The hash used to create the signature - name: Full Name |
public publicKeyMimePart ( ) : Horde_Mime_Part | ||
return | Horde_Mime_Part | See Horde_Crypt_Pgp::publicKeyMimePart(). |
public sendToPublicKeyserver ( string $pubkey ) | ||
$pubkey | string | The PGP public key. |
public signAndEncryptMimePart ( Horde_Mime_Part $mime_part, Horde_Mail_Rfc822_List $addresses, string $symmetric = null ) : Horde_Mime_Part | ||
$mime_part | Horde_Mime_Part | The object to sign and encrypt. |
$addresses | Horde_Mail_Rfc822_List | The e-mail address of the keys to use for encryption. |
$symmetric | string | If true, the symmetric password to use for encrypting. If null, uses the personal key. |
return | Horde_Mime_Part | See Horde_Crypt_Pgp::signAndencryptMimePart(). |
public signMimePart ( Horde_Mime_Part $mime_part ) : Horde_Mime_Part | ||
$mime_part | Horde_Mime_Part | The object to sign. |
return | Horde_Mime_Part | See Horde_Crypt_Pgp::signMIMEPart(). |
public storePassphrase ( integer $type, string $passphrase, string $id = null ) : boolean | ||
$type | integer | The type of passphrase. Either 'personal' or 'symmetric'. |
$passphrase | string | The user's passphrase. |
$id | string | If $type is 'symmetric', the ID of the stored passphrase. |
return | boolean | Returns true if correct passphrase, false if incorrect. |
public unsetPassphrase ( integer $type, string $id = null ) | ||
$type | integer | The type of passphrase. Either 'personal' or 'symmetric'. |
$id | string | If $type is 'symmetric', the ID of the stored passphrase. Else, all passphrases are deleted. |
public verifySignature ( string $text, string $address, string $signature = '', string $charset = null ) : stdClass | ||
$text | string | The text to verify. |
$address | string | E-mail address of public key. |
$signature | string | A PGP signature block. |
$charset | string | Charset to use. |
return | stdClass | See Horde_Crypt_Pgp::decrypt(). |