ARMOR_MESSAGE
ARMOR_MESSAGE
A framework for Horde applications to interact with the GNU Privacy Guard program ("GnuPG"). GnuPG implements the OpenPGP standard (RFC 4880).
GnuPG Website: (http://www.gnupg.org/)
None found |
factory(string $driver, array $params = array()) : \Horde_Crypt
Attempts to return a concrete Horde_Crypt instance based on $driver.
string | $driver | Either a driver name, or the full class name to use (class must extend Horde_Crypt). |
array | $params | A hash containing any additional configuration or parameters a subclass might need. |
The newly created concrete instance.
None found |
__construct(array $params = array())
Constructor.
array | $params | Configuration parameters:
|
None found |
encrypt(string $text, array $params = array()) : string
Encrypts text using PGP.
This method should be provided by all classes that extend Horde_Crypt.
string | $text | The text to be PGP encrypted. |
array | $params | The parameters needed for encryption. See the individual _encrypt*() functions for the parameter requirements. |
The encrypted message.
None found |
decrypt(string $text, array $params = array()) : object
Decrypts text using PGP.
This method should be provided by all classes that extend Horde_Crypt.
string | $text | The text to be PGP decrypted. |
array | $params | The parameters needed for decryption. See the individual _decrypt*() functions for the parameter requirements. |
An object with the following properties:
None found |
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.
string | $realname | The name to use for the key. |
string | The email to use for the key. |
|
string | $passphrase | The passphrase to use for the key. |
string | $comment | The comment to use for the key. |
integer | $keylength | The keylength to use for the key. |
integer | $expire | The expiration date (UNIX timestamp). No expiration if empty. |
string | $key_type | Key type (@since 2.2.0). |
string | $subkey_type | Subkey type (@since 2.2.0). |
An array consisting of the following keys/values:
None found |
pgpPacketInformation(string $pgpdata) : array
Returns information on a PGP data block.
If the data block contains multiple keys, only the first is returned. To return all keys of this block, use pgpPacketInformationMultiple() instead.
string | $pgpdata | The PGP data block. |
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'.
None found |
pgpPacketInformationMultiple(string $pgpdata) : array
Returns all information on a PGP data block.
string | $pgpdata | The PGP data block. |
An array with information on the PGP data block. The array contains one or more entries as returned from pgpPacketInformation().
since |
Horde_Crypt 2.7.0 |
---|
pgpPrettyKey(string $pgpdata) : string
Returns human readable information on a PGP key.
string | $pgpdata | The PGP data block. |
Tabular information on the PGP key.
None found |
pgpPacketSignature(string $pgpdata, string $email) : array
Returns only information on the first ID that matches the email address input.
string | $pgpdata | The PGP data block. |
string | An e-mail address. |
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:
None found |
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).
string | $pgpdata | See pgpPacketSignature(). |
string | $uid_idx | The UID index. |
See pgpPacketSignature().
None found |
getSignersKeyID(string $text) : string
Returns the key ID of the key used to sign a block of PGP data.
string | $text | The PGP signed text block. |
The key ID of the key used to sign $text, or null if not found.
None found |
verifyPassphrase(string $public_key, string $private_key, string $passphrase) : boolean
Verify a passphrase for a given public/private keypair.
string | $public_key | The user's PGP public key. |
string | $private_key | The user's PGP private key. |
string | $passphrase | The user's passphrase. |
Returns true on valid passphrase, false on invalid passphrase.
None found |
putPublicKeyserver(string $pubkey, string $server = self::KEYSERVER_PUBLIC, float $timeout = self::KEYSERVER_TIMEOUT)
Sends a PGP public key to a public keyserver.
string | $pubkey | The PGP public key |
string | $server | The keyserver to use. |
float | $timeout | The keyserver timeout. |
None found |
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.
string | $address | The email address of the PGP key. |
string | $server | The keyserver to use. |
float | $timeout | The keyserver timeout. |
The PGP key ID.
None found |
getFingerprintsFromKey(string $pgpdata) : array
Get the fingerprints from a key block.
string | $pgpdata | The PGP data block. |
The fingerprints in $pgpdata indexed by key id.
None found |
getPublicKeyFromPrivateKey(string $data) : string
Generates a public key from a private key.
string | $data | Armor text of private key. |
Armor text of public key, or null if it could not be generated.
None found |
encryptedSymmetrically(string $text) : boolean
Returns whether a text has been encrypted symmetrically.
string | $text | The PGP encrypted text. |
True if the text is symmetrically encrypted.
todo |
Return null, instead of exception, if tools are not available to determine whether data was encrypted symmetrically. |
---|
signMIMEPart(\Horde_Mime_Part $mime_part, array $params = array()) : mixed
Signs a MIME part using PGP.
\Horde_Mime_Part | $mime_part | The object to sign. |
array | $params | The parameters required for signing. ({@see _encryptSignature()}). |
A Horde_Mime_Part object that is signed according to RFC 3156.
None found |
encryptMIMEPart(\Horde_Mime_Part $mime_part, array $params = array()) : mixed
Encrypts a MIME part using PGP.
\Horde_Mime_Part | $mime_part | The object to encrypt. |
array | $params | The parameters required for encryption ({@see _encryptMessage()}). |
A Horde_Mime_Part object that is encrypted according to RFC 3156.
None found |
signAndEncryptMIMEPart(\Horde_Mime_Part $mime_part, array $sign_params = array(), array $encrypt_params = array()) : mixed
Signs and encrypts a MIME part using PGP.
\Horde_Mime_Part | $mime_part | The object to sign and encrypt. |
array | $sign_params | The parameters required for signing ({@see _encryptSignature()}). |
array | $encrypt_params | The parameters required for encryption ({@see _encryptMessage()}). |
A Horde_Mime_Part object that is signed and encrypted according to RFC 3156.
None found |
publicKeyMIMEPart(string $key) : \Horde_Mime_Part
Generates a Horde_Mime_Part object, in accordance with RFC 3156, that contains a public key.
string | $key | The public key. |
An object that contains the public key.
None found |
None found |
getPublicKeyserver( $keyid, $server = self::KEYSERVER_PUBLIC, $timeout = self::KEYSERVER_TIMEOUT, $address = null)
$keyid | ||
$server | ||
$timeout | ||
$address |
None found |
generateRevocation( $key, $email, $passphrase)
$key | ||
$passphrase |
None found |
_pgpPacketSignature(array $data, array $out) : array
Adds some data to the pgpPacketSignature*() function array.
array | $data | See pgpPacketSignature(). |
array | $out | The return array. |
The return array.
None found |