Property | Type | Description | |
---|---|---|---|
$_armor | |||
$_backends | array | List of initialized backends. |
Method | Description | |
---|---|---|
__construct ( array $params = [] ) | Constructor. | |
decrypt ( string $text, array $params = [] ) : object | Decrypts text using PGP. | |
encrypt ( string $text, array $params = [] ) : string | Encrypts text using PGP. | |
encryptMIMEPart ( Horde_Mime_Part $mime_part, array $params = [] ) : mixed | Encrypts a MIME part using PGP. | |
encryptedSymmetrically ( string $text ) : boolean | Returns whether a text has been encrypted symmetrically. | |
generateKey ( string $realname, string $email, string $passphrase, string $comment = '', integer $keylength = 1024, integer $expire = null, string $key_type = 'RSA', string $subkey_type = 'RSA' ) : array | Generates a personal Public/Private keypair combination. | |
generateRevocation ( $key, $email, $passphrase ) | ||
getFingerprintsFromKey ( string $pgpdata ) : array | Get the fingerprints from a key block. | |
getKeyID ( string $address, string $server = self::KEYSERVER_PUBLIC, float $timeout = self::KEYSERVER_TIMEOUT ) : string | Returns the first matching key ID for an email address from a public keyserver. | |
getKeyIDString ( $keyid ) | TODO | |
getPublicKeyFromPrivateKey ( string $data ) : string | Generates a public key from a private key. | |
getPublicKeyserver ( $keyid, $server = self::KEYSERVER_PUBLIC, $timeout = self::KEYSERVER_TIMEOUT, $address = null ) | ||
getSignersKeyID ( string $text ) : string | Returns the key ID of the key used to sign a block of PGP data. | |
parsePGPData ( $text ) | ||
pgpPacketInformation ( string $pgpdata ) : array | Returns information on a PGP data block. | |
pgpPacketInformationMultiple ( string $pgpdata ) : array | Returns all 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. | |
pgpPacketSignatureByUidIndex ( string $pgpdata, string $uid_idx ) : array | Returns information on a PGP signature embedded in PGP data. Similar to pgpPacketSignature(), but returns information by unique User ID Index (format id{n} where n is an integer of 1 or greater). | |
pgpPrettyKey ( string $pgpdata ) : string | Returns human readable information on a PGP key. | |
publicKeyMIMEPart ( string $key ) : Horde_Mime_Part | Generates a Horde_Mime_Part object, in accordance with RFC 3156, that contains a public key. | |
putPublicKeyserver ( string $pubkey, string $server = self::KEYSERVER_PUBLIC, float $timeout = self::KEYSERVER_TIMEOUT ) | Sends a PGP public key to a public keyserver. | |
signAndEncryptMIMEPart ( Horde_Mime_Part $mime_part, array $sign_params = [], array $encrypt_params = [] ) : mixed | Signs and encrypts a MIME part using PGP. | |
signMIMEPart ( Horde_Mime_Part $mime_part, array $params = [] ) : mixed | Signs a MIME part using PGP. | |
verifyPassphrase ( string $public_key, string $private_key, string $passphrase ) : boolean | Verify a passphrase for a given public/private keypair. |
Method | Description | |
---|---|---|
_getKeyserverOb ( $server ) | ||
_initDrivers ( ) | Initialize the backend driver list. | |
_pgpPacketSignature ( array $data, array $out ) : array | Adds some data to the pgpPacketSignature*() function array. |
public __construct ( array $params = [] ) | ||
$params | array | Configuration parameters: - backends: (array) The explicit list of backend drivers (Horde_Crypt_Pgp_Backend objects) to use. - program: (string) The path to the GnuPG binary. - temp: (string) Location of temporary directory. |
public decrypt ( string $text, array $params = [] ) : object | ||
$text | string | The text to be PGP decrypted. |
$params | array | The parameters needed for decryption. See the individual _decrypt*() functions for the parameter requirements. |
return | object | An object with the following properties: - message: (string) The signature result text. - result: (boolean) The result of the signature test. |
public encryptMIMEPart ( Horde_Mime_Part $mime_part, array $params = [] ) : mixed | ||
$mime_part | Horde_Mime_Part | The object to encrypt. |
$params | array | The parameters required for encryption ({@see \_encryptMessage()}). |
return | mixed | A Horde_Mime_Part object that is encrypted according to RFC 3156. |
public encryptedSymmetrically ( string $text ) : boolean | ||
$text | string | The PGP encrypted text. |
return | boolean | True if the text is symmetrically encrypted. |
public generateKey ( string $realname, string $email, string $passphrase, string $comment = '', integer $keylength = 1024, integer $expire = null, string $key_type = 'RSA', string $subkey_type = 'RSA' ) : array | ||
$realname | string | The name to use for the key. |
string | The email to use for the key. | |
$passphrase | string | The passphrase to use for the key. |
$comment | string | The comment to use for the key. |
$keylength | integer | The keylength to use for the key. |
$expire | integer | The expiration date (UNIX timestamp). No expiration if empty. |
$key_type | string | Key type (@since 2.2.0). |
$subkey_type | string | Subkey type (@since 2.2.0). |
return | array | An array consisting of the following keys/values: - private: (string) Private key. - public: (string) Public key. |
public getFingerprintsFromKey ( string $pgpdata ) : array | ||
$pgpdata | string | The PGP data block. |
return | array | The fingerprints in $pgpdata indexed by key id. |
public getPublicKeyFromPrivateKey ( string $data ) : string | ||
$data | string | Armor text of private key. |
return | string | Armor text of public key, or null if it could not be generated. |
public getPublicKeyserver ( $keyid, $server = self::KEYSERVER_PUBLIC, $timeout = self::KEYSERVER_TIMEOUT, $address = null ) |
public getSignersKeyID ( string $text ) : string | ||
$text | string | The PGP signed text block. |
return | string | The key ID of the key used to sign $text, or null if not found. |
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 pgpPacketInformationMultiple ( string $pgpdata ) : array | ||
$pgpdata | string | The PGP data block. |
return | array | An array with information on the PGP data block. The array contains one or more entries as returned from pgpPacketInformation(). |
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 pgpPrettyKey ( string $pgpdata ) : string | ||
$pgpdata | string | The PGP data block. |
return | string | Tabular information on the PGP key. |
public publicKeyMIMEPart ( string $key ) : Horde_Mime_Part | ||
$key | string | The public key. |
return | Horde_Mime_Part | An object that contains the public key. |
public signAndEncryptMIMEPart ( Horde_Mime_Part $mime_part, array $sign_params = [], array $encrypt_params = [] ) : mixed | ||
$mime_part | Horde_Mime_Part | The object to sign and encrypt. |
$sign_params | array | The parameters required for signing ({@see \_encryptSignature()}). |
$encrypt_params | array | The parameters required for encryption ({@see \_encryptMessage()}). |
return | mixed | A Horde_Mime_Part object that is signed and encrypted according to RFC 3156. |
public signMIMEPart ( Horde_Mime_Part $mime_part, array $params = [] ) : mixed | ||
$mime_part | Horde_Mime_Part | The object to sign. |
$params | array | The parameters required for signing. ({@see \_encryptSignature()}). |
return | mixed | A Horde_Mime_Part object that is signed according to RFC 3156. |
public verifyPassphrase ( string $public_key, string $private_key, string $passphrase ) : boolean | ||
$public_key | string | The user's PGP public key. |
$private_key | string | The user's PGP private key. |
$passphrase | string | The user's passphrase. |
return | boolean | Returns true on valid passphrase, false on invalid passphrase. |